BsBuiltinEditorResources.cpp 80 KB

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