BsBuiltinEditorResources.cpp 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716
  1. #include "BsBuiltinEditorResources.h"
  2. #include "BsBuiltinResources.h"
  3. #include "BsGUIElementStyle.h"
  4. #include "BsGUILabel.h"
  5. #include "BsGUITexture.h"
  6. #include "BsGUIButton.h"
  7. #include "BsGUIInputBox.h"
  8. #include "BsGUIToggle.h"
  9. #include "BsGUIColor.h"
  10. #include "BsTextSprite.h"
  11. #include "BsSpriteTexture.h"
  12. #include "BsGUITreeViewEditBox.h"
  13. #include "BsGUIIntField.h"
  14. #include "BsGUIFloatField.h"
  15. #include "BsGUIColorField.h"
  16. #include "BsGUITextField.h"
  17. #include "BsGUIToggleField.h"
  18. #include "BsGUIVector2Field.h"
  19. #include "BsGUIVector3Field.h"
  20. #include "BsGUIVector4Field.h"
  21. #include "BsGUIComponentFoldout.h"
  22. #include "BsGUIFoldout.h"
  23. #include "BsGUIProgressBar.h"
  24. #include "BsGUISlider.h"
  25. #include "BsGUIDropDownContent.h"
  26. #include "BsGUIStatusBar.h"
  27. #include "BsFont.h"
  28. #include "BsFontImportOptions.h"
  29. #include "BsImporter.h"
  30. #include "BsGpuProgram.h"
  31. #include "BsShader.h"
  32. #include "BsShaderInclude.h"
  33. #include "BsTechnique.h"
  34. #include "BsPass.h"
  35. #include "BsMaterial.h"
  36. #include "BsBlendState.h"
  37. #include "BsDepthStencilState.h"
  38. #include "BsRasterizerState.h"
  39. #include "BsResources.h"
  40. #include "BsRTTIType.h"
  41. #include "BsFileSystem.h"
  42. #include "BsResourceManifest.h"
  43. namespace BansheeEngine
  44. {
  45. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  46. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  47. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  48. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  49. const String BuiltinEditorResources::TextureFieldStyleName = "GUITextureField";
  50. const String BuiltinEditorResources::TextureFieldLabelStyleName = "TextureFieldLabel";
  51. const String BuiltinEditorResources::TextureFieldDropStyleName = "TextureDrop";
  52. const String BuiltinEditorResources::TextureFieldClearBtnStyleName = "TextureClearButton";
  53. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  54. const UINT32 BuiltinEditorResources::DefaultFontSize = 11;
  55. const Color BuiltinEditorResources::TextNormalColor = Color(0.7f, 0.7f, 0.7f);
  56. const Color BuiltinEditorResources::TextActiveColor = Color(0.0f, 0.0f, 0.0f);
  57. const WString BuiltinEditorResources::GUISkinFile = L"GUISkin";
  58. const Path BuiltinEditorResources::ShaderFolder = L"Shaders\\";
  59. const Path BuiltinEditorResources::SkinFolder = L"Skin\\";
  60. const Path BuiltinEditorResources::IconFolder = L"Skin\\Icons";
  61. const Path BuiltinEditorResources::ShaderIncludeFolder = L"Includes\\";
  62. const Path BuiltinEditorResources::BuiltinRawDataFolder = RUNTIME_DATA_PATH + L"Raw\\Editor\\";
  63. const Path BuiltinEditorResources::EditorRawSkinFolder = BuiltinRawDataFolder + SkinFolder;
  64. const Path BuiltinEditorResources::EditorRawShaderFolder = BuiltinRawDataFolder + ShaderFolder;
  65. const Path BuiltinEditorResources::EditorRawShaderIncludeFolder = BuiltinRawDataFolder + ShaderIncludeFolder;
  66. const Path BuiltinEditorResources::BuiltinDataFolder = RUNTIME_DATA_PATH + L"Editor\\";
  67. const Path BuiltinEditorResources::EditorSkinFolder = BuiltinDataFolder + SkinFolder;
  68. const Path BuiltinEditorResources::EditorIconFolder = BuiltinDataFolder + IconFolder;
  69. const Path BuiltinEditorResources::EditorShaderFolder = BuiltinDataFolder + ShaderFolder;
  70. const Path BuiltinEditorResources::EditorShaderIncludeFolder = BuiltinDataFolder + ShaderIncludeFolder;
  71. const Path BuiltinEditorResources::ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
  72. const Path BuiltinEditorResources::DefaultWidgetLayoutPath = BuiltinDataFolder + "Layout.asset";
  73. const WString BuiltinEditorResources::FolderIconTex = L"FolderIcon.psd";
  74. const WString BuiltinEditorResources::MeshIconTex = L"MeshIcon.psd";
  75. const WString BuiltinEditorResources::TextureIconTex = L"TextureIcon.psd";
  76. const WString BuiltinEditorResources::FontIconTex = L"FontIcon.psd";
  77. const WString BuiltinEditorResources::PlainTextIconTex = L"TextIcon.psd";
  78. const WString BuiltinEditorResources::ScriptCodeIconTex = L"CSharpIcon.psd";
  79. const WString BuiltinEditorResources::ShaderIconTex = L"ShaderIcon.psd";
  80. const WString BuiltinEditorResources::ShaderIncludeIconTex = L"ShaderIncludeIcon.psd";
  81. const WString BuiltinEditorResources::MaterialIconTex = L"MaterialIcon.psd";
  82. const WString BuiltinEditorResources::SpriteTextureIconTex = L"SpriteIcon.psd";
  83. const WString BuiltinEditorResources::PrefabIconTex = L"PrefabIcon.psd";
  84. const WString BuiltinEditorResources::LogInfoIconTex = L"IconInfo.psd";
  85. const WString BuiltinEditorResources::LogWarningIconTex = L"IconWarning.psd";
  86. const WString BuiltinEditorResources::LogErrorIconTex = L"IconError.psd";
  87. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.png";
  88. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.png";
  89. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.png";
  90. const WString BuiltinEditorResources::ButtonLeftNormalTex = L"ButtonLeftNormal.png";
  91. const WString BuiltinEditorResources::ButtonLeftHoverTex = L"ButtonLeftHover.png";
  92. const WString BuiltinEditorResources::ButtonLeftActiveTex = L"ButtonLeftActive.png";
  93. const WString BuiltinEditorResources::ButtonRightNormalTex = L"ButtonRightNormal.png";
  94. const WString BuiltinEditorResources::ButtonRightHoverTex = L"ButtonRightHover.png";
  95. const WString BuiltinEditorResources::ButtonRightActiveTex = L"ButtonRightActive.png";
  96. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.png";
  97. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.png";
  98. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleNormalOn.png";
  99. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleHoverOn.png";
  100. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.png";
  101. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.png";
  102. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxActive.png";
  103. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectDropNormal.png";
  104. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectDropNormalOn.png";
  105. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectDropClearNormal.png";
  106. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectDropClearHover.png";
  107. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectDropClearActive.png";
  108. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownButtonNormal.png";
  109. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownButtonHover.png";
  110. const WString BuiltinEditorResources::DropDownBtnActiveTex = L"DropDownButtonActive.png";
  111. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutOpenNormal.psd";
  112. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutOpenHover.psd";
  113. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutClosedNormal.psd";
  114. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutClosedHover.psd";
  115. const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"CmpFoldoutOpenNormal.psd";
  116. const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"CmpFoldoutOpenHover.psd";
  117. const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"CmpFoldoutOpenActive.psd";
  118. const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"CmpFoldoutClosedNormal.psd";
  119. const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"CmpFoldoutClosedHover.psd";
  120. const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"CmpFoldoutClosedActive.psd";
  121. const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
  122. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.png";
  123. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.png";
  124. const WString BuiltinEditorResources::CloseButtonNormalTex = L"CloseButtonNormal.png";
  125. const WString BuiltinEditorResources::CloseButtonHoverTex = L"CloseButtonHover.png";
  126. const WString BuiltinEditorResources::CloseButtonActiveTex = L"CloseButtonActive.png";
  127. const WString BuiltinEditorResources::MinButtonNormalTex = L"MinimizeButtonNormal.png";
  128. const WString BuiltinEditorResources::MinButtonHoverTex = L"MinimizeButtonHover.png";
  129. const WString BuiltinEditorResources::MinButtonActiveTex = L"MinimizeButtonActive.png";
  130. const WString BuiltinEditorResources::MaxButtonNormalTex = L"MaximizeButtonNormal.png";
  131. const WString BuiltinEditorResources::MaxButtonHoverTex = L"MaximizeButtonHover.png";
  132. const WString BuiltinEditorResources::MaxButtonActiveTex = L"MaximizeButtonActive.png";
  133. const WString BuiltinEditorResources::TabBarBackgroundTex = L"TabBarBackground.png";
  134. const WString BuiltinEditorResources::TabButtonNormalTex = L"TabButtonNormal.png";
  135. const WString BuiltinEditorResources::TabButtonFocusedTex = L"TabButtonFocused.png";
  136. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollBarUpNormal.psd";
  137. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollBarUpHover.psd";
  138. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollBarUpActive.psd";
  139. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollBarDownNormal.psd";
  140. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollBarDownHover.psd";
  141. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollBarDownActive.psd";
  142. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollBarLeftNormal.psd";
  143. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollBarLeftHover.psd";
  144. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollBarLeftActive.psd";
  145. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollBarRightNormal.psd";
  146. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollBarRightHover.psd";
  147. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollBarRightActive.psd";
  148. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHorzHandleNormal.psd";
  149. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHorzHandleHover.psd";
  150. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHorzHandleActive.psd";
  151. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVertHandleNormal.psd";
  152. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVertHandleHover.psd";
  153. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVertHandleActive.psd";
  154. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.psd";
  155. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownButtonNormal.psd";
  156. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownButtonHover.psd";
  157. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxBtnUpNormal.psd";
  158. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxBtnUpHover.psd";
  159. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxBtnDownNormal.psd";
  160. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxBtnDownHover.psd";
  161. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownExpNormal.psd";
  162. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownExpHover.psd";
  163. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownSeparator.psd";
  164. const WString BuiltinEditorResources::DropDownBoxBtnUpArrowTex = L"DropDownBoxBtnUpArrow.psd";
  165. const WString BuiltinEditorResources::DropDownBoxBtnDownArrowTex = L"DropDownBoxBtnDownArrow.psd";
  166. const WString BuiltinEditorResources::ScrollBarBgTex = L"ScrollBarBg.psd";
  167. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBg.psd";
  168. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.psd";
  169. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.psd";
  170. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarBansheeLogo.psd";
  171. const WString BuiltinEditorResources::DockSliderNormalTex = L"DockSliderNormal.png";
  172. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"TreeViewExpandButtonOffNormal.psd";
  173. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"TreeViewExpandButtonOffHover.psd";
  174. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"TreeViewExpandButtonOnNormal.psd";
  175. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
  176. const WString BuiltinEditorResources::TreeViewHighlightBackground = L"TreeViewHighlightBackground.psd";
  177. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  178. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  179. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  180. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  181. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  182. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  183. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.psd";
  184. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.psd";
  185. const WString BuiltinEditorResources::SelectionAreaTex = L"SelectionHighlight.psd";
  186. const WString BuiltinEditorResources::SelectionBgTex = L"SelectionBg.psd";
  187. const WString BuiltinEditorResources::TextureDropTex = L"TextureDrop.psd";
  188. const WString BuiltinEditorResources::TextureDropOnTex = L"TextureDropOn.psd";
  189. const WString BuiltinEditorResources::XButtonNormalTex = L"XBtnNormal.psd";
  190. const WString BuiltinEditorResources::XButtonHoverTex = L"XBtnHover.psd";
  191. const WString BuiltinEditorResources::StatusBarBgTex = L"StatusBarBackground.png";
  192. const WString BuiltinEditorResources::ScrollAreaBgTex = L"ScrollAreaBg.png";
  193. /************************************************************************/
  194. /* SHADERS */
  195. /************************************************************************/
  196. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  197. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  198. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  199. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  200. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  201. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  202. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  203. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  204. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  205. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  206. const WString BuiltinEditorResources::ShaderWireHandleFile = L"WireHandle.bsl";
  207. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  208. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  209. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  210. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  211. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  212. BuiltinEditorResources::BuiltinEditorResources()
  213. {
  214. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  215. absoluteDataPath.append(BuiltinDataFolder);
  216. #if BS_DEBUG_MODE
  217. if (BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder, BuiltinDataFolder + L"Timestamp.asset"))
  218. {
  219. mResourceManifest = ResourceManifest::create("BuiltinResources");
  220. gResources().registerResourceManifest(mResourceManifest);
  221. preprocess();
  222. BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
  223. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  224. absoluteDataPath.append(BuiltinDataFolder);
  225. ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
  226. }
  227. #endif
  228. if (mResourceManifest == nullptr)
  229. {
  230. if (FileSystem::exists(ResourceManifestPath))
  231. mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
  232. if (mResourceManifest == nullptr)
  233. mResourceManifest = ResourceManifest::create("BuiltinResources");
  234. gResources().registerResourceManifest(mResourceManifest);
  235. }
  236. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  237. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  238. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  239. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  240. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  241. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  242. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  243. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  244. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  245. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  246. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  247. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  248. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  249. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  250. mShaderHandleWire = getShader(ShaderWireHandleFile);
  251. mShaderSelection = getShader(ShaderSelectionFile);
  252. mSkin = gResources().load<GUISkin>(BuiltinDataFolder + (GUISkinFile + L".asset"));
  253. }
  254. BuiltinEditorResources::~BuiltinEditorResources()
  255. { }
  256. void BuiltinEditorResources::preprocess()
  257. {
  258. FileSystem::remove(EditorShaderIncludeFolder);
  259. FileSystem::remove(EditorShaderFolder);
  260. FileSystem::remove(EditorSkinFolder);
  261. BuiltinResourcesHelper::importAssets(EditorRawShaderIncludeFolder, EditorShaderIncludeFolder, mResourceManifest); // Hidden dependency: Includes must be imported before shaders
  262. BuiltinResourcesHelper::importAssets(EditorRawShaderFolder, EditorShaderFolder, mResourceManifest);
  263. BuiltinResourcesHelper::importAssets(EditorRawSkinFolder, EditorSkinFolder, mResourceManifest);
  264. // Import font
  265. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, BuiltinDataFolder, DefaultFontSize, false, mResourceManifest);
  266. // Generate & save GUI sprite textures
  267. BuiltinResourcesHelper::generateSpriteTextures(EditorSkinFolder, mResourceManifest);
  268. // Generate & save GUI skin
  269. {
  270. HGUISkin skin = generateGUISkin();
  271. Path outputPath = FileSystem::getWorkingDirectoryPath() + BuiltinDataFolder + (GUISkinFile + L".asset");
  272. Resources::instance().save(skin, outputPath, true);
  273. mResourceManifest->registerResource(skin.getUUID(), outputPath);
  274. }
  275. Resources::instance().unloadAllUnused();
  276. }
  277. HGUISkin BuiltinEditorResources::generateGUISkin()
  278. {
  279. HGUISkin skin = GUISkin::create();
  280. Path fontPath = FileSystem::getWorkingDirectoryPath();
  281. fontPath.append(BuiltinDataFolder);
  282. fontPath.append(DefaultFontFilename + L".asset");
  283. HFont font = Resources::instance().load<Font>(fontPath);
  284. // Blank entry
  285. GUIElementStyle blankStyle;
  286. skin->setStyle("Blank", blankStyle);
  287. skin->setStyle(GUITexture::getGUITypeName(), blankStyle);
  288. // Label
  289. GUIElementStyle labelStyle;
  290. labelStyle.font = font;
  291. labelStyle.fontSize = DefaultFontSize;
  292. labelStyle.fixedWidth = false;
  293. labelStyle.fixedHeight = true;
  294. labelStyle.height = 14;
  295. labelStyle.minWidth = 10;
  296. labelStyle.normal.textColor = TextNormalColor;
  297. skin->setStyle(GUILabel::getGUITypeName(), labelStyle);
  298. // Window frame
  299. GUIElementStyle windowFrameStyle;
  300. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  301. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  302. windowFrameStyle.border.left = 1;
  303. windowFrameStyle.border.right = 1;
  304. windowFrameStyle.border.top = 1;
  305. windowFrameStyle.border.bottom = 1;
  306. skin->setStyle("WindowFrame", windowFrameStyle);
  307. // Button
  308. GUIElementStyle buttonStyle;
  309. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  310. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  311. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  312. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  313. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  314. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  315. buttonStyle.normal.textColor = TextNormalColor;
  316. buttonStyle.hover.textColor = TextNormalColor;
  317. buttonStyle.active.textColor = TextActiveColor;
  318. buttonStyle.normalOn.textColor = TextActiveColor;
  319. buttonStyle.hoverOn.textColor = TextActiveColor;
  320. buttonStyle.activeOn.textColor = TextActiveColor;
  321. buttonStyle.border.left = 2;
  322. buttonStyle.border.right = 2;
  323. buttonStyle.border.top = 2;
  324. buttonStyle.border.bottom = 4;
  325. buttonStyle.contentOffset.top = 2;
  326. buttonStyle.contentOffset.left = 3;
  327. buttonStyle.contentOffset.right = 3;
  328. buttonStyle.margins.bottom = 2;
  329. buttonStyle.fixedHeight = true;
  330. buttonStyle.height = 21;
  331. buttonStyle.minWidth = 20;
  332. buttonStyle.font = font;
  333. buttonStyle.fontSize = DefaultFontSize;
  334. buttonStyle.textHorzAlign = THA_Center;
  335. buttonStyle.textVertAlign = TVA_Center;
  336. skin->setStyle(GUIButton::getGUITypeName(), buttonStyle);
  337. // Left edge button
  338. GUIElementStyle leftButtonStyle;
  339. leftButtonStyle.normal.texture = getGUITexture(ButtonLeftNormalTex);
  340. leftButtonStyle.hover.texture = getGUITexture(ButtonLeftHoverTex);
  341. leftButtonStyle.active.texture = getGUITexture(ButtonLeftActiveTex);
  342. leftButtonStyle.normalOn.texture = getGUITexture(ButtonLeftActiveTex);
  343. leftButtonStyle.hoverOn.texture = getGUITexture(ButtonLeftActiveTex);
  344. leftButtonStyle.activeOn.texture = getGUITexture(ButtonLeftActiveTex);
  345. leftButtonStyle.normal.textColor = TextNormalColor;
  346. leftButtonStyle.hover.textColor = TextNormalColor;
  347. leftButtonStyle.active.textColor = TextActiveColor;
  348. leftButtonStyle.normalOn.textColor = TextActiveColor;
  349. leftButtonStyle.hoverOn.textColor = TextActiveColor;
  350. leftButtonStyle.activeOn.textColor = TextActiveColor;
  351. leftButtonStyle.border.left = 7;
  352. leftButtonStyle.border.right = 2;
  353. leftButtonStyle.border.top = 2;
  354. leftButtonStyle.border.bottom = 4;
  355. leftButtonStyle.contentOffset.top = 2;
  356. leftButtonStyle.contentOffset.left = 7;
  357. leftButtonStyle.contentOffset.right = 3;
  358. leftButtonStyle.margins.bottom = 2;
  359. leftButtonStyle.fixedHeight = true;
  360. leftButtonStyle.height = 21;
  361. leftButtonStyle.minWidth = 20;
  362. leftButtonStyle.font = font;
  363. leftButtonStyle.fontSize = DefaultFontSize;
  364. leftButtonStyle.textHorzAlign = THA_Center;
  365. leftButtonStyle.textVertAlign = TVA_Center;
  366. skin->setStyle("ButtonLeft", leftButtonStyle);
  367. // Right edge button
  368. GUIElementStyle rightButtonStyle;
  369. rightButtonStyle.normal.texture = getGUITexture(ButtonRightNormalTex);
  370. rightButtonStyle.hover.texture = getGUITexture(ButtonRightHoverTex);
  371. rightButtonStyle.active.texture = getGUITexture(ButtonRightActiveTex);
  372. rightButtonStyle.normalOn.texture = getGUITexture(ButtonRightActiveTex);
  373. rightButtonStyle.hoverOn.texture = getGUITexture(ButtonRightActiveTex);
  374. rightButtonStyle.activeOn.texture = getGUITexture(ButtonRightActiveTex);
  375. rightButtonStyle.normal.textColor = TextNormalColor;
  376. rightButtonStyle.hover.textColor = TextNormalColor;
  377. rightButtonStyle.active.textColor = TextActiveColor;
  378. rightButtonStyle.normalOn.textColor = TextActiveColor;
  379. rightButtonStyle.hoverOn.textColor = TextActiveColor;
  380. rightButtonStyle.activeOn.textColor = TextActiveColor;
  381. rightButtonStyle.border.left = 2;
  382. rightButtonStyle.border.right = 7;
  383. rightButtonStyle.border.top = 2;
  384. rightButtonStyle.border.bottom = 4;
  385. rightButtonStyle.contentOffset.top = 2;
  386. rightButtonStyle.contentOffset.left = 3;
  387. rightButtonStyle.contentOffset.right = 7;
  388. rightButtonStyle.margins.bottom = 2;
  389. rightButtonStyle.fixedHeight = true;
  390. rightButtonStyle.height = 21;
  391. rightButtonStyle.minWidth = 20;
  392. rightButtonStyle.font = font;
  393. rightButtonStyle.fontSize = DefaultFontSize;
  394. rightButtonStyle.textHorzAlign = THA_Center;
  395. rightButtonStyle.textVertAlign = TVA_Center;
  396. skin->setStyle("ButtonRight", rightButtonStyle);
  397. // Toggle
  398. GUIElementStyle toggleStyle;
  399. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  400. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  401. toggleStyle.active.texture = toggleStyle.hover.texture;
  402. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  403. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  404. toggleStyle.activeOn.texture = toggleStyle.hoverOn.texture;
  405. toggleStyle.fixedHeight = true;
  406. toggleStyle.fixedWidth = true;
  407. toggleStyle.margins.bottom = 2;
  408. toggleStyle.height = 15;
  409. toggleStyle.width = 13;
  410. skin->setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  411. // Color
  412. GUIElementStyle colorStyle;
  413. colorStyle.margins.left = 2;
  414. colorStyle.margins.right = 2;
  415. colorStyle.margins.top = 2;
  416. colorStyle.margins.bottom = 2;
  417. colorStyle.fixedHeight = true;
  418. colorStyle.height = 10;
  419. colorStyle.minWidth = 10;
  420. skin->setStyle(GUIColor::getGUITypeName(), colorStyle);
  421. // Window background texture
  422. GUIElementStyle windowBgStyle;
  423. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTex);
  424. skin->setStyle("WindowBackground", windowBgStyle);
  425. // Window title bar background
  426. GUIElementStyle titleBarBgStyle;
  427. titleBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
  428. titleBarBgStyle.fixedHeight = true;
  429. titleBarBgStyle.height = 16;
  430. skin->setStyle("TitleBarBackground", titleBarBgStyle);
  431. // Tabbed title bar tab button
  432. GUIElementStyle tabbedBarButton;
  433. tabbedBarButton.normal.texture = getGUITexture(TabButtonNormalTex);
  434. tabbedBarButton.hover.texture = tabbedBarButton.normal.texture;
  435. tabbedBarButton.active.texture = getGUITexture(TabButtonFocusedTex);
  436. tabbedBarButton.normalOn.texture = tabbedBarButton.active.texture;
  437. tabbedBarButton.hoverOn.texture = tabbedBarButton.active.texture;
  438. tabbedBarButton.activeOn.texture = tabbedBarButton.active.texture;
  439. tabbedBarButton.normal.textColor = TextNormalColor;
  440. tabbedBarButton.hover.textColor = TextNormalColor;
  441. tabbedBarButton.active.textColor = TextActiveColor;
  442. tabbedBarButton.normalOn.textColor = TextActiveColor;
  443. tabbedBarButton.hoverOn.textColor = TextActiveColor;
  444. tabbedBarButton.activeOn.textColor = TextActiveColor;
  445. tabbedBarButton.border.left = 12;
  446. tabbedBarButton.border.right = 12;
  447. tabbedBarButton.margins.left = 5;
  448. tabbedBarButton.margins.right = 5;
  449. tabbedBarButton.contentOffset.top = 3;
  450. tabbedBarButton.contentOffset.left = 6;
  451. tabbedBarButton.contentOffset.right = 6;
  452. tabbedBarButton.fixedHeight = true;
  453. tabbedBarButton.height = 15;
  454. tabbedBarButton.minWidth = 24;
  455. tabbedBarButton.maxWidth = 110;
  456. tabbedBarButton.font = font;
  457. tabbedBarButton.fontSize = DefaultFontSize;
  458. tabbedBarButton.textHorzAlign = THA_Center;
  459. tabbedBarButton.textVertAlign = TVA_Center;
  460. skin->setStyle("TabbedBarBtn", tabbedBarButton);
  461. // Tabbed title bar drag/drop button
  462. GUIElementStyle tabbedBarDropButton;
  463. tabbedBarDropButton.fixedHeight = true;
  464. tabbedBarDropButton.fixedWidth = true;
  465. tabbedBarDropButton.height = 13;
  466. tabbedBarDropButton.width = 6;
  467. skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
  468. // Window minimize button
  469. GUIElementStyle winMinButtonStyle;
  470. winMinButtonStyle.normal.texture = getGUITexture(MinButtonNormalTex);
  471. winMinButtonStyle.hover.texture = getGUITexture(MinButtonHoverTex);
  472. winMinButtonStyle.active.texture = getGUITexture(MinButtonActiveTex);
  473. winMinButtonStyle.fixedHeight = true;
  474. winMinButtonStyle.fixedWidth = true;
  475. winMinButtonStyle.height = 14;
  476. winMinButtonStyle.width = 14;
  477. skin->setStyle("WinMinimizeBtn", winMinButtonStyle);
  478. // Window maximize button
  479. GUIElementStyle winMaxButtonStyle;
  480. winMaxButtonStyle.normal.texture = getGUITexture(MaxButtonNormalTex);
  481. winMaxButtonStyle.hover.texture = getGUITexture(MaxButtonHoverTex);
  482. winMaxButtonStyle.active.texture = getGUITexture(MaxButtonActiveTex);
  483. winMaxButtonStyle.fixedHeight = true;
  484. winMaxButtonStyle.fixedWidth = true;
  485. winMaxButtonStyle.height = 14;
  486. winMaxButtonStyle.width = 14;
  487. skin->setStyle("WinMaximizeBtn", winMaxButtonStyle);
  488. // Window close button
  489. GUIElementStyle winCloseButtonStyle;
  490. winCloseButtonStyle.normal.texture = getGUITexture(CloseButtonNormalTex);
  491. winCloseButtonStyle.hover.texture = getGUITexture(CloseButtonHoverTex);
  492. winCloseButtonStyle.active.texture = getGUITexture(CloseButtonActiveTex);
  493. winCloseButtonStyle.fixedHeight = true;
  494. winCloseButtonStyle.fixedWidth = true;
  495. winCloseButtonStyle.height = 14;
  496. winCloseButtonStyle.width = 14;
  497. skin->setStyle("WinCloseBtn", winCloseButtonStyle);
  498. // Input box
  499. GUIElementStyle inputBoxStyle;
  500. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  501. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  502. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  503. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  504. inputBoxStyle.normal.textColor = TextNormalColor;
  505. inputBoxStyle.hover.textColor = TextNormalColor;
  506. inputBoxStyle.focused.textColor = TextNormalColor;
  507. inputBoxStyle.active.textColor = TextNormalColor;
  508. inputBoxStyle.border.left = 4;
  509. inputBoxStyle.border.right = 4;
  510. inputBoxStyle.border.top = 4;
  511. inputBoxStyle.border.bottom = 6;
  512. inputBoxStyle.contentOffset.left = 4;
  513. inputBoxStyle.contentOffset.right = 4;
  514. inputBoxStyle.contentOffset.top = 4;
  515. inputBoxStyle.contentOffset.bottom = 4;
  516. inputBoxStyle.margins.bottom = 2;
  517. inputBoxStyle.fixedHeight = true;
  518. inputBoxStyle.height = 21;
  519. inputBoxStyle.minWidth = 10;
  520. inputBoxStyle.font = font;
  521. inputBoxStyle.fontSize = DefaultFontSize;
  522. inputBoxStyle.textHorzAlign = THA_Left;
  523. inputBoxStyle.textVertAlign = TVA_Top;
  524. skin->setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  525. /************************************************************************/
  526. /* SCROLL BAR */
  527. /************************************************************************/
  528. // Up button
  529. GUIElementStyle scrollUpBtnStyle;
  530. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  531. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  532. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  533. scrollUpBtnStyle.fixedHeight = true;
  534. scrollUpBtnStyle.fixedWidth = true;
  535. scrollUpBtnStyle.height = 4;
  536. scrollUpBtnStyle.width = 8;
  537. skin->setStyle("ScrollUpBtn", scrollUpBtnStyle);
  538. // Down button
  539. GUIElementStyle scrollDownBtnStyle;
  540. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  541. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  542. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  543. scrollDownBtnStyle.fixedHeight = true;
  544. scrollDownBtnStyle.fixedWidth = true;
  545. scrollDownBtnStyle.height = 4;
  546. scrollDownBtnStyle.width = 8;
  547. skin->setStyle("ScrollDownBtn", scrollDownBtnStyle);
  548. // Left button
  549. GUIElementStyle scrollLeftBtnStyle;
  550. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  551. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  552. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  553. scrollLeftBtnStyle.fixedHeight = true;
  554. scrollLeftBtnStyle.fixedWidth = true;
  555. scrollLeftBtnStyle.height = 8;
  556. scrollLeftBtnStyle.width = 4;
  557. skin->setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  558. // Right button
  559. GUIElementStyle scrollRightBtnStyle;
  560. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  561. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  562. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  563. scrollRightBtnStyle.fixedHeight = true;
  564. scrollRightBtnStyle.fixedWidth = true;
  565. scrollRightBtnStyle.height = 8;
  566. scrollRightBtnStyle.width = 4;
  567. skin->setStyle("ScrollRightBtn", scrollRightBtnStyle);
  568. // Horizontal handle
  569. GUIElementStyle scrollBarHorzBtnStyle;
  570. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  571. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  572. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  573. scrollBarHorzBtnStyle.fixedHeight = true;
  574. scrollBarHorzBtnStyle.fixedWidth = true;
  575. scrollBarHorzBtnStyle.height = 6;
  576. scrollBarHorzBtnStyle.width = 4;
  577. skin->setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  578. // Vertical handle
  579. GUIElementStyle scrollBarVertBtnStyle;
  580. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  581. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  582. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  583. scrollBarVertBtnStyle.fixedHeight = true;
  584. scrollBarVertBtnStyle.fixedWidth = true;
  585. scrollBarVertBtnStyle.height = 4;
  586. scrollBarVertBtnStyle.width = 6;
  587. skin->setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  588. HSpriteTexture scrollBarBgPtr = getGUITexture(ScrollBarBgTex);
  589. // Vertical scroll bar
  590. GUIElementStyle vertScrollBarStyle;
  591. vertScrollBarStyle.normal.texture = scrollBarBgPtr;
  592. vertScrollBarStyle.hover.texture = scrollBarBgPtr;
  593. vertScrollBarStyle.active.texture = scrollBarBgPtr;
  594. vertScrollBarStyle.fixedHeight = false;
  595. vertScrollBarStyle.fixedWidth = true;
  596. vertScrollBarStyle.minHeight = 16;
  597. vertScrollBarStyle.width = 8;
  598. skin->setStyle("ScrollBarVert", vertScrollBarStyle);
  599. // Horizontal scroll bar
  600. GUIElementStyle horzScrollBarStyle;
  601. horzScrollBarStyle.normal.texture = scrollBarBgPtr;
  602. horzScrollBarStyle.hover.texture = scrollBarBgPtr;
  603. horzScrollBarStyle.active.texture = scrollBarBgPtr;
  604. horzScrollBarStyle.fixedHeight = true;
  605. horzScrollBarStyle.fixedWidth = false;
  606. horzScrollBarStyle.minWidth = 16;
  607. horzScrollBarStyle.height = 8;
  608. skin->setStyle("ScrollBarHorz", horzScrollBarStyle);
  609. /************************************************************************/
  610. /* DROP DOWN BOX */
  611. /************************************************************************/
  612. // ListBox button
  613. GUIElementStyle dropDownListStyle;
  614. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  615. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  616. dropDownListStyle.active.texture = getGUITexture(DropDownBtnActiveTex);
  617. dropDownListStyle.normalOn.texture = dropDownListStyle.active.texture;
  618. dropDownListStyle.hoverOn.texture = dropDownListStyle.active.texture;
  619. dropDownListStyle.activeOn.texture = dropDownListStyle.active.texture;
  620. dropDownListStyle.normal.textColor = TextNormalColor;
  621. dropDownListStyle.hover.textColor = TextNormalColor;
  622. dropDownListStyle.active.textColor = TextNormalColor;
  623. dropDownListStyle.normalOn.textColor = TextNormalColor;
  624. dropDownListStyle.hoverOn.textColor = TextNormalColor;
  625. dropDownListStyle.activeOn.textColor = TextNormalColor;
  626. dropDownListStyle.fixedHeight = true;
  627. dropDownListStyle.fixedWidth = false;
  628. dropDownListStyle.height = 21;
  629. dropDownListStyle.minWidth = 20;
  630. dropDownListStyle.contentOffset.left = 3;
  631. dropDownListStyle.contentOffset.right = 18;
  632. dropDownListStyle.contentOffset.top = 2;
  633. dropDownListStyle.contentOffset.bottom = 2;
  634. dropDownListStyle.border.left = 2;
  635. dropDownListStyle.border.right = 16;
  636. dropDownListStyle.border.top = 2;
  637. dropDownListStyle.border.bottom = 4;
  638. dropDownListStyle.margins.bottom = 2;
  639. dropDownListStyle.font = font;
  640. dropDownListStyle.fontSize = DefaultFontSize;
  641. dropDownListStyle.textHorzAlign = THA_Left;
  642. dropDownListStyle.textVertAlign = TVA_Center;
  643. skin->setStyle("ListBox", dropDownListStyle);
  644. // DropDown scroll up button arrow
  645. HSpriteTexture dropDownBtnScrollUpArrow = getGUITexture(DropDownBoxBtnUpArrowTex);
  646. GUIElementStyle dropDownScrollUpBtnArrowStyle;
  647. dropDownScrollUpBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnUpArrowTex);
  648. dropDownScrollUpBtnArrowStyle.hover.texture = dropDownScrollUpBtnArrowStyle.normal.texture;
  649. dropDownScrollUpBtnArrowStyle.active.texture = dropDownScrollUpBtnArrowStyle.hover.texture;
  650. dropDownScrollUpBtnArrowStyle.fixedHeight = true;
  651. dropDownScrollUpBtnArrowStyle.fixedWidth = false;
  652. dropDownScrollUpBtnArrowStyle.height = 7;
  653. dropDownScrollUpBtnArrowStyle.width = 30;
  654. dropDownScrollUpBtnArrowStyle.border.left = 1;
  655. dropDownScrollUpBtnArrowStyle.border.right = 1;
  656. dropDownScrollUpBtnArrowStyle.border.top = 1;
  657. dropDownScrollUpBtnArrowStyle.border.bottom = 1;
  658. skin->setStyle("ListBoxScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  659. skin->setStyle("MenuBarScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  660. skin->setStyle("ContextMenuScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  661. // DropDown scroll up button
  662. GUIElementStyle dropDownScrollUpBtnStyle;
  663. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  664. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  665. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  666. dropDownScrollUpBtnStyle.fixedHeight = true;
  667. dropDownScrollUpBtnStyle.fixedWidth = false;
  668. dropDownScrollUpBtnStyle.height = 7;
  669. dropDownScrollUpBtnStyle.width = 30;
  670. dropDownScrollUpBtnStyle.border.left = 1;
  671. dropDownScrollUpBtnStyle.border.right = 1;
  672. dropDownScrollUpBtnStyle.border.top = 1;
  673. dropDownScrollUpBtnStyle.border.bottom = 1;
  674. skin->setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  675. skin->setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  676. skin->setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  677. // DropDown scroll down button arrow
  678. GUIElementStyle dropDownScrollDownBtnArrowStyle;
  679. dropDownScrollDownBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnDownArrowTex);
  680. dropDownScrollDownBtnArrowStyle.hover.texture = dropDownScrollDownBtnArrowStyle.normal.texture;
  681. dropDownScrollDownBtnArrowStyle.active.texture = dropDownScrollDownBtnArrowStyle.hover.texture;
  682. dropDownScrollDownBtnArrowStyle.fixedHeight = true;
  683. dropDownScrollDownBtnArrowStyle.fixedWidth = false;
  684. dropDownScrollDownBtnArrowStyle.height = 7;
  685. dropDownScrollDownBtnArrowStyle.width = 30;
  686. dropDownScrollDownBtnArrowStyle.border.left = 1;
  687. dropDownScrollDownBtnArrowStyle.border.right = 1;
  688. dropDownScrollDownBtnArrowStyle.border.top = 1;
  689. dropDownScrollDownBtnArrowStyle.border.bottom = 1;
  690. skin->setStyle("ListBoxScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  691. skin->setStyle("MenuBarScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  692. skin->setStyle("ContextMenuScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  693. // DropDown scroll down button
  694. GUIElementStyle dropDownScrollDownBtnStyle;
  695. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  696. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  697. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  698. dropDownScrollDownBtnStyle.fixedHeight = true;
  699. dropDownScrollDownBtnStyle.fixedWidth = false;
  700. dropDownScrollDownBtnStyle.height = 7;
  701. dropDownScrollDownBtnStyle.width = 30;
  702. dropDownScrollDownBtnStyle.border.left = 1;
  703. dropDownScrollDownBtnStyle.border.right = 1;
  704. dropDownScrollDownBtnStyle.border.top = 1;
  705. dropDownScrollDownBtnStyle.border.bottom = 1;
  706. skin->setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  707. skin->setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  708. skin->setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  709. // DropDown entry button
  710. GUIElementStyle dropDownEntryBtnStyle;
  711. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  712. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  713. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  714. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  715. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  716. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  717. dropDownEntryBtnStyle.normal.textColor = TextNormalColor;
  718. dropDownEntryBtnStyle.hover.textColor = TextNormalColor;
  719. dropDownEntryBtnStyle.active.textColor = TextNormalColor;
  720. dropDownEntryBtnStyle.normalOn.textColor = TextNormalColor;
  721. dropDownEntryBtnStyle.hoverOn.textColor = TextNormalColor;
  722. dropDownEntryBtnStyle.activeOn.textColor = TextNormalColor;
  723. dropDownEntryBtnStyle.fixedHeight = true;
  724. dropDownEntryBtnStyle.fixedWidth = false;
  725. dropDownEntryBtnStyle.height = 14;
  726. dropDownEntryBtnStyle.width = 30;
  727. dropDownEntryBtnStyle.border.left = 1;
  728. dropDownEntryBtnStyle.border.right = 1;
  729. dropDownEntryBtnStyle.border.top = 1;
  730. dropDownEntryBtnStyle.border.bottom = 1;
  731. dropDownEntryBtnStyle.font = font;
  732. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  733. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  734. dropDownEntryBtnStyle.textVertAlign = TVA_Top;
  735. skin->setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  736. // DropDown entry button with expand
  737. GUIElementStyle dropDownEntryExpBtnStyle;
  738. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  739. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  740. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  741. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  742. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  743. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  744. dropDownEntryExpBtnStyle.normal.textColor = TextNormalColor;
  745. dropDownEntryExpBtnStyle.hover.textColor = TextNormalColor;
  746. dropDownEntryExpBtnStyle.active.textColor = TextNormalColor;
  747. dropDownEntryExpBtnStyle.normalOn.textColor = TextNormalColor;
  748. dropDownEntryExpBtnStyle.hoverOn.textColor = TextNormalColor;
  749. dropDownEntryExpBtnStyle.activeOn.textColor = TextNormalColor;
  750. dropDownEntryExpBtnStyle.fixedHeight = true;
  751. dropDownEntryExpBtnStyle.fixedWidth = false;
  752. dropDownEntryExpBtnStyle.height = 14;
  753. dropDownEntryExpBtnStyle.width = 30;
  754. dropDownEntryExpBtnStyle.border.left = 1;
  755. dropDownEntryExpBtnStyle.border.right = 6;
  756. dropDownEntryExpBtnStyle.border.top = 1;
  757. dropDownEntryExpBtnStyle.border.bottom = 1;
  758. dropDownEntryExpBtnStyle.font = font;
  759. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  760. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  761. dropDownEntryExpBtnStyle.textVertAlign = TVA_Top;
  762. skin->setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  763. // Drop down separator
  764. GUIElementStyle dropDownSeparatorStyle;
  765. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  766. dropDownSeparatorStyle.fixedHeight = true;
  767. dropDownSeparatorStyle.fixedWidth = false;
  768. dropDownSeparatorStyle.height = 3;
  769. dropDownSeparatorStyle.width = 30;
  770. dropDownSeparatorStyle.border.left = 1;
  771. dropDownSeparatorStyle.border.right = 1;
  772. dropDownSeparatorStyle.border.top = 1;
  773. dropDownSeparatorStyle.border.bottom = 1;
  774. skin->setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  775. // Drop down content
  776. GUIElementStyle dropDownContentStyle;
  777. dropDownContentStyle.minWidth = 50;
  778. dropDownContentStyle.minHeight = 20;
  779. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  780. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  781. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  782. skin->setStyle("ListBoxContent", dropDownContentStyle);
  783. skin->setStyle("MenuBarContent", dropDownContentStyle);
  784. skin->setStyle("ContextMenuContent", dropDownContentStyle);
  785. // DropDown box frame
  786. GUIElementStyle dropDownBoxStyle;
  787. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  788. dropDownBoxStyle.hover.texture = dropDownEntryBtnStyle.normal.texture;
  789. dropDownBoxStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  790. dropDownBoxStyle.fixedHeight = false;
  791. dropDownBoxStyle.fixedWidth = false;
  792. dropDownBoxStyle.border.left = 1;
  793. dropDownBoxStyle.border.right = 1;
  794. dropDownBoxStyle.border.top = 1;
  795. dropDownBoxStyle.border.bottom = 1;
  796. dropDownBoxStyle.margins.left = 1;
  797. dropDownBoxStyle.margins.right = 1;
  798. dropDownBoxStyle.margins.top = 1;
  799. dropDownBoxStyle.margins.bottom = 1;
  800. skin->setStyle("ListBoxFrame", dropDownBoxStyle);
  801. skin->setStyle("MenuBarFrame", dropDownBoxStyle);
  802. skin->setStyle("ContextMenuFrame", dropDownBoxStyle);
  803. /************************************************************************/
  804. /* MENU BAR */
  805. /************************************************************************/
  806. // MenuBar background
  807. GUIElementStyle menuBarBgStyle;
  808. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  809. menuBarBgStyle.fixedHeight = false;
  810. menuBarBgStyle.fixedWidth = false;
  811. menuBarBgStyle.height = 4;
  812. menuBarBgStyle.width = 4;
  813. skin->setStyle("MenuBarBg", menuBarBgStyle);
  814. // MenuBar Banshee logo
  815. GUIElementStyle menuBarBansheeLogoStyle;
  816. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  817. menuBarBansheeLogoStyle.fixedHeight = true;
  818. menuBarBansheeLogoStyle.fixedWidth = true;
  819. menuBarBansheeLogoStyle.height = 7;
  820. menuBarBansheeLogoStyle.width = 51;
  821. skin->setStyle("MenuBarBansheeLogo", menuBarBansheeLogoStyle);
  822. // MenuBar button
  823. GUIElementStyle menuBarBtnStyle;
  824. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  825. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  826. menuBarBtnStyle.active.texture = menuBarBtnStyle.hover.texture;
  827. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.hover.texture;
  828. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.hover.texture;
  829. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.hover.texture;
  830. menuBarBtnStyle.normal.textColor = TextNormalColor;
  831. menuBarBtnStyle.hover.textColor = TextNormalColor;
  832. menuBarBtnStyle.active.textColor = TextActiveColor;
  833. menuBarBtnStyle.normalOn.textColor = TextActiveColor;
  834. menuBarBtnStyle.hoverOn.textColor = TextActiveColor;
  835. menuBarBtnStyle.activeOn.textColor = TextActiveColor;
  836. menuBarBtnStyle.fixedHeight = true;
  837. menuBarBtnStyle.fixedWidth = false;
  838. menuBarBtnStyle.height = 15;
  839. menuBarBtnStyle.width = 4;
  840. menuBarBtnStyle.margins.left = 2;
  841. menuBarBtnStyle.margins.right = 2;
  842. menuBarBtnStyle.margins.top = 2;
  843. menuBarBtnStyle.margins.bottom = 2;
  844. menuBarBtnStyle.font = font;
  845. menuBarBtnStyle.fontSize = DefaultFontSize;
  846. menuBarBtnStyle.textHorzAlign = THA_Left;
  847. menuBarBtnStyle.textVertAlign = TVA_Top;
  848. skin->setStyle("MenuBarBtn", menuBarBtnStyle);
  849. /************************************************************************/
  850. /* DOCK SLIDER */
  851. /************************************************************************/
  852. GUIElementStyle dockSliderBtnStyle;
  853. dockSliderBtnStyle.normal.texture = getGUITexture(DockSliderNormalTex);
  854. dockSliderBtnStyle.fixedHeight = false;
  855. dockSliderBtnStyle.fixedWidth = false;
  856. dockSliderBtnStyle.height = 2;
  857. dockSliderBtnStyle.width = 2;
  858. skin->setStyle("DockSliderBtn", dockSliderBtnStyle);
  859. /************************************************************************/
  860. /* TREE VIEW */
  861. /************************************************************************/
  862. // Expand button
  863. GUIElementStyle treeViewExpandButtonStyle;
  864. treeViewExpandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  865. treeViewExpandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  866. treeViewExpandButtonStyle.active.texture = treeViewExpandButtonStyle.hover.texture;
  867. treeViewExpandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  868. treeViewExpandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  869. treeViewExpandButtonStyle.activeOn.texture = treeViewExpandButtonStyle.hoverOn.texture;
  870. treeViewExpandButtonStyle.margins.left = 4;
  871. treeViewExpandButtonStyle.margins.right = 4;
  872. treeViewExpandButtonStyle.margins.top = 5;
  873. treeViewExpandButtonStyle.margins.bottom = 4;
  874. treeViewExpandButtonStyle.fixedHeight = true;
  875. treeViewExpandButtonStyle.fixedWidth = true;
  876. treeViewExpandButtonStyle.height = 16;
  877. treeViewExpandButtonStyle.width = 16;
  878. skin->setStyle("TreeViewFoldoutBtn", treeViewExpandButtonStyle);
  879. // Entry
  880. GUIElementStyle treeViewEntryStyle;
  881. treeViewEntryStyle.font = font;
  882. treeViewEntryStyle.fontSize = DefaultFontSize;
  883. treeViewEntryStyle.fixedWidth = false;
  884. treeViewEntryStyle.fixedHeight = true;
  885. treeViewEntryStyle.height = 16;
  886. treeViewEntryStyle.minWidth = 10;
  887. treeViewEntryStyle.normal.textColor = TextNormalColor;
  888. skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
  889. // Selection background
  890. GUIElementStyle treeViewSelBackgroundStyle;
  891. treeViewSelBackgroundStyle.normal.texture = getGUITexture(SelectionBgTex);
  892. treeViewSelBackgroundStyle.fixedHeight = false;
  893. treeViewSelBackgroundStyle.fixedWidth = false;
  894. treeViewSelBackgroundStyle.height = 2;
  895. treeViewSelBackgroundStyle.width = 2;
  896. skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  897. // Highlight background
  898. GUIElementStyle treeViewHLBackgroundStyle;
  899. treeViewHLBackgroundStyle.normal.texture = getGUITexture(TreeViewHighlightBackground);
  900. treeViewHLBackgroundStyle.fixedHeight = false;
  901. treeViewHLBackgroundStyle.fixedWidth = false;
  902. treeViewHLBackgroundStyle.height = 2;
  903. treeViewHLBackgroundStyle.width = 2;
  904. skin->setStyle("TreeViewHighlightBackground", treeViewHLBackgroundStyle);
  905. // Edit box
  906. GUIElementStyle treeViewEditBox;
  907. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  908. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  909. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  910. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  911. treeViewEditBox.normal.textColor = TextNormalColor;
  912. treeViewEditBox.hover.textColor = TextNormalColor;
  913. treeViewEditBox.focused.textColor = TextNormalColor;
  914. treeViewEditBox.active.textColor = TextNormalColor;
  915. treeViewEditBox.border.left = 1;
  916. treeViewEditBox.border.right = 1;
  917. treeViewEditBox.border.top = 1;
  918. treeViewEditBox.border.bottom = 1;
  919. treeViewEditBox.margins.left = 1;
  920. treeViewEditBox.margins.right = 1;
  921. treeViewEditBox.margins.top = 1;
  922. treeViewEditBox.margins.bottom = 1;
  923. treeViewEditBox.fixedHeight = true;
  924. treeViewEditBox.height = 13;
  925. treeViewEditBox.minWidth = 10;
  926. treeViewEditBox.font = font;
  927. treeViewEditBox.fontSize = DefaultFontSize;
  928. treeViewEditBox.textHorzAlign = THA_Left;
  929. treeViewEditBox.textVertAlign = TVA_Top;
  930. skin->setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  931. // Element highlight
  932. GUIElementStyle treeViewElementHighlight;
  933. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  934. treeViewElementHighlight.border.left = 1;
  935. treeViewElementHighlight.border.right = 1;
  936. treeViewElementHighlight.border.top = 1;
  937. treeViewElementHighlight.border.bottom = 1;
  938. skin->setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  939. // Element separator highlight
  940. GUIElementStyle treeViewElementSepHighlight;
  941. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  942. treeViewElementSepHighlight.border.left = 1;
  943. treeViewElementSepHighlight.border.right = 1;
  944. treeViewElementSepHighlight.border.top = 1;
  945. treeViewElementSepHighlight.border.bottom = 1;
  946. skin->setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  947. /************************************************************************/
  948. /* OBJECT DROP FIELD */
  949. /************************************************************************/
  950. GUIElementStyle objectDropStyle;
  951. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  952. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  953. objectDropStyle.normal.textColor = TextNormalColor;
  954. objectDropStyle.hover.textColor = TextNormalColor;
  955. objectDropStyle.active.textColor = TextNormalColor;
  956. objectDropStyle.normalOn.textColor = TextNormalColor;
  957. objectDropStyle.hoverOn.textColor = TextNormalColor;
  958. objectDropStyle.activeOn.textColor = TextNormalColor;
  959. objectDropStyle.border.left = 2;
  960. objectDropStyle.border.top = 2;
  961. objectDropStyle.border.bottom = 4;
  962. objectDropStyle.contentOffset.left = 3;
  963. objectDropStyle.contentOffset.right = 1;
  964. objectDropStyle.margins.bottom = 2;
  965. objectDropStyle.fixedHeight = true;
  966. objectDropStyle.height = 21;
  967. objectDropStyle.minWidth = 20;
  968. objectDropStyle.font = font;
  969. objectDropStyle.fontSize = DefaultFontSize;
  970. objectDropStyle.textHorzAlign = THA_Center;
  971. objectDropStyle.textVertAlign = TVA_Center;
  972. skin->setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  973. GUIElementStyle objectClearBtnStyle;
  974. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  975. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  976. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  977. objectClearBtnStyle.fixedHeight = true;
  978. objectClearBtnStyle.fixedWidth = true;
  979. objectClearBtnStyle.height = 21;
  980. objectClearBtnStyle.width = 16;
  981. objectClearBtnStyle.margins.bottom = 2;
  982. skin->setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  983. GUIElementStyle editorObjectFieldStyle;
  984. editorObjectFieldStyle.fixedHeight = true;
  985. editorObjectFieldStyle.height = 15;
  986. editorObjectFieldStyle.minWidth = 30;
  987. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  988. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  989. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  990. skin->setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  991. /************************************************************************/
  992. /* TEXTURE DROP FIELD */
  993. /************************************************************************/
  994. GUIElementStyle textureFieldStyle;
  995. textureFieldStyle.minHeight = 15;
  996. textureFieldStyle.minWidth = 15;
  997. textureFieldStyle.subStyles[TextureFieldDropStyleName] = TextureFieldDropStyleName;
  998. textureFieldStyle.subStyles[TextureFieldClearBtnStyleName] = TextureFieldClearBtnStyleName;
  999. textureFieldStyle.subStyles[TextureFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1000. skin->setStyle(TextureFieldStyleName, textureFieldStyle);
  1001. GUIElementStyle textureDropStyle;
  1002. textureDropStyle.font = font;
  1003. textureDropStyle.fontSize = DefaultFontSize;
  1004. textureDropStyle.textHorzAlign = THA_Center;
  1005. textureDropStyle.textVertAlign = TVA_Center;
  1006. textureDropStyle.normal.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1007. textureDropStyle.normal.texture = getGUITexture(TextureDropTex);
  1008. textureDropStyle.hover.textColor = textureDropStyle.normal.textColor;
  1009. textureDropStyle.hover.texture = textureDropStyle.normal.texture;
  1010. textureDropStyle.active.textColor = textureDropStyle.normal.textColor;
  1011. textureDropStyle.active.texture = textureDropStyle.normal.texture;
  1012. textureDropStyle.normalOn.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1013. textureDropStyle.normalOn.texture = getGUITexture(TextureDropOnTex);
  1014. textureDropStyle.hoverOn.textColor = textureDropStyle.normalOn.textColor;
  1015. textureDropStyle.hoverOn.texture = textureDropStyle.normalOn.texture;
  1016. textureDropStyle.activeOn.textColor = textureDropStyle.normalOn.textColor;
  1017. textureDropStyle.activeOn.texture = textureDropStyle.normalOn.texture;
  1018. textureDropStyle.height = 82;
  1019. textureDropStyle.width = 82;
  1020. textureDropStyle.fixedHeight = true;
  1021. textureDropStyle.fixedWidth = true;
  1022. textureDropStyle.border.left = 2;
  1023. textureDropStyle.border.right = 2;
  1024. textureDropStyle.border.top = 2;
  1025. textureDropStyle.border.bottom = 2;
  1026. skin->setStyle(TextureFieldDropStyleName, textureDropStyle);
  1027. GUIElementStyle textureDropClearStyle;
  1028. textureDropClearStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1029. textureDropClearStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1030. textureDropClearStyle.active.texture = textureDropStyle.hover.texture;
  1031. textureDropClearStyle.fixedWidth = true;
  1032. textureDropClearStyle.fixedHeight = true;
  1033. textureDropClearStyle.height = 11;
  1034. textureDropClearStyle.width = 11;
  1035. skin->setStyle(TextureFieldClearBtnStyleName, textureDropClearStyle);
  1036. /************************************************************************/
  1037. /* EDITOR FIELDS */
  1038. /************************************************************************/
  1039. GUIElementStyle editorFieldLabelStyle;
  1040. editorFieldLabelStyle.font = font;
  1041. editorFieldLabelStyle.fontSize = DefaultFontSize;
  1042. editorFieldLabelStyle.fixedWidth = false;
  1043. editorFieldLabelStyle.fixedHeight = true;
  1044. editorFieldLabelStyle.height = 11;
  1045. editorFieldLabelStyle.minWidth = 10;
  1046. editorFieldLabelStyle.textHorzAlign = THA_Left;
  1047. skin->setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  1048. GUIElementStyle editorIntFieldStyle;
  1049. editorIntFieldStyle.fixedHeight = true;
  1050. editorIntFieldStyle.height = 21;
  1051. editorIntFieldStyle.minWidth = 30;
  1052. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1053. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1054. skin->setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  1055. GUIElementStyle editorFloatFieldStyle;
  1056. editorFloatFieldStyle.fixedHeight = true;
  1057. editorFloatFieldStyle.height = 21;
  1058. editorFloatFieldStyle.minWidth = 30;
  1059. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1060. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1061. skin->setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  1062. GUIElementStyle editorTextFieldStyle;
  1063. editorTextFieldStyle.fixedHeight = true;
  1064. editorTextFieldStyle.height = 21;
  1065. editorTextFieldStyle.minWidth = 30;
  1066. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1067. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1068. skin->setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  1069. GUIElementStyle editorColorFieldStyle;
  1070. editorColorFieldStyle.fixedHeight = true;
  1071. editorColorFieldStyle.height = 15;
  1072. editorColorFieldStyle.minWidth = 30;
  1073. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1074. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  1075. skin->setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  1076. GUIElementStyle editorToggleFieldStyle;
  1077. editorToggleFieldStyle.fixedHeight = true;
  1078. editorToggleFieldStyle.height = 15;
  1079. editorToggleFieldStyle.minWidth = 30;
  1080. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1081. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  1082. skin->setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  1083. GUIElementStyle editorVector2FieldStyle;
  1084. editorVector2FieldStyle.fixedHeight = true;
  1085. editorVector2FieldStyle.height = 30;
  1086. editorVector2FieldStyle.minWidth = 30;
  1087. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1088. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1089. skin->setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  1090. GUIElementStyle editorVector3FieldStyle;
  1091. editorVector3FieldStyle.fixedHeight = true;
  1092. editorVector3FieldStyle.height = 30;
  1093. editorVector3FieldStyle.minWidth = 30;
  1094. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1095. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1096. skin->setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  1097. GUIElementStyle editorVector4FieldStyle;
  1098. editorVector4FieldStyle.fixedHeight = true;
  1099. editorVector4FieldStyle.height = 30;
  1100. editorVector4FieldStyle.minWidth = 30;
  1101. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1102. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1103. skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  1104. /************************************************************************/
  1105. /* COMPONENT FOLDOUT */
  1106. /************************************************************************/
  1107. GUIElementStyle cmpFoldoutBtnStyle;
  1108. cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
  1109. cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
  1110. cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1111. cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
  1112. cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
  1113. cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1114. cmpFoldoutBtnStyle.normal.textColor = TextNormalColor;
  1115. cmpFoldoutBtnStyle.hover.textColor = TextNormalColor;
  1116. cmpFoldoutBtnStyle.active.textColor = TextNormalColor;
  1117. cmpFoldoutBtnStyle.normalOn.textColor = TextNormalColor;
  1118. cmpFoldoutBtnStyle.hoverOn.textColor = TextNormalColor;
  1119. cmpFoldoutBtnStyle.activeOn.textColor = TextNormalColor;
  1120. cmpFoldoutBtnStyle.fixedHeight = true;
  1121. cmpFoldoutBtnStyle.fixedWidth = false;
  1122. cmpFoldoutBtnStyle.height = 10;
  1123. cmpFoldoutBtnStyle.minWidth = 10;
  1124. cmpFoldoutBtnStyle.font = font;
  1125. cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
  1126. cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
  1127. cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
  1128. cmpFoldoutBtnStyle.contentOffset = RectOffset(12, 0, 0, 0);
  1129. cmpFoldoutBtnStyle.border.left = 8;
  1130. skin->setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
  1131. GUIElementStyle cmpFoldoutRemoveBtnStyle;
  1132. cmpFoldoutRemoveBtnStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1133. cmpFoldoutRemoveBtnStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1134. cmpFoldoutRemoveBtnStyle.active.texture = cmpFoldoutRemoveBtnStyle.hover.texture;
  1135. cmpFoldoutRemoveBtnStyle.fixedHeight = true;
  1136. cmpFoldoutRemoveBtnStyle.fixedWidth = true;
  1137. cmpFoldoutRemoveBtnStyle.height = 11;
  1138. cmpFoldoutRemoveBtnStyle.width = 11;
  1139. skin->setStyle(GUIComponentFoldout::getFoldoutRemoveButtonStyleType(), cmpFoldoutRemoveBtnStyle);
  1140. GUIElementStyle cmpFoldoutStyle;
  1141. cmpFoldoutStyle.fixedHeight = true;
  1142. cmpFoldoutStyle.height = 12;
  1143. cmpFoldoutStyle.minWidth = 30;
  1144. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
  1145. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutRemoveButtonStyleType()] = GUIComponentFoldout::getFoldoutRemoveButtonStyleType();
  1146. skin->setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
  1147. /************************************************************************/
  1148. /* FOLDOUT */
  1149. /************************************************************************/
  1150. GUIElementStyle foldoutBtnStyle;
  1151. foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  1152. foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  1153. foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
  1154. foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  1155. foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  1156. foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
  1157. foldoutBtnStyle.fixedHeight = true;
  1158. foldoutBtnStyle.fixedWidth = true;
  1159. foldoutBtnStyle.height = 10;
  1160. foldoutBtnStyle.width = 8;
  1161. skin->setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
  1162. GUIElementStyle foldoutStyle;
  1163. foldoutStyle.fixedHeight = true;
  1164. foldoutStyle.height = 12;
  1165. foldoutStyle.minWidth = 30;
  1166. foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
  1167. foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
  1168. skin->setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
  1169. /************************************************************************/
  1170. /* PROGRESS BAR */
  1171. /************************************************************************/
  1172. GUIElementStyle progressBarBgStyle;
  1173. progressBarBgStyle.fixedHeight = true;
  1174. progressBarBgStyle.height = 18;
  1175. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  1176. skin->setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  1177. GUIElementStyle progressBarFillStyle;
  1178. progressBarFillStyle.fixedHeight = true;
  1179. progressBarFillStyle.height = 12;
  1180. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  1181. skin->setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  1182. GUIElementStyle progressBarStyle;
  1183. progressBarStyle.fixedHeight = true;
  1184. progressBarStyle.height = 18;
  1185. progressBarStyle.minWidth = 100;
  1186. progressBarStyle.margins.top = 3;
  1187. progressBarStyle.margins.bottom = 3;
  1188. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  1189. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  1190. skin->setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  1191. /************************************************************************/
  1192. /* COLOR PICKER SLIDER */
  1193. /************************************************************************/
  1194. GUIElementStyle colorPickerSliderHorzHandleStyle;
  1195. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1196. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  1197. colorPickerSliderHorzHandleStyle.height = 20;
  1198. colorPickerSliderHorzHandleStyle.width = 7;
  1199. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  1200. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1201. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1202. skin->setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  1203. GUIElementStyle colorPickerSliderHorzStyle;
  1204. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1205. colorPickerSliderHorzHandleStyle.height = 32;
  1206. colorPickerSliderHorzHandleStyle.minWidth = 20;
  1207. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  1208. skin->setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  1209. GUIElementStyle colorPickerSliderVertHandleStyle;
  1210. colorPickerSliderVertHandleStyle.fixedHeight = true;
  1211. colorPickerSliderVertHandleStyle.fixedWidth = true;
  1212. colorPickerSliderVertHandleStyle.height = 7;
  1213. colorPickerSliderVertHandleStyle.width = 45;
  1214. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  1215. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1216. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1217. skin->setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  1218. GUIElementStyle colorPickerSliderVertStyle;
  1219. colorPickerSliderVertStyle.fixedWidth = true;
  1220. colorPickerSliderVertStyle.width = 30;
  1221. colorPickerSliderVertStyle.minHeight = 20;
  1222. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  1223. skin->setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  1224. GUIElementStyle colorPickerSlider2DHandleStyle;
  1225. colorPickerSlider2DHandleStyle.fixedHeight = true;
  1226. colorPickerSlider2DHandleStyle.fixedWidth = true;
  1227. colorPickerSlider2DHandleStyle.height = 8;
  1228. colorPickerSlider2DHandleStyle.width = 8;
  1229. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  1230. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1231. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1232. skin->setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  1233. /************************************************************************/
  1234. /* STATUS BAR */
  1235. /************************************************************************/
  1236. GUIElementStyle statusBarBgStyle;
  1237. statusBarBgStyle.height = 16;
  1238. statusBarBgStyle.border.top = 2;
  1239. statusBarBgStyle.normal.texture = getGUITexture(StatusBarBgTex);
  1240. skin->setStyle(GUIStatusBar::getGUIBackgroundTypeName(), statusBarBgStyle);
  1241. GUIElementStyle statusBarMessageBtnStyle;
  1242. statusBarMessageBtnStyle.font = font;
  1243. statusBarMessageBtnStyle.fontSize = DefaultFontSize;
  1244. statusBarMessageBtnStyle.fixedHeight = true;
  1245. statusBarMessageBtnStyle.height = 16;
  1246. statusBarMessageBtnStyle.minWidth = 10;
  1247. statusBarMessageBtnStyle.textHorzAlign = THA_Left;
  1248. statusBarMessageBtnStyle.textVertAlign = TVA_Center;
  1249. statusBarMessageBtnStyle.imagePosition = GUIImagePosition::Left;
  1250. skin->setStyle(GUIStatusBar::getGUIMessageTypeName(), statusBarMessageBtnStyle);
  1251. GUIElementStyle statusBarStyle;
  1252. statusBarStyle.height = 16;
  1253. statusBarStyle.subStyles[GUIStatusBar::getGUIBackgroundTypeName()] = GUIStatusBar::getGUIBackgroundTypeName();
  1254. statusBarStyle.subStyles[GUIStatusBar::getGUIMessageTypeName()] = GUIStatusBar::getGUIMessageTypeName();
  1255. skin->setStyle(GUIStatusBar::getGUITypeName(), statusBarStyle);
  1256. /************************************************************************/
  1257. /* OTHER */
  1258. /************************************************************************/
  1259. // Right-aligned label
  1260. GUIElementStyle rightAlignedLabelStyle;
  1261. rightAlignedLabelStyle.font = font;
  1262. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  1263. rightAlignedLabelStyle.fixedWidth = false;
  1264. rightAlignedLabelStyle.fixedHeight = true;
  1265. rightAlignedLabelStyle.height = 11;
  1266. rightAlignedLabelStyle.minWidth = 10;
  1267. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  1268. rightAlignedLabelStyle.normal.textColor = TextNormalColor;
  1269. skin->setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  1270. // Multi-line label
  1271. GUIElementStyle multiLinelabelStyle;
  1272. multiLinelabelStyle.font = font;
  1273. multiLinelabelStyle.fontSize = DefaultFontSize;
  1274. multiLinelabelStyle.fixedWidth = false;
  1275. multiLinelabelStyle.fixedHeight = true;
  1276. multiLinelabelStyle.height = 11;
  1277. multiLinelabelStyle.minWidth = 10;
  1278. multiLinelabelStyle.wordWrap = true;
  1279. multiLinelabelStyle.normal.textColor = TextNormalColor;
  1280. skin->setStyle("MultiLineLabel", multiLinelabelStyle);
  1281. // Multi-line centered label
  1282. GUIElementStyle multiLineCenteredLabelStyle;
  1283. multiLineCenteredLabelStyle.font = font;
  1284. multiLineCenteredLabelStyle.fontSize = DefaultFontSize;
  1285. multiLineCenteredLabelStyle.fixedWidth = false;
  1286. multiLineCenteredLabelStyle.fixedHeight = true;
  1287. multiLineCenteredLabelStyle.height = 11;
  1288. multiLineCenteredLabelStyle.minWidth = 10;
  1289. multiLineCenteredLabelStyle.wordWrap = true;
  1290. multiLineCenteredLabelStyle.textHorzAlign = THA_Center;
  1291. multiLineCenteredLabelStyle.normal.textColor = TextNormalColor;
  1292. skin->setStyle("MultiLineLabelCentered", multiLineCenteredLabelStyle);
  1293. // Selection area
  1294. GUIElementStyle selectionAreaStyle;
  1295. selectionAreaStyle.normal.texture = getGUITexture(SelectionAreaTex);
  1296. selectionAreaStyle.border.left = 1;
  1297. selectionAreaStyle.border.right = 1;
  1298. selectionAreaStyle.border.top = 1;
  1299. selectionAreaStyle.border.bottom = 1;
  1300. skin->setStyle("SelectionArea", selectionAreaStyle);
  1301. // Selectable label
  1302. GUIElementStyle selectableLabelStyle;
  1303. selectableLabelStyle.normalOn.texture = getGUITexture(SelectionBgTex);
  1304. selectableLabelStyle.hoverOn.texture = selectableLabelStyle.normalOn.texture;
  1305. selectableLabelStyle.activeOn.texture = selectableLabelStyle.normalOn.texture;
  1306. selectableLabelStyle.fixedHeight = true;
  1307. selectableLabelStyle.height = 11;
  1308. selectableLabelStyle.minWidth = 10;
  1309. selectableLabelStyle.font = font;
  1310. selectableLabelStyle.fontSize = DefaultFontSize;
  1311. selectableLabelStyle.textHorzAlign = THA_Left;
  1312. selectableLabelStyle.normal.textColor = TextNormalColor;
  1313. skin->setStyle("SelectableLabel", selectableLabelStyle);
  1314. // Scroll area background
  1315. GUIElementStyle scrollAreaBg;
  1316. scrollAreaBg.normal.texture = getGUITexture(ScrollAreaBgTex);
  1317. scrollAreaBg.minHeight = 6;
  1318. scrollAreaBg.minWidth = 4;
  1319. scrollAreaBg.border.left = 2;
  1320. scrollAreaBg.border.right = 2;
  1321. scrollAreaBg.border.top = 2;
  1322. scrollAreaBg.border.bottom = 4;
  1323. skin->setStyle("ScrollAreaBg", scrollAreaBg);
  1324. return skin;
  1325. }
  1326. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name)
  1327. {
  1328. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1329. texturePath.append(EditorSkinFolder);
  1330. texturePath.append(L"sprite_" + name + L".asset");
  1331. return Resources::instance().load<SpriteTexture>(texturePath);
  1332. }
  1333. HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name)
  1334. {
  1335. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1336. texturePath.append(EditorIconFolder);
  1337. texturePath.append(L"sprite_" + name + L".asset");
  1338. return Resources::instance().load<SpriteTexture>(texturePath);
  1339. }
  1340. HShader BuiltinEditorResources::getShader(const WString& name)
  1341. {
  1342. Path programPath = EditorShaderFolder;
  1343. programPath.append(name + L".asset");
  1344. return gResources().load<Shader>(programPath);
  1345. }
  1346. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1347. {
  1348. return Material::create(mShaderDockOverlay);
  1349. }
  1350. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1351. {
  1352. return Material::create(mShaderSceneGrid);
  1353. }
  1354. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1355. {
  1356. UINT32 modeIdx = (UINT32)cullMode;
  1357. return Material::create(mShaderPicking[modeIdx]);
  1358. }
  1359. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1360. {
  1361. UINT32 modeIdx = (UINT32)cullMode;
  1362. return Material::create(mShaderPickingAlpha[modeIdx]);
  1363. }
  1364. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1365. {
  1366. return Material::create(mShaderGizmoWire);
  1367. }
  1368. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1369. {
  1370. return Material::create(mShaderGizmoSolid);
  1371. }
  1372. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1373. {
  1374. return Material::create(mShaderGizmoIcon);
  1375. }
  1376. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1377. {
  1378. return Material::create(mShaderGizmoPicking);
  1379. }
  1380. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1381. {
  1382. return Material::create(mShaderGizmoAlphaPicking);
  1383. }
  1384. HMaterial BuiltinEditorResources::createWireHandleMat() const
  1385. {
  1386. return Material::create(mShaderHandleWire);
  1387. }
  1388. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1389. {
  1390. return Material::create(mShaderHandleSolid);
  1391. }
  1392. HMaterial BuiltinEditorResources::createSelectionMat() const
  1393. {
  1394. return Material::create(mShaderSelection);
  1395. }
  1396. HSpriteTexture BuiltinEditorResources::getLibraryIcon(ProjectIcon icon) const
  1397. {
  1398. switch (icon)
  1399. {
  1400. case ProjectIcon::Folder:
  1401. return getGUIIcon(FolderIconTex);
  1402. case ProjectIcon::Font:
  1403. return getGUIIcon(FontIconTex);
  1404. case ProjectIcon::Mesh:
  1405. return getGUIIcon(MeshIconTex);
  1406. case ProjectIcon::Texture:
  1407. return getGUIIcon(TextureIconTex);
  1408. case ProjectIcon::PlainText:
  1409. return getGUIIcon(PlainTextIconTex);
  1410. case ProjectIcon::ScriptCode:
  1411. return getGUIIcon(ScriptCodeIconTex);
  1412. case ProjectIcon::Shader:
  1413. return getGUIIcon(ShaderIconTex);
  1414. case ProjectIcon::ShaderInclude:
  1415. return getGUIIcon(ShaderIncludeIconTex);
  1416. case ProjectIcon::Material:
  1417. return getGUIIcon(MaterialIconTex);
  1418. case ProjectIcon::SpriteTexture:
  1419. return getGUIIcon(SpriteTextureIconTex);
  1420. case ProjectIcon::Prefab:
  1421. return getGUIIcon(PrefabIconTex);
  1422. }
  1423. return HSpriteTexture();
  1424. }
  1425. HSpriteTexture BuiltinEditorResources::getLogMessageIcon(LogMessageIcon icon) const
  1426. {
  1427. switch (icon)
  1428. {
  1429. case LogMessageIcon::Info:
  1430. return getGUIIcon(LogInfoIconTex);
  1431. case LogMessageIcon::Warning:
  1432. return getGUIIcon(LogWarningIconTex);
  1433. case LogMessageIcon::Error:
  1434. return getGUIIcon(LogErrorIconTex);
  1435. }
  1436. return HSpriteTexture();
  1437. }
  1438. }