BsBuiltinEditorResources.cpp 81 KB

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