BsBuiltinEditorResources.cpp 78 KB

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