BsBuiltinEditorResources.cpp 90 KB

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