BsBuiltinEditorResources.cpp 78 KB

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