BsBuiltinEditorResources.cpp 77 KB

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