BsBuiltinEditorResources.cpp 109 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "Utility/BsBuiltinEditorResources.h"
  4. #include "Resources/BsBuiltinResources.h"
  5. #include "GUI/BsGUIElementStyle.h"
  6. #include "GUI/BsGUILabel.h"
  7. #include "GUI/BsGUITexture.h"
  8. #include "GUI/BsGUIButton.h"
  9. #include "GUI/BsGUIInputBox.h"
  10. #include "GUI/BsGUIToggle.h"
  11. #include "GUI/BsGUIColor.h"
  12. #include "2D/BsTextSprite.h"
  13. #include "2D/BsSpriteTexture.h"
  14. #include "GUI/BsGUITreeViewEditBox.h"
  15. #include "GUI/BsGUIIntField.h"
  16. #include "GUI/BsGUIFloatField.h"
  17. #include "GUI/BsGUIColorField.h"
  18. #include "GUI/BsGUITextField.h"
  19. #include "GUI/BsGUIToggleField.h"
  20. #include "GUI/BsGUIVector2Field.h"
  21. #include "GUI/BsGUIVector3Field.h"
  22. #include "GUI/BsGUIVector4Field.h"
  23. #include "GUI/BsGUIListBoxField.h"
  24. #include "GUI/BsGUISliderField.h"
  25. #include "GUI/BsGUIProgressBar.h"
  26. #include "GUI/BsGUISlider.h"
  27. #include "GUI/BsGUIDropDownContent.h"
  28. #include "GUI/BsGUIStatusBar.h"
  29. #include "GUI/BsGUIMenuBar.h"
  30. #include "GUI/BsGUIListBox.h"
  31. #include "GUI/BsGUIScrollBar.h"
  32. #include "CoreThread/BsCoreThread.h"
  33. #include "Text/BsFont.h"
  34. #include "Image/BsTexture.h"
  35. #include "Material/BsShader.h"
  36. #include "Material/BsMaterial.h"
  37. #include "Resources/BsResources.h"
  38. #include "FileSystem/BsFileSystem.h"
  39. #include "Resources/BsResourceManifest.h"
  40. #include "FileSystem/BsDataStream.h"
  41. #include "GUI/BsGUITooltip.h"
  42. #include "Resources/BsBuiltinResourcesHelper.h"
  43. using json = nlohmann::json;
  44. namespace bs
  45. {
  46. static const Path EDITOR_DATA_FOLDER = "Editor\\";
  47. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  48. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  49. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  50. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  51. const String BuiltinEditorResources::TextureFieldStyleName = "GUITextureField";
  52. const String BuiltinEditorResources::TextureFieldLabelStyleName = "TextureFieldLabel";
  53. const String BuiltinEditorResources::TextureFieldDropStyleName = "TextureDrop";
  54. const String BuiltinEditorResources::TextureFieldClearBtnStyleName = "TextureClearButton";
  55. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  56. const WString BuiltinEditorResources::DefaultAAFontFilename = L"arialAA.ttf";
  57. const UINT32 BuiltinEditorResources::DefaultFontSize = 8;
  58. const UINT32 BuiltinEditorResources::TitleFontSize = 16;
  59. const Color BuiltinEditorResources::TextNormalColor = Color(0.7f, 0.7f, 0.7f);
  60. const Color BuiltinEditorResources::TextActiveColor = Color(0.0f, 0.0f, 0.0f);
  61. const WString BuiltinEditorResources::GUISkinFile = L"GUISkin";
  62. const char* BuiltinEditorResources::DataListFile = "DataList.json";
  63. const char* BuiltinEditorResources::ShaderFolder = "Shaders\\";
  64. const char* BuiltinEditorResources::SkinFolder = "Skin\\";
  65. const char* BuiltinEditorResources::IconFolder = "Icons\\";
  66. const char* BuiltinEditorResources::ShaderIncludeFolder = "Includes\\";
  67. const char* BuiltinEditorResources::SpriteSubFolder = "Sprites\\";
  68. const WString BuiltinEditorResources::FolderIconTex = L"FolderIcon.psd";
  69. const WString BuiltinEditorResources::MeshIconTex = L"MeshIcon.psd";
  70. const WString BuiltinEditorResources::TextureIconTex = L"TextureIcon.psd";
  71. const WString BuiltinEditorResources::FontIconTex = L"FontIcon.psd";
  72. const WString BuiltinEditorResources::PlainTextIconTex = L"TextIcon.psd";
  73. const WString BuiltinEditorResources::ScriptCodeIconTex = L"CSharpIcon.psd";
  74. const WString BuiltinEditorResources::ShaderIconTex = L"ShaderIcon.psd";
  75. const WString BuiltinEditorResources::ShaderIncludeIconTex = L"ShaderIncludeIcon.psd";
  76. const WString BuiltinEditorResources::MaterialIconTex = L"MaterialIcon.psd";
  77. const WString BuiltinEditorResources::SpriteTextureIconTex = L"SpriteIcon.psd";
  78. const WString BuiltinEditorResources::PrefabIconTex = L"PrefabIcon.psd";
  79. const WString BuiltinEditorResources::GUISkinIconTex = L"GUISkinIcon.psd";
  80. const WString BuiltinEditorResources::PhysicsMaterialIconTex = L"PhysicsMaterialIcon.psd";
  81. const WString BuiltinEditorResources::PhysicsMeshIconTex = L"PhysicsMeshIcon.psd";
  82. const WString BuiltinEditorResources::AudioClipIconTex = L"AudioClipIcon.psd";
  83. const WString BuiltinEditorResources::AnimationClipIconTex = L"AnimationClipIcon.psd";
  84. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.png";
  85. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.png";
  86. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.png";
  87. const WString BuiltinEditorResources::ButtonLeftNormalTex = L"ButtonLeftNormal.png";
  88. const WString BuiltinEditorResources::ButtonLeftHoverTex = L"ButtonLeftHover.png";
  89. const WString BuiltinEditorResources::ButtonLeftActiveTex = L"ButtonLeftActive.png";
  90. const WString BuiltinEditorResources::ButtonRightNormalTex = L"ButtonRightNormal.png";
  91. const WString BuiltinEditorResources::ButtonRightHoverTex = L"ButtonRightHover.png";
  92. const WString BuiltinEditorResources::ButtonRightActiveTex = L"ButtonRightActive.png";
  93. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.png";
  94. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.png";
  95. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleNormalOn.png";
  96. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleHoverOn.png";
  97. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.png";
  98. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.png";
  99. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxActive.png";
  100. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectDropNormal.png";
  101. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectDropNormalOn.png";
  102. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectDropClearNormal.png";
  103. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectDropClearHover.png";
  104. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectDropClearActive.png";
  105. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownButtonNormal.png";
  106. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownButtonHover.png";
  107. const WString BuiltinEditorResources::DropDownBtnActiveTex = L"DropDownButtonActive.png";
  108. const WString BuiltinEditorResources::SliderHBackgroundTex = L"SliderHBackground.png";
  109. const WString BuiltinEditorResources::SliderHFillTex = L"SliderHFill.png";
  110. const WString BuiltinEditorResources::SliderVBackgroundTex = L"SliderVBackground.png";
  111. const WString BuiltinEditorResources::SliderVFillTex = L"SliderVFill.png";
  112. const WString BuiltinEditorResources::SliderHandleNormalTex = L"SliderHandleNormal.png";
  113. const WString BuiltinEditorResources::SliderHandleHoverTex = L"SliderHandleHover.png";
  114. const WString BuiltinEditorResources::SliderHandleActiveTex = L"SliderHandleActive.png";
  115. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutNormalOn.png";
  116. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutHoverOn.png";
  117. const WString BuiltinEditorResources::FoldoutOpenActiveTex = L"FoldoutHoverOn.png";
  118. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutNormalOff.png";
  119. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutHoverOff.png";
  120. const WString BuiltinEditorResources::FoldoutClosedActiveTex = L"FoldoutHoverOff.png";
  121. const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
  122. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.png";
  123. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.png";
  124. const WString BuiltinEditorResources::CloseButtonNormalTex = L"CloseButtonNormal.png";
  125. const WString BuiltinEditorResources::CloseButtonHoverTex = L"CloseButtonHover.png";
  126. const WString BuiltinEditorResources::CloseButtonActiveTex = L"CloseButtonActive.png";
  127. const WString BuiltinEditorResources::MinButtonNormalTex = L"MinimizeButtonNormal.png";
  128. const WString BuiltinEditorResources::MinButtonHoverTex = L"MinimizeButtonHover.png";
  129. const WString BuiltinEditorResources::MinButtonActiveTex = L"MinimizeButtonActive.png";
  130. const WString BuiltinEditorResources::MaxButtonNormalTex = L"MaximizeButtonNormal.png";
  131. const WString BuiltinEditorResources::MaxButtonHoverTex = L"MaximizeButtonHover.png";
  132. const WString BuiltinEditorResources::MaxButtonActiveTex = L"MaximizeButtonActive.png";
  133. const WString BuiltinEditorResources::TabBarBackgroundTex = L"TabBarBackground.png";
  134. const WString BuiltinEditorResources::TitleBarBackgroundTex = L"TitleBarBackground.png";
  135. const WString BuiltinEditorResources::TabButtonNormalTex = L"TabButtonNormal.png";
  136. const WString BuiltinEditorResources::TabButtonFocusedTex = L"TabButtonFocused.png";
  137. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollArrowUpNormal.png";
  138. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollArrowUpHover.png";
  139. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollArrowUpActive.png";
  140. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollArrowDownNormal.png";
  141. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollArrowDownHover.png";
  142. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollArrowDownActive.png";
  143. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollArrowLeftNormal.png";
  144. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollArrowLeftHover.png";
  145. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollArrowLeftActive.png";
  146. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollArrowRightNormal.png";
  147. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollArrowRightHover.png";
  148. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollArrowRightActive.png";
  149. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHHandleNormal.png";
  150. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHHandleHover.png";
  151. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHHandleActive.png";
  152. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVHandleNormal.png";
  153. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVHandleHover.png";
  154. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVHandleActive.png";
  155. const WString BuiltinEditorResources::ScrollBarResizeableHandleHorzNormalTex = L"ScrollBarHHandleResizeableNormal.png";
  156. const WString BuiltinEditorResources::ScrollBarResizeableHandleHorzHoverTex = L"ScrollBarHHandleResizeableHover.png";
  157. const WString BuiltinEditorResources::ScrollBarResizeableHandleHorzActiveTex = L"ScrollBarHHandleResizeableActive.png";
  158. const WString BuiltinEditorResources::ScrollBarResizeableHandleVertNormalTex = L"ScrollBarVHandleResizeableNormal.png";
  159. const WString BuiltinEditorResources::ScrollBarResizeableHandleVertHoverTex = L"ScrollBarVHandleResizeableHover.png";
  160. const WString BuiltinEditorResources::ScrollBarResizeableHandleVertActiveTex = L"ScrollBarVHandleResizeableActive.png";
  161. const WString BuiltinEditorResources::ScrollBarHBgTex = L"ScrollBarHBackground.png";
  162. const WString BuiltinEditorResources::ScrollBarVBgTex = L"ScrollBarVBackground.png";
  163. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.png";
  164. const WString BuiltinEditorResources::DropDownBoxSideBgTex = L"DropDownBoxSideBg.png";
  165. const WString BuiltinEditorResources::DropDownBoxHandleTex = L"DropDownBoxScrollHandle.png";
  166. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownBoxEntryNormal.png";
  167. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownBoxEntryHover.png";
  168. const WString BuiltinEditorResources::DropDownBoxEntryToggleNormalTex = L"DropDownBoxEntryToggleNormal.png";
  169. const WString BuiltinEditorResources::DropDownBoxEntryToggleHoverTex = L"DropDownBoxEntryToggleHover.png";
  170. const WString BuiltinEditorResources::DropDownBoxEntryToggleNormalOnTex = L"DropDownBoxEntryToggleNormalOn.png";
  171. const WString BuiltinEditorResources::DropDownBoxEntryToggleHoverOnTex = L"DropDownBoxEntryToggleHoverOn.png";
  172. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxArrowUpNormal.png";
  173. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxArrowUpHover.png";
  174. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxArrowDownNormal.png";
  175. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxArrowDownHover.png";
  176. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownBoxExpandBtnNormal.png";
  177. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownBoxExpandBtnHover.png";
  178. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownBoxSeparator.png";
  179. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBackground.png";
  180. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarLog.png";
  181. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.png";
  182. const WString BuiltinEditorResources::MenuBarBtnActiveTex = L"MenuBarButtonActive.png";
  183. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.png";
  184. const WString BuiltinEditorResources::MenuBarLineNormalTex = L"MenuBarLineNormal.png";
  185. const WString BuiltinEditorResources::MenuBarLineActiveTex = L"MenuBarLineActive.png";
  186. const WString BuiltinEditorResources::ToolBarBtnNormalTex = L"ToolBarButtonNormal.png";
  187. const WString BuiltinEditorResources::ToolBarBtnHoverTex = L"ToolBarButtonHover.png";
  188. const WString BuiltinEditorResources::ToolBarBtnActiveTex = L"ToolBarButtonActive.png";
  189. const WString BuiltinEditorResources::ToolBarSeparatorTex = L"ToolBarSeparator.png";
  190. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"ExpandArrowNormalOff.png";
  191. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"ExpandArrowHoverOff.png";
  192. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"ExpandArrowNormalOn.png";
  193. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"ExpandArrowHoverOn.png";
  194. const WString BuiltinEditorResources::TreeViewHighlightBackground = L"TreeViewHighlightBackground.psd";
  195. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  196. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  197. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  198. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  199. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  200. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  201. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.png";
  202. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.png";
  203. const WString BuiltinEditorResources::SelectionAreaTex = L"SelectionHighlight.png";
  204. const WString BuiltinEditorResources::SelectionBgTex = L"SelectionBg.psd";
  205. const WString BuiltinEditorResources::TextureDropTex = L"TextureDrop.png";
  206. const WString BuiltinEditorResources::TextureDropOnTex = L"TextureDropHover.png";
  207. const WString BuiltinEditorResources::XButtonNormalTex = L"XBtnNormal.png";
  208. const WString BuiltinEditorResources::XButtonHoverTex = L"XBtnHover.png";
  209. const WString BuiltinEditorResources::XButtonActiveTex = L"XBtnActive.png";
  210. const WString BuiltinEditorResources::StatusBarBgTex = L"StatusBarBackground.png";
  211. const WString BuiltinEditorResources::ScrollAreaBgTex = L"ScrollAreaBg.png";
  212. const WString BuiltinEditorResources::InspectorTitleBgTex = L"InspectorTitleBg.png";
  213. const WString BuiltinEditorResources::InspectorContentBgTex = L"InspectorContentBg.png";
  214. const WString BuiltinEditorResources::InspectorContentBgAlternateTex = L"InspectorContentBgAlternate.png";
  215. const WString BuiltinEditorResources::LibraryEntryFirstBgTex = L"LibraryEntryFirstBg.png";
  216. const WString BuiltinEditorResources::LibraryEntryBgTex = L"LibraryEntryBg.png";
  217. const WString BuiltinEditorResources::LibraryEntryLastBgTex = L"LibraryEntryLastBg.png";
  218. const WString BuiltinEditorResources::LibraryEntryVertFirstBgTex = L"LibraryEntryVertFirstBg.png";
  219. const WString BuiltinEditorResources::LibraryEntryVertBgTex = L"LibraryEntryVertBg.png";
  220. const WString BuiltinEditorResources::LibraryEntryVertLastBgTex = L"LibraryEntryVertLastBg.png";
  221. /************************************************************************/
  222. /* SHADERS */
  223. /************************************************************************/
  224. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  225. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  226. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  227. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  228. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  229. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  230. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  231. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  232. const WString BuiltinEditorResources::ShaderLineGizmoFile = L"LineGizmo.bsl";
  233. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  234. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  235. const WString BuiltinEditorResources::ShaderLineHandleFile = L"LineHandle.bsl";
  236. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  237. const WString BuiltinEditorResources::ShaderHandleClearAlphaFile = L"ClearHandleAlpha.bsl";
  238. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  239. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  240. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  241. const WString BuiltinEditorResources::ShaderTextGizmoFile = L"TextGizmo.bsl";
  242. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  243. /************************************************************************/
  244. /* OTHER */
  245. /************************************************************************/
  246. const WString BuiltinEditorResources::EmptyShaderCodeFile = L"EmptyShaderText.txt";
  247. const WString BuiltinEditorResources::EmptyCSScriptCodeFile = L"EmptyCSScriptText.txt";
  248. BuiltinEditorResources::BuiltinEditorResources()
  249. {
  250. // Set up paths
  251. BuiltinRawDataFolder = Paths::getRuntimeDataPath() + L"Raw\\Editor\\";
  252. EditorRawSkinFolder = BuiltinRawDataFolder + SkinFolder;
  253. EditorRawIconsFolder = BuiltinRawDataFolder + IconFolder;
  254. EditorRawShaderFolder = BuiltinRawDataFolder + ShaderFolder;
  255. EditorRawShaderIncludeFolder = BuiltinRawDataFolder + ShaderIncludeFolder;
  256. BuiltinDataFolder = Paths::getRuntimeDataPath() + EDITOR_DATA_FOLDER;
  257. EditorSkinFolder = BuiltinDataFolder + SkinFolder;
  258. EditorSkinSpritesFolder = EditorSkinFolder + SpriteSubFolder;
  259. EditorIconFolder = BuiltinDataFolder + IconFolder;
  260. EditorIconSpritesFolder = EditorIconFolder + SpriteSubFolder;
  261. EditorShaderFolder = BuiltinDataFolder + ShaderFolder;
  262. EditorShaderIncludeFolder = BuiltinDataFolder + ShaderIncludeFolder;
  263. ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
  264. // Update from raw assets if needed
  265. #if BS_DEBUG_MODE
  266. time_t lastUpdateTime;
  267. UINT32 modifications = BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder,
  268. BuiltinDataFolder + L"Timestamp.asset", lastUpdateTime);
  269. if (modifications > 0)
  270. {
  271. bool forceReimport = modifications == 2;
  272. SPtr<ResourceManifest> oldResourceManifest;
  273. if (!forceReimport && FileSystem::exists(ResourceManifestPath))
  274. {
  275. oldResourceManifest = ResourceManifest::load(ResourceManifestPath, BuiltinDataFolder);
  276. if(oldResourceManifest != nullptr)
  277. gResources().registerResourceManifest(oldResourceManifest);
  278. }
  279. if (oldResourceManifest)
  280. mResourceManifest = oldResourceManifest;
  281. else
  282. {
  283. mResourceManifest = ResourceManifest::create("BuiltinResources");
  284. gResources().registerResourceManifest(mResourceManifest);
  285. }
  286. preprocess(modifications == 2, lastUpdateTime);
  287. BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
  288. ResourceManifest::save(mResourceManifest, ResourceManifestPath, BuiltinDataFolder);
  289. }
  290. #endif
  291. // Load manifest
  292. if (mResourceManifest == nullptr)
  293. {
  294. if (FileSystem::exists(ResourceManifestPath))
  295. mResourceManifest = ResourceManifest::load(ResourceManifestPath, BuiltinDataFolder);
  296. if (mResourceManifest == nullptr)
  297. mResourceManifest = ResourceManifest::create("BuiltinResources");
  298. gResources().registerResourceManifest(mResourceManifest);
  299. }
  300. // Load basic resources
  301. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  302. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  303. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  304. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  305. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  306. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  307. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  308. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  309. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  310. mShaderGizmoLine = getShader(ShaderLineGizmoFile);
  311. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  312. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  313. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  314. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  315. mShaderGizmoText = getShader(ShaderTextGizmoFile);
  316. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  317. mShaderHandleClearAlpha = getShader(ShaderHandleClearAlphaFile);
  318. mShaderHandleLine = getShader(ShaderLineHandleFile);
  319. mShaderSelection = getShader(ShaderSelectionFile);
  320. mDefaultFont = gResources().load<Font>(BuiltinDataFolder + (DefaultFontFilename + L".asset"));
  321. mDefaultAAFont = gResources().load<Font>(BuiltinDataFolder + (DefaultAAFontFilename + L".asset"));
  322. mSkin = gResources().load<GUISkin>(BuiltinDataFolder + (GUISkinFile + L".asset"));
  323. }
  324. BuiltinEditorResources::~BuiltinEditorResources()
  325. { }
  326. void BuiltinEditorResources::preprocess(bool forceImport, time_t lastUpdateTime)
  327. {
  328. Resources::instance().unloadAllUnused();
  329. Path dataListsFilePath = BuiltinRawDataFolder + DataListFile;
  330. SPtr<DataStream> dataListStream = FileSystem::openFile(dataListsFilePath);
  331. json dataListJSON = json::parse(dataListStream->getAsString().c_str());
  332. json skinJSON = dataListJSON["Skin"];
  333. json iconsJSON = dataListJSON["Icons"];
  334. json includesJSON = dataListJSON["Includes"];
  335. json shadersJSON = dataListJSON["Shaders"];
  336. // Update DataList.json if needed
  337. bool updatedDataLists = false;
  338. updatedDataLists |= BuiltinResourcesHelper::updateJSON(EditorRawIconsFolder, BuiltinResourcesHelper::AssetType::Sprite, iconsJSON);
  339. updatedDataLists |= BuiltinResourcesHelper::updateJSON(EditorRawShaderIncludeFolder, BuiltinResourcesHelper::AssetType::Normal, includesJSON);
  340. updatedDataLists |= BuiltinResourcesHelper::updateJSON(EditorRawShaderFolder, BuiltinResourcesHelper::AssetType::Normal, shadersJSON);
  341. updatedDataLists |= BuiltinResourcesHelper::updateJSON(EditorRawSkinFolder, BuiltinResourcesHelper::AssetType::Sprite, skinJSON);
  342. dataListStream->close();
  343. if (updatedDataLists)
  344. {
  345. FileSystem::remove(dataListsFilePath);
  346. dataListJSON["Skin"] = skinJSON;
  347. dataListJSON["Icons"] = iconsJSON;
  348. dataListJSON["Includes"] = includesJSON;
  349. dataListJSON["Shaders"] = shadersJSON;
  350. String jsonString = dataListJSON.dump(4).c_str();
  351. dataListStream = FileSystem::createAndOpenFile(dataListsFilePath);
  352. dataListStream->writeString(jsonString);
  353. dataListStream->close();
  354. }
  355. // If forcing import, clear all data folders since everything will be recreated anyway
  356. Path shaderDependenciesFile = BuiltinDataFolder + "ShaderDependencies.json";
  357. if(forceImport)
  358. {
  359. FileSystem::remove(EditorIconFolder);
  360. FileSystem::remove(EditorShaderIncludeFolder);
  361. FileSystem::remove(EditorShaderFolder);
  362. FileSystem::remove(EditorSkinFolder);
  363. FileSystem::remove(shaderDependenciesFile);
  364. }
  365. // Read shader dependencies JSON
  366. json shaderDependenciesJSON;
  367. if(FileSystem::exists(shaderDependenciesFile))
  368. {
  369. SPtr<DataStream> stream = FileSystem::openFile(shaderDependenciesFile);
  370. shaderDependenciesJSON = json::parse(stream->getAsString().c_str());
  371. stream->close();
  372. }
  373. {
  374. Vector<bool> importFlags = BuiltinResourcesHelper::generateImportFlags(iconsJSON, EditorRawIconsFolder,
  375. lastUpdateTime, forceImport);
  376. BuiltinResourcesHelper::importAssets(iconsJSON, importFlags, EditorRawIconsFolder, EditorIconFolder,
  377. mResourceManifest, BuiltinResourcesHelper::AssetType::Sprite);
  378. }
  379. {
  380. Vector<bool> includeImportFlags = BuiltinResourcesHelper::generateImportFlags(includesJSON,
  381. EditorRawShaderIncludeFolder, lastUpdateTime, forceImport);
  382. Vector<bool> shaderImportFlags = BuiltinResourcesHelper::generateImportFlags(shadersJSON, EditorRawShaderFolder,
  383. lastUpdateTime, forceImport, &shaderDependenciesJSON, EditorRawShaderIncludeFolder);
  384. // Hidden dependency: Includes must be imported before shaders, but import flags for shaders must be generated
  385. // before includes are imported, since the process checks if imports changed
  386. BuiltinResourcesHelper::importAssets(includesJSON, includeImportFlags, EditorRawShaderIncludeFolder,
  387. EditorShaderIncludeFolder, mResourceManifest, BuiltinResourcesHelper::AssetType::Normal);
  388. BuiltinResourcesHelper::importAssets(shadersJSON, shaderImportFlags, EditorRawShaderFolder, EditorShaderFolder,
  389. mResourceManifest, BuiltinResourcesHelper::AssetType::Normal, &shaderDependenciesJSON);
  390. }
  391. {
  392. Vector<bool> includeImportFlags = BuiltinResourcesHelper::generateImportFlags(skinJSON, EditorRawSkinFolder,
  393. lastUpdateTime, forceImport);
  394. BuiltinResourcesHelper::importAssets(skinJSON, includeImportFlags, EditorRawSkinFolder, EditorSkinFolder,
  395. mResourceManifest, BuiltinResourcesHelper::AssetType::Sprite);
  396. }
  397. // Update shader dependencies JSON
  398. {
  399. String jsonString = shaderDependenciesJSON.dump(4).c_str();
  400. dataListStream = FileSystem::createAndOpenFile(shaderDependenciesFile);
  401. dataListStream->writeString(jsonString);
  402. dataListStream->close();
  403. }
  404. // Import fonts
  405. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, DefaultFontFilename,
  406. BuiltinDataFolder, { DefaultFontSize }, true, "6ce69053-00d7-4c60-a229-249b8d8fd60e", mResourceManifest);
  407. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, DefaultAAFontFilename,
  408. BuiltinDataFolder, { TitleFontSize }, true, "10999b74-d976-4116-9f72-21e489a7a8e4", mResourceManifest);
  409. // Generate & save GUI skin
  410. {
  411. SPtr<GUISkin> skin = generateGUISkin();
  412. Path outputPath = BuiltinDataFolder + (GUISkinFile + L".asset");
  413. HResource skinResource = gResources()._createResourceHandle(skin, "ec0ea68d-efa5-4a3b-a6fc-b15aaec9689f");
  414. gResources().save(skinResource, outputPath, true);
  415. mResourceManifest->registerResource(skinResource.getUUID(), outputPath);
  416. }
  417. Resources::instance().unloadAllUnused();
  418. }
  419. SPtr<GUISkin> BuiltinEditorResources::generateGUISkin()
  420. {
  421. SPtr<GUISkin> skin = GUISkin::_createPtr();
  422. Path defaultFontPath = BuiltinDataFolder;
  423. defaultFontPath.append(DefaultFontFilename + L".asset");
  424. HFont defaultFont = gResources().load<Font>(defaultFontPath);
  425. Path defaultAAFontPath = BuiltinDataFolder;
  426. defaultAAFontPath.append(DefaultAAFontFilename + L".asset");
  427. HFont defaultAAFont = gResources().load<Font>(defaultAAFontPath);
  428. // Blank entry
  429. GUIElementStyle blankStyle;
  430. skin->setStyle("Blank", blankStyle);
  431. skin->setStyle(GUITexture::getGUITypeName(), blankStyle);
  432. // Label
  433. GUIElementStyle labelStyle;
  434. labelStyle.font = defaultFont;
  435. labelStyle.fontSize = DefaultFontSize;
  436. labelStyle.fixedWidth = false;
  437. labelStyle.fixedHeight = true;
  438. labelStyle.height = 14;
  439. labelStyle.minWidth = 10;
  440. labelStyle.normal.textColor = TextNormalColor;
  441. skin->setStyle(GUILabel::getGUITypeName(), labelStyle);
  442. // Window frame
  443. GUIElementStyle windowFrameStyle;
  444. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  445. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  446. windowFrameStyle.border.left = 1;
  447. windowFrameStyle.border.right = 1;
  448. windowFrameStyle.border.top = 1;
  449. windowFrameStyle.border.bottom = 1;
  450. skin->setStyle("WindowFrame", windowFrameStyle);
  451. // Button
  452. GUIElementStyle buttonStyle;
  453. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  454. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  455. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  456. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  457. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  458. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  459. buttonStyle.normal.textColor = TextNormalColor;
  460. buttonStyle.hover.textColor = TextNormalColor;
  461. buttonStyle.active.textColor = TextActiveColor;
  462. buttonStyle.normalOn.textColor = TextActiveColor;
  463. buttonStyle.hoverOn.textColor = TextActiveColor;
  464. buttonStyle.activeOn.textColor = TextActiveColor;
  465. buttonStyle.border.left = 2;
  466. buttonStyle.border.right = 2;
  467. buttonStyle.border.top = 2;
  468. buttonStyle.border.bottom = 4;
  469. buttonStyle.contentOffset.top = 2;
  470. buttonStyle.contentOffset.left = 3;
  471. buttonStyle.contentOffset.right = 3;
  472. buttonStyle.margins.bottom = 2;
  473. buttonStyle.fixedHeight = true;
  474. buttonStyle.height = 21;
  475. buttonStyle.minWidth = 20;
  476. buttonStyle.font = defaultFont;
  477. buttonStyle.fontSize = DefaultFontSize;
  478. buttonStyle.textHorzAlign = THA_Center;
  479. buttonStyle.textVertAlign = TVA_Center;
  480. skin->setStyle(GUIButton::getGUITypeName(), buttonStyle);
  481. // Left edge button
  482. GUIElementStyle leftButtonStyle;
  483. leftButtonStyle.normal.texture = getGUITexture(ButtonLeftNormalTex);
  484. leftButtonStyle.hover.texture = getGUITexture(ButtonLeftHoverTex);
  485. leftButtonStyle.active.texture = getGUITexture(ButtonLeftActiveTex);
  486. leftButtonStyle.normalOn.texture = getGUITexture(ButtonLeftActiveTex);
  487. leftButtonStyle.hoverOn.texture = getGUITexture(ButtonLeftActiveTex);
  488. leftButtonStyle.activeOn.texture = getGUITexture(ButtonLeftActiveTex);
  489. leftButtonStyle.normal.textColor = TextNormalColor;
  490. leftButtonStyle.hover.textColor = TextNormalColor;
  491. leftButtonStyle.active.textColor = TextActiveColor;
  492. leftButtonStyle.normalOn.textColor = TextActiveColor;
  493. leftButtonStyle.hoverOn.textColor = TextActiveColor;
  494. leftButtonStyle.activeOn.textColor = TextActiveColor;
  495. leftButtonStyle.border.left = 7;
  496. leftButtonStyle.border.right = 2;
  497. leftButtonStyle.border.top = 2;
  498. leftButtonStyle.border.bottom = 4;
  499. leftButtonStyle.contentOffset.top = 2;
  500. leftButtonStyle.contentOffset.left = 7;
  501. leftButtonStyle.contentOffset.right = 3;
  502. leftButtonStyle.margins.bottom = 2;
  503. leftButtonStyle.fixedHeight = true;
  504. leftButtonStyle.height = 21;
  505. leftButtonStyle.minWidth = 20;
  506. leftButtonStyle.font = defaultFont;
  507. leftButtonStyle.fontSize = DefaultFontSize;
  508. leftButtonStyle.textHorzAlign = THA_Center;
  509. leftButtonStyle.textVertAlign = TVA_Center;
  510. skin->setStyle("ButtonLeft", leftButtonStyle);
  511. // Right edge button
  512. GUIElementStyle rightButtonStyle;
  513. rightButtonStyle.normal.texture = getGUITexture(ButtonRightNormalTex);
  514. rightButtonStyle.hover.texture = getGUITexture(ButtonRightHoverTex);
  515. rightButtonStyle.active.texture = getGUITexture(ButtonRightActiveTex);
  516. rightButtonStyle.normalOn.texture = getGUITexture(ButtonRightActiveTex);
  517. rightButtonStyle.hoverOn.texture = getGUITexture(ButtonRightActiveTex);
  518. rightButtonStyle.activeOn.texture = getGUITexture(ButtonRightActiveTex);
  519. rightButtonStyle.normal.textColor = TextNormalColor;
  520. rightButtonStyle.hover.textColor = TextNormalColor;
  521. rightButtonStyle.active.textColor = TextActiveColor;
  522. rightButtonStyle.normalOn.textColor = TextActiveColor;
  523. rightButtonStyle.hoverOn.textColor = TextActiveColor;
  524. rightButtonStyle.activeOn.textColor = TextActiveColor;
  525. rightButtonStyle.border.left = 2;
  526. rightButtonStyle.border.right = 7;
  527. rightButtonStyle.border.top = 2;
  528. rightButtonStyle.border.bottom = 4;
  529. rightButtonStyle.contentOffset.top = 2;
  530. rightButtonStyle.contentOffset.left = 3;
  531. rightButtonStyle.contentOffset.right = 7;
  532. rightButtonStyle.margins.bottom = 2;
  533. rightButtonStyle.fixedHeight = true;
  534. rightButtonStyle.height = 21;
  535. rightButtonStyle.minWidth = 20;
  536. rightButtonStyle.font = defaultFont;
  537. rightButtonStyle.fontSize = DefaultFontSize;
  538. rightButtonStyle.textHorzAlign = THA_Center;
  539. rightButtonStyle.textVertAlign = TVA_Center;
  540. skin->setStyle("ButtonRight", rightButtonStyle);
  541. // Toggle
  542. GUIElementStyle toggleStyle;
  543. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  544. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  545. toggleStyle.active.texture = toggleStyle.hover.texture;
  546. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  547. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  548. toggleStyle.activeOn.texture = toggleStyle.hoverOn.texture;
  549. toggleStyle.fixedHeight = true;
  550. toggleStyle.fixedWidth = true;
  551. toggleStyle.margins.bottom = 2;
  552. toggleStyle.height = 15;
  553. toggleStyle.width = 13;
  554. skin->setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  555. // Color
  556. GUIElementStyle colorStyle;
  557. colorStyle.margins.left = 2;
  558. colorStyle.margins.right = 2;
  559. colorStyle.margins.top = 2;
  560. colorStyle.margins.bottom = 2;
  561. colorStyle.fixedHeight = true;
  562. colorStyle.height = 15;
  563. colorStyle.minWidth = 10;
  564. skin->setStyle(GUIColor::getGUITypeName(), colorStyle);
  565. // Window background texture
  566. GUIElementStyle windowBgStyle;
  567. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTex);
  568. skin->setStyle("WindowBackground", windowBgStyle);
  569. // Window tab bar background
  570. GUIElementStyle tabBarBgStyle;
  571. tabBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
  572. tabBarBgStyle.fixedHeight = true;
  573. tabBarBgStyle.height = 16;
  574. skin->setStyle("TabBarBackground", tabBarBgStyle);
  575. // Tabbed title bar tab button
  576. GUIElementStyle tabbedBarButton;
  577. tabbedBarButton.normal.texture = getGUITexture(TabButtonNormalTex);
  578. tabbedBarButton.hover.texture = tabbedBarButton.normal.texture;
  579. tabbedBarButton.active.texture = getGUITexture(TabButtonFocusedTex);
  580. tabbedBarButton.normalOn.texture = tabbedBarButton.active.texture;
  581. tabbedBarButton.hoverOn.texture = tabbedBarButton.active.texture;
  582. tabbedBarButton.activeOn.texture = tabbedBarButton.active.texture;
  583. tabbedBarButton.normal.textColor = TextNormalColor;
  584. tabbedBarButton.hover.textColor = TextNormalColor;
  585. tabbedBarButton.active.textColor = TextActiveColor;
  586. tabbedBarButton.normalOn.textColor = TextActiveColor;
  587. tabbedBarButton.hoverOn.textColor = TextActiveColor;
  588. tabbedBarButton.activeOn.textColor = TextActiveColor;
  589. tabbedBarButton.border.left = 12;
  590. tabbedBarButton.border.right = 12;
  591. tabbedBarButton.margins.left = 5;
  592. tabbedBarButton.margins.right = 5;
  593. tabbedBarButton.contentOffset.top = 3;
  594. tabbedBarButton.contentOffset.left = 6;
  595. tabbedBarButton.contentOffset.right = 6;
  596. tabbedBarButton.fixedHeight = true;
  597. tabbedBarButton.height = 15;
  598. tabbedBarButton.minWidth = 24;
  599. tabbedBarButton.maxWidth = 110;
  600. tabbedBarButton.font = defaultFont;
  601. tabbedBarButton.fontSize = DefaultFontSize;
  602. tabbedBarButton.textHorzAlign = THA_Center;
  603. tabbedBarButton.textVertAlign = TVA_Center;
  604. skin->setStyle("TabbedBarBtn", tabbedBarButton);
  605. // Tabbed title bar drag/drop button
  606. GUIElementStyle tabbedBarDropButton;
  607. tabbedBarDropButton.fixedHeight = true;
  608. tabbedBarDropButton.fixedWidth = true;
  609. tabbedBarDropButton.height = 13;
  610. tabbedBarDropButton.width = 6;
  611. skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
  612. // Window title bar background
  613. GUIElementStyle titleBarBgStyle;
  614. titleBarBgStyle.normal.texture = getGUITexture(TitleBarBackgroundTex);
  615. titleBarBgStyle.fixedHeight = true;
  616. titleBarBgStyle.height = 17;
  617. skin->setStyle("TitleBarBackground", titleBarBgStyle);
  618. // Window minimize button
  619. GUIElementStyle winMinButtonStyle;
  620. winMinButtonStyle.normal.texture = getGUITexture(MinButtonNormalTex);
  621. winMinButtonStyle.hover.texture = getGUITexture(MinButtonHoverTex);
  622. winMinButtonStyle.active.texture = getGUITexture(MinButtonActiveTex);
  623. winMinButtonStyle.fixedHeight = true;
  624. winMinButtonStyle.fixedWidth = true;
  625. winMinButtonStyle.height = 14;
  626. winMinButtonStyle.width = 14;
  627. skin->setStyle("WinMinimizeBtn", winMinButtonStyle);
  628. // Window maximize button
  629. GUIElementStyle winMaxButtonStyle;
  630. winMaxButtonStyle.normal.texture = getGUITexture(MaxButtonNormalTex);
  631. winMaxButtonStyle.hover.texture = getGUITexture(MaxButtonHoverTex);
  632. winMaxButtonStyle.active.texture = getGUITexture(MaxButtonActiveTex);
  633. winMaxButtonStyle.fixedHeight = true;
  634. winMaxButtonStyle.fixedWidth = true;
  635. winMaxButtonStyle.height = 14;
  636. winMaxButtonStyle.width = 14;
  637. skin->setStyle("WinMaximizeBtn", winMaxButtonStyle);
  638. // Window close button
  639. GUIElementStyle winCloseButtonStyle;
  640. winCloseButtonStyle.normal.texture = getGUITexture(CloseButtonNormalTex);
  641. winCloseButtonStyle.hover.texture = getGUITexture(CloseButtonHoverTex);
  642. winCloseButtonStyle.active.texture = getGUITexture(CloseButtonActiveTex);
  643. winCloseButtonStyle.fixedHeight = true;
  644. winCloseButtonStyle.fixedWidth = true;
  645. winCloseButtonStyle.height = 14;
  646. winCloseButtonStyle.width = 14;
  647. skin->setStyle("WinCloseBtn", winCloseButtonStyle);
  648. // Input box
  649. GUIElementStyle inputBoxStyle;
  650. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  651. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  652. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  653. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  654. inputBoxStyle.normal.textColor = TextNormalColor;
  655. inputBoxStyle.hover.textColor = TextNormalColor;
  656. inputBoxStyle.focused.textColor = TextNormalColor;
  657. inputBoxStyle.active.textColor = TextNormalColor;
  658. inputBoxStyle.border.left = 1;
  659. inputBoxStyle.border.right = 3;
  660. inputBoxStyle.border.top = 4;
  661. inputBoxStyle.border.bottom = 1;
  662. inputBoxStyle.contentOffset.left = 4;
  663. inputBoxStyle.contentOffset.right = 4;
  664. inputBoxStyle.contentOffset.top = 4;
  665. inputBoxStyle.contentOffset.bottom = 4;
  666. inputBoxStyle.fixedHeight = true;
  667. inputBoxStyle.height = 19;
  668. inputBoxStyle.minWidth = 10;
  669. inputBoxStyle.font = defaultFont;
  670. inputBoxStyle.fontSize = DefaultFontSize;
  671. inputBoxStyle.textHorzAlign = THA_Left;
  672. inputBoxStyle.textVertAlign = TVA_Top;
  673. skin->setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  674. /************************************************************************/
  675. /* SCROLL BAR */
  676. /************************************************************************/
  677. // Up button
  678. GUIElementStyle scrollUpBtnStyle;
  679. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  680. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  681. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  682. scrollUpBtnStyle.fixedHeight = true;
  683. scrollUpBtnStyle.fixedWidth = true;
  684. scrollUpBtnStyle.height = 11;
  685. scrollUpBtnStyle.width = 13;
  686. skin->setStyle("ScrollUpBtn", scrollUpBtnStyle);
  687. // Down button
  688. GUIElementStyle scrollDownBtnStyle;
  689. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  690. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  691. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  692. scrollDownBtnStyle.fixedHeight = true;
  693. scrollDownBtnStyle.fixedWidth = true;
  694. scrollDownBtnStyle.height = 11;
  695. scrollDownBtnStyle.width = 13;
  696. skin->setStyle("ScrollDownBtn", scrollDownBtnStyle);
  697. // Left button
  698. GUIElementStyle scrollLeftBtnStyle;
  699. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  700. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  701. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  702. scrollLeftBtnStyle.fixedHeight = true;
  703. scrollLeftBtnStyle.fixedWidth = true;
  704. scrollLeftBtnStyle.height = 13;
  705. scrollLeftBtnStyle.width = 11;
  706. skin->setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  707. // Right button
  708. GUIElementStyle scrollRightBtnStyle;
  709. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  710. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  711. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  712. scrollRightBtnStyle.fixedHeight = true;
  713. scrollRightBtnStyle.fixedWidth = true;
  714. scrollRightBtnStyle.height = 13;
  715. scrollRightBtnStyle.width = 11;
  716. skin->setStyle("ScrollRightBtn", scrollRightBtnStyle);
  717. // Horizontal handle
  718. GUIElementStyle scrollBarHorzBtnStyle;
  719. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  720. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  721. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  722. scrollBarHorzBtnStyle.fixedHeight = true;
  723. scrollBarHorzBtnStyle.fixedWidth = false;
  724. scrollBarHorzBtnStyle.minWidth = 10;
  725. scrollBarHorzBtnStyle.height = 13;
  726. scrollBarHorzBtnStyle.border.left = 4;
  727. scrollBarHorzBtnStyle.border.right = 4;
  728. skin->setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  729. // Vertical handle
  730. GUIElementStyle scrollBarVertBtnStyle;
  731. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  732. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  733. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  734. scrollBarVertBtnStyle.fixedHeight = false;
  735. scrollBarVertBtnStyle.fixedWidth = true;
  736. scrollBarVertBtnStyle.width = 13;
  737. scrollBarVertBtnStyle.minHeight = 10;
  738. scrollBarVertBtnStyle.border.top = 4;
  739. scrollBarVertBtnStyle.border.bottom = 4;
  740. skin->setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  741. // Vertical scroll bar
  742. GUIElementStyle vertScrollBarStyle;
  743. vertScrollBarStyle.normal.texture = getGUITexture(ScrollBarVBgTex);
  744. vertScrollBarStyle.hover.texture = vertScrollBarStyle.normal.texture;
  745. vertScrollBarStyle.active.texture = vertScrollBarStyle.normal.texture;
  746. vertScrollBarStyle.fixedHeight = false;
  747. vertScrollBarStyle.fixedWidth = true;
  748. vertScrollBarStyle.minHeight = 8;
  749. vertScrollBarStyle.width = 16;
  750. vertScrollBarStyle.subStyles[GUIScrollBar::getVScrollHandleType()] = "ScrollBarVertBtn";
  751. vertScrollBarStyle.subStyles[GUIScrollBar::getHScrollHandleType()] = "ScrollBarHorzBtn";
  752. skin->setStyle("ScrollBarVert", vertScrollBarStyle);
  753. // Horizontal scroll bar
  754. GUIElementStyle horzScrollBarStyle;
  755. horzScrollBarStyle.normal.texture = getGUITexture(ScrollBarHBgTex);
  756. horzScrollBarStyle.hover.texture = horzScrollBarStyle.normal.texture;
  757. horzScrollBarStyle.active.texture = horzScrollBarStyle.normal.texture;
  758. horzScrollBarStyle.fixedHeight = true;
  759. horzScrollBarStyle.fixedWidth = false;
  760. horzScrollBarStyle.minWidth = 8;
  761. horzScrollBarStyle.height = 16;
  762. horzScrollBarStyle.subStyles[GUIScrollBar::getVScrollHandleType()] = "ScrollBarVertBtn";
  763. horzScrollBarStyle.subStyles[GUIScrollBar::getHScrollHandleType()] = "ScrollBarHorzBtn";
  764. skin->setStyle("ScrollBarHorz", horzScrollBarStyle);
  765. // Horizontal resizeable handle
  766. GUIElementStyle scrollBarHorzResizeableBtnStyle;
  767. scrollBarHorzResizeableBtnStyle.normal.texture = getGUITexture(ScrollBarResizeableHandleHorzNormalTex);
  768. scrollBarHorzResizeableBtnStyle.hover.texture = getGUITexture(ScrollBarResizeableHandleHorzHoverTex);
  769. scrollBarHorzResizeableBtnStyle.active.texture = getGUITexture(ScrollBarResizeableHandleHorzActiveTex);
  770. scrollBarHorzResizeableBtnStyle.fixedHeight = true;
  771. scrollBarHorzResizeableBtnStyle.fixedWidth = false;
  772. scrollBarHorzResizeableBtnStyle.minWidth = 15;
  773. scrollBarHorzResizeableBtnStyle.height = 13;
  774. scrollBarHorzResizeableBtnStyle.border.left = 7;
  775. scrollBarHorzResizeableBtnStyle.border.right = 7;
  776. skin->setStyle("ScrollBarResizeableHorzBtn", scrollBarHorzResizeableBtnStyle);
  777. // Vertical resizeable handle
  778. GUIElementStyle scrollBarVertResizeableBtnStyle;
  779. scrollBarVertResizeableBtnStyle.normal.texture = getGUITexture(ScrollBarResizeableHandleVertNormalTex);
  780. scrollBarVertResizeableBtnStyle.hover.texture = getGUITexture(ScrollBarResizeableHandleVertHoverTex);
  781. scrollBarVertResizeableBtnStyle.active.texture = getGUITexture(ScrollBarResizeableHandleVertActiveTex);
  782. scrollBarVertResizeableBtnStyle.fixedHeight = false;
  783. scrollBarVertResizeableBtnStyle.fixedWidth = true;
  784. scrollBarVertResizeableBtnStyle.width = 13;
  785. scrollBarVertResizeableBtnStyle.minHeight = 15;
  786. scrollBarVertResizeableBtnStyle.border.top = 7;
  787. scrollBarVertResizeableBtnStyle.border.bottom = 7;
  788. skin->setStyle("ScrollBarResizeableVertBtn", scrollBarVertResizeableBtnStyle);
  789. // Vertical resizeable scroll bar
  790. GUIElementStyle vertResizeableScrollBarStyle;
  791. vertResizeableScrollBarStyle.normal.texture = getGUITexture(ScrollBarVBgTex);
  792. vertResizeableScrollBarStyle.hover.texture = vertResizeableScrollBarStyle.normal.texture;
  793. vertResizeableScrollBarStyle.active.texture = vertResizeableScrollBarStyle.normal.texture;
  794. vertResizeableScrollBarStyle.fixedHeight = false;
  795. vertResizeableScrollBarStyle.fixedWidth = true;
  796. vertResizeableScrollBarStyle.minHeight = 15;
  797. vertResizeableScrollBarStyle.width = 16;
  798. vertResizeableScrollBarStyle.subStyles[GUIScrollBar::getVScrollHandleType()] = "ScrollBarResizeableVertBtn";
  799. vertResizeableScrollBarStyle.subStyles[GUIScrollBar::getHScrollHandleType()] = "ScrollBarResizeableHorzBtn";
  800. skin->setStyle("ResizeableScrollBarVert", vertResizeableScrollBarStyle);
  801. // Horizontal resizeable scroll bar
  802. GUIElementStyle horzResizeableScrollBarStyle;
  803. horzResizeableScrollBarStyle.normal.texture = getGUITexture(ScrollBarHBgTex);
  804. horzResizeableScrollBarStyle.hover.texture = horzResizeableScrollBarStyle.normal.texture;
  805. horzResizeableScrollBarStyle.active.texture = horzResizeableScrollBarStyle.normal.texture;
  806. horzResizeableScrollBarStyle.fixedHeight = true;
  807. horzResizeableScrollBarStyle.fixedWidth = false;
  808. horzResizeableScrollBarStyle.minWidth = 15;
  809. horzResizeableScrollBarStyle.height = 16;
  810. horzResizeableScrollBarStyle.subStyles[GUIScrollBar::getVScrollHandleType()] = "ScrollBarResizeableVertBtn";
  811. horzResizeableScrollBarStyle.subStyles[GUIScrollBar::getHScrollHandleType()] = "ScrollBarResizeableHorzBtn";
  812. skin->setStyle("ResizeableScrollBarHorz", horzResizeableScrollBarStyle);
  813. /************************************************************************/
  814. /* DROP DOWN BOX */
  815. /************************************************************************/
  816. // ListBox button
  817. GUIElementStyle dropDownListStyle;
  818. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  819. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  820. dropDownListStyle.active.texture = getGUITexture(DropDownBtnActiveTex);
  821. dropDownListStyle.normalOn.texture = dropDownListStyle.active.texture;
  822. dropDownListStyle.hoverOn.texture = dropDownListStyle.active.texture;
  823. dropDownListStyle.activeOn.texture = dropDownListStyle.active.texture;
  824. dropDownListStyle.normal.textColor = TextNormalColor;
  825. dropDownListStyle.hover.textColor = TextNormalColor;
  826. dropDownListStyle.active.textColor = TextNormalColor;
  827. dropDownListStyle.normalOn.textColor = TextNormalColor;
  828. dropDownListStyle.hoverOn.textColor = TextNormalColor;
  829. dropDownListStyle.activeOn.textColor = TextNormalColor;
  830. dropDownListStyle.fixedHeight = true;
  831. dropDownListStyle.fixedWidth = false;
  832. dropDownListStyle.height = 21;
  833. dropDownListStyle.minWidth = 20;
  834. dropDownListStyle.contentOffset.left = 3;
  835. dropDownListStyle.contentOffset.right = 18;
  836. dropDownListStyle.contentOffset.top = 2;
  837. dropDownListStyle.contentOffset.bottom = 2;
  838. dropDownListStyle.border.left = 2;
  839. dropDownListStyle.border.right = 16;
  840. dropDownListStyle.border.top = 2;
  841. dropDownListStyle.border.bottom = 4;
  842. dropDownListStyle.margins.bottom = 2;
  843. dropDownListStyle.font = defaultFont;
  844. dropDownListStyle.fontSize = DefaultFontSize;
  845. dropDownListStyle.textHorzAlign = THA_Left;
  846. dropDownListStyle.textVertAlign = TVA_Center;
  847. skin->setStyle(GUIListBox::getGUITypeName(), dropDownListStyle);
  848. // DropDown scroll up button
  849. GUIElementStyle dropDownScrollUpBtnStyle;
  850. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  851. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  852. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  853. dropDownScrollUpBtnStyle.fixedHeight = true;
  854. dropDownScrollUpBtnStyle.fixedWidth = true;
  855. dropDownScrollUpBtnStyle.width = 8;
  856. dropDownScrollUpBtnStyle.height = 12;
  857. skin->setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  858. skin->setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  859. skin->setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  860. // DropDown scroll down button
  861. GUIElementStyle dropDownScrollDownBtnStyle;
  862. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  863. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  864. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  865. dropDownScrollDownBtnStyle.fixedHeight = true;
  866. dropDownScrollDownBtnStyle.fixedWidth = true;
  867. dropDownScrollDownBtnStyle.width = 8;
  868. dropDownScrollDownBtnStyle.height = 12;
  869. skin->setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  870. skin->setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  871. skin->setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  872. // DropDown handle
  873. GUIElementStyle dropDownScrollHandleStyle;
  874. dropDownScrollHandleStyle.normal.texture = getGUITexture(DropDownBoxHandleTex);
  875. dropDownScrollHandleStyle.fixedHeight = false;
  876. dropDownScrollHandleStyle.fixedWidth = true;
  877. dropDownScrollHandleStyle.height = 8;
  878. dropDownScrollHandleStyle.width = 8;
  879. skin->setStyle("ListBoxHandle", dropDownScrollHandleStyle);
  880. skin->setStyle("MenuBarHandle", dropDownScrollHandleStyle);
  881. skin->setStyle("ContextMenuHandle", dropDownScrollHandleStyle);
  882. // DropDown sidebar background
  883. GUIElementStyle dropDownSidebarBg;
  884. dropDownSidebarBg.normal.texture = getGUITexture(DropDownBoxSideBgTex);
  885. dropDownSidebarBg.fixedHeight = false;
  886. dropDownSidebarBg.fixedWidth = true;
  887. dropDownSidebarBg.height = 8;
  888. dropDownSidebarBg.width = 9;
  889. dropDownSidebarBg.border.left = 1;
  890. dropDownSidebarBg.border.top = 1;
  891. dropDownSidebarBg.border.bottom = 1;
  892. skin->setStyle("ListBoxSidebarBg", dropDownSidebarBg);
  893. skin->setStyle("MenuBarSidebarBg", dropDownSidebarBg);
  894. skin->setStyle("ContextMenuSidebarBg", dropDownSidebarBg);
  895. // DropDown entry button
  896. GUIElementStyle dropDownEntryBtnStyle;
  897. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  898. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  899. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  900. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  901. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  902. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  903. dropDownEntryBtnStyle.normal.textColor = TextNormalColor;
  904. dropDownEntryBtnStyle.hover.textColor = TextNormalColor;
  905. dropDownEntryBtnStyle.active.textColor = TextNormalColor;
  906. dropDownEntryBtnStyle.normalOn.textColor = TextNormalColor;
  907. dropDownEntryBtnStyle.hoverOn.textColor = TextNormalColor;
  908. dropDownEntryBtnStyle.activeOn.textColor = TextNormalColor;
  909. dropDownEntryBtnStyle.fixedHeight = true;
  910. dropDownEntryBtnStyle.fixedWidth = false;
  911. dropDownEntryBtnStyle.height = 16;
  912. dropDownEntryBtnStyle.width = 30;
  913. dropDownEntryBtnStyle.font = defaultFont;
  914. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  915. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  916. dropDownEntryBtnStyle.textVertAlign = TVA_Center;
  917. skin->setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  918. // DropDown toggle entry button
  919. GUIElementStyle dropDownToggleEntryBtnStyle;
  920. dropDownToggleEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryToggleNormalTex);
  921. dropDownToggleEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryToggleHoverTex);
  922. dropDownToggleEntryBtnStyle.active.texture = dropDownToggleEntryBtnStyle.hover.texture;
  923. dropDownToggleEntryBtnStyle.normalOn.texture = getGUITexture(DropDownBoxEntryToggleNormalOnTex);
  924. dropDownToggleEntryBtnStyle.hoverOn.texture = getGUITexture(DropDownBoxEntryToggleHoverOnTex);
  925. dropDownToggleEntryBtnStyle.activeOn.texture = dropDownToggleEntryBtnStyle.hoverOn.texture;
  926. dropDownToggleEntryBtnStyle.normal.textColor = TextNormalColor;
  927. dropDownToggleEntryBtnStyle.hover.textColor = TextNormalColor;
  928. dropDownToggleEntryBtnStyle.active.textColor = TextNormalColor;
  929. dropDownToggleEntryBtnStyle.normalOn.textColor = TextNormalColor;
  930. dropDownToggleEntryBtnStyle.hoverOn.textColor = TextNormalColor;
  931. dropDownToggleEntryBtnStyle.activeOn.textColor = TextNormalColor;
  932. dropDownToggleEntryBtnStyle.fixedHeight = true;
  933. dropDownToggleEntryBtnStyle.fixedWidth = false;
  934. dropDownToggleEntryBtnStyle.height = 18;
  935. dropDownToggleEntryBtnStyle.width = 30;
  936. dropDownToggleEntryBtnStyle.border.left = 17;
  937. dropDownToggleEntryBtnStyle.contentOffset.left = 17;
  938. dropDownToggleEntryBtnStyle.font = defaultFont;
  939. dropDownToggleEntryBtnStyle.fontSize = DefaultFontSize;
  940. dropDownToggleEntryBtnStyle.textHorzAlign = THA_Left;
  941. dropDownToggleEntryBtnStyle.textVertAlign = TVA_Center;
  942. skin->setStyle(GUIDropDownContent::ENTRY_TOGGLE_STYLE_TYPE, dropDownToggleEntryBtnStyle);
  943. // DropDown entry button with expand
  944. GUIElementStyle dropDownEntryExpBtnStyle;
  945. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  946. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  947. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  948. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  949. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  950. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  951. dropDownEntryExpBtnStyle.normal.textColor = TextNormalColor;
  952. dropDownEntryExpBtnStyle.hover.textColor = TextNormalColor;
  953. dropDownEntryExpBtnStyle.active.textColor = TextNormalColor;
  954. dropDownEntryExpBtnStyle.normalOn.textColor = TextNormalColor;
  955. dropDownEntryExpBtnStyle.hoverOn.textColor = TextNormalColor;
  956. dropDownEntryExpBtnStyle.activeOn.textColor = TextNormalColor;
  957. dropDownEntryExpBtnStyle.fixedHeight = true;
  958. dropDownEntryExpBtnStyle.fixedWidth = false;
  959. dropDownEntryExpBtnStyle.height = 16;
  960. dropDownEntryExpBtnStyle.width = 30;
  961. dropDownEntryExpBtnStyle.border.right = 13;
  962. dropDownEntryExpBtnStyle.font = defaultFont;
  963. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  964. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  965. dropDownEntryExpBtnStyle.textVertAlign = TVA_Center;
  966. skin->setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  967. // Drop down separator
  968. GUIElementStyle dropDownSeparatorStyle;
  969. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  970. dropDownSeparatorStyle.fixedHeight = true;
  971. dropDownSeparatorStyle.fixedWidth = false;
  972. dropDownSeparatorStyle.height = 3;
  973. dropDownSeparatorStyle.width = 30;
  974. skin->setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  975. // Drop down content
  976. GUIElementStyle dropDownContentStyle;
  977. dropDownContentStyle.minWidth = 50;
  978. dropDownContentStyle.minHeight = 20;
  979. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_TOGGLE_STYLE_TYPE] = GUIDropDownContent::ENTRY_TOGGLE_STYLE_TYPE;
  980. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  981. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  982. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  983. skin->setStyle("ListBoxContent", dropDownContentStyle);
  984. skin->setStyle("MenuBarContent", dropDownContentStyle);
  985. skin->setStyle("ContextMenuContent", dropDownContentStyle);
  986. // DropDown box frame
  987. GUIElementStyle dropDownBoxStyle;
  988. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  989. dropDownBoxStyle.hover.texture = dropDownBoxStyle.normal.texture;
  990. dropDownBoxStyle.active.texture = dropDownBoxStyle.hover.texture;
  991. dropDownBoxStyle.fixedHeight = false;
  992. dropDownBoxStyle.fixedWidth = false;
  993. dropDownBoxStyle.border.left = 2;
  994. dropDownBoxStyle.border.right = 2;
  995. dropDownBoxStyle.border.top = 2;
  996. dropDownBoxStyle.border.bottom = 4;
  997. dropDownBoxStyle.margins.left = 6;
  998. dropDownBoxStyle.margins.right = 6;
  999. dropDownBoxStyle.margins.top = 4;
  1000. dropDownBoxStyle.margins.bottom = 6;
  1001. skin->setStyle("ListBoxFrame", dropDownBoxStyle);
  1002. skin->setStyle("MenuBarFrame", dropDownBoxStyle);
  1003. skin->setStyle("ContextMenuFrame", dropDownBoxStyle);
  1004. /************************************************************************/
  1005. /* TOOLTIP */
  1006. /************************************************************************/
  1007. GUIElementStyle tooltipFrameStyle;
  1008. tooltipFrameStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  1009. tooltipFrameStyle.hover.texture = tooltipFrameStyle.normal.texture;
  1010. tooltipFrameStyle.active.texture = tooltipFrameStyle.hover.texture;
  1011. tooltipFrameStyle.fixedHeight = false;
  1012. tooltipFrameStyle.fixedWidth = false;
  1013. tooltipFrameStyle.border.left = 2;
  1014. tooltipFrameStyle.border.right = 2;
  1015. tooltipFrameStyle.border.top = 2;
  1016. tooltipFrameStyle.border.bottom = 4;
  1017. tooltipFrameStyle.margins.left = 6;
  1018. tooltipFrameStyle.margins.right = 6;
  1019. tooltipFrameStyle.margins.top = 4;
  1020. tooltipFrameStyle.margins.bottom = 6;
  1021. skin->setStyle(GUITooltip::getFrameStyleName(), tooltipFrameStyle);
  1022. /************************************************************************/
  1023. /* MENU BAR */
  1024. /************************************************************************/
  1025. // MenuBar background
  1026. GUIElementStyle menuBarBgStyle;
  1027. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  1028. menuBarBgStyle.height = 14;
  1029. menuBarBgStyle.width = 2;
  1030. menuBarBgStyle.border.bottom = 2;
  1031. skin->setStyle(GUIMenuBar::getBackgroundStyleType(), menuBarBgStyle);
  1032. // MenuBar separator line
  1033. GUIElementStyle menuBarLineStyle;
  1034. menuBarLineStyle.normal.texture = getGUITexture(MenuBarLineNormalTex);
  1035. menuBarLineStyle.normalOn.texture = getGUITexture(MenuBarLineActiveTex);
  1036. menuBarLineStyle.fixedHeight = true;
  1037. menuBarLineStyle.height = 1;
  1038. skin->setStyle(GUIMenuBar::getLineStyleType(), menuBarLineStyle);
  1039. // MenuBar Banshee logo
  1040. GUIElementStyle menuBarBansheeLogoStyle;
  1041. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  1042. menuBarBansheeLogoStyle.fixedHeight = true;
  1043. menuBarBansheeLogoStyle.fixedWidth = true;
  1044. menuBarBansheeLogoStyle.height = 46;
  1045. menuBarBansheeLogoStyle.width = 46;
  1046. skin->setStyle(GUIMenuBar::getLogoStyleType(), menuBarBansheeLogoStyle);
  1047. // MenuBar button
  1048. GUIElementStyle menuBarBtnStyle;
  1049. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  1050. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  1051. menuBarBtnStyle.active.texture = getGUITexture(MenuBarBtnActiveTex);
  1052. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.active.texture;
  1053. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.active.texture;
  1054. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.active.texture;
  1055. menuBarBtnStyle.normal.textColor = TextNormalColor;
  1056. menuBarBtnStyle.hover.textColor = TextNormalColor;
  1057. menuBarBtnStyle.active.textColor = TextActiveColor;
  1058. menuBarBtnStyle.normalOn.textColor = TextActiveColor;
  1059. menuBarBtnStyle.hoverOn.textColor = TextActiveColor;
  1060. menuBarBtnStyle.activeOn.textColor = TextActiveColor;
  1061. menuBarBtnStyle.fixedHeight = true;
  1062. menuBarBtnStyle.fixedWidth = false;
  1063. menuBarBtnStyle.height = 14;
  1064. menuBarBtnStyle.width = 4;
  1065. menuBarBtnStyle.margins.left = 2;
  1066. menuBarBtnStyle.margins.right = 2;
  1067. menuBarBtnStyle.margins.top = 2;
  1068. menuBarBtnStyle.margins.bottom = 2;
  1069. menuBarBtnStyle.font = defaultFont;
  1070. menuBarBtnStyle.fontSize = DefaultFontSize;
  1071. menuBarBtnStyle.textHorzAlign = THA_Left;
  1072. menuBarBtnStyle.textVertAlign = TVA_Top;
  1073. skin->setStyle(GUIMenuBar::getMenuItemButtonStyleType(), menuBarBtnStyle);
  1074. // ToolBar separator
  1075. GUIElementStyle toolBarSeparator;
  1076. toolBarSeparator.normal.texture = getGUITexture(ToolBarSeparatorTex);
  1077. toolBarSeparator.fixedWidth = true;
  1078. toolBarSeparator.width = 3;
  1079. toolBarSeparator.height = 32;
  1080. skin->setStyle(GUIMenuBar::getToolBarSeparatorStyleType(), toolBarSeparator);
  1081. // ToolBar button
  1082. GUIElementStyle toolBarBtnStyle;
  1083. toolBarBtnStyle.normal.texture = getGUITexture(ToolBarBtnNormalTex);
  1084. toolBarBtnStyle.hover.texture = getGUITexture(ToolBarBtnHoverTex);
  1085. toolBarBtnStyle.active.texture = getGUITexture(ToolBarBtnActiveTex);
  1086. toolBarBtnStyle.normalOn.texture = getGUITexture(ToolBarBtnActiveTex);
  1087. toolBarBtnStyle.hoverOn.texture = getGUITexture(ToolBarBtnActiveTex);
  1088. toolBarBtnStyle.activeOn.texture = getGUITexture(ToolBarBtnActiveTex);
  1089. toolBarBtnStyle.normal.textColor = TextNormalColor;
  1090. toolBarBtnStyle.hover.textColor = TextNormalColor;
  1091. toolBarBtnStyle.active.textColor = TextActiveColor;
  1092. toolBarBtnStyle.normalOn.textColor = TextNormalColor;
  1093. toolBarBtnStyle.hoverOn.textColor = TextNormalColor;
  1094. toolBarBtnStyle.activeOn.textColor = TextActiveColor;
  1095. toolBarBtnStyle.fixedHeight = true;
  1096. toolBarBtnStyle.fixedWidth = true;
  1097. toolBarBtnStyle.height = 32;
  1098. toolBarBtnStyle.width = 32;
  1099. skin->setStyle(GUIMenuBar::getToolBarButtonStyleType(), toolBarBtnStyle);
  1100. /************************************************************************/
  1101. /* SEPARATOR */
  1102. /************************************************************************/
  1103. GUIElementStyle separator;
  1104. separator.normal.texture = getGUITexture(L"Separator.png");
  1105. separator.hover.texture = separator.normal.texture;
  1106. separator.active.texture = separator.normal.texture;
  1107. separator.fixedHeight = false;
  1108. separator.fixedWidth = false;
  1109. separator.height = 2;
  1110. separator.width = 2;
  1111. skin->setStyle("Separator", separator);
  1112. /************************************************************************/
  1113. /* HEADER */
  1114. /************************************************************************/
  1115. GUIElementStyle headerBackground;
  1116. headerBackground.normal.texture = getGUITexture(L"HeaderBg.png");
  1117. skin->setStyle("HeaderBackground", headerBackground);
  1118. GUIElementStyle header;
  1119. header.normal.texture = getGUITexture(L"Header.png");
  1120. header.normal.textColor = TextNormalColor;
  1121. header.border.bottom = 2;
  1122. header.fixedHeight = true;
  1123. header.height = 21;
  1124. header.minWidth = 4;
  1125. header.minHeight = 4;
  1126. header.font = defaultFont;
  1127. header.fontSize = DefaultFontSize;
  1128. header.textHorzAlign = THA_Center;
  1129. header.textVertAlign = TVA_Center;
  1130. skin->setStyle("Header", header);
  1131. /************************************************************************/
  1132. /* TREE VIEW */
  1133. /************************************************************************/
  1134. // Expand button
  1135. GUIElementStyle expandButtonStyle;
  1136. expandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  1137. expandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  1138. expandButtonStyle.active.texture = expandButtonStyle.hover.texture;
  1139. expandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  1140. expandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  1141. expandButtonStyle.activeOn.texture = expandButtonStyle.hoverOn.texture;
  1142. expandButtonStyle.fixedHeight = true;
  1143. expandButtonStyle.fixedWidth = true;
  1144. expandButtonStyle.height = 10;
  1145. expandButtonStyle.width = 11;
  1146. expandButtonStyle.normal.textColor = TextNormalColor;
  1147. expandButtonStyle.hover.textColor = TextNormalColor;
  1148. expandButtonStyle.active.textColor = TextNormalColor;
  1149. expandButtonStyle.normalOn.textColor = TextNormalColor;
  1150. expandButtonStyle.hoverOn.textColor = TextNormalColor;
  1151. expandButtonStyle.activeOn.textColor = TextNormalColor;
  1152. expandButtonStyle.font = defaultFont;
  1153. expandButtonStyle.fontSize = DefaultFontSize;
  1154. expandButtonStyle.textHorzAlign = THA_Left;
  1155. expandButtonStyle.textVertAlign = TVA_Center;
  1156. expandButtonStyle.contentOffset = RectOffset(16, 0, 0, 0);
  1157. expandButtonStyle.border.left = 10;
  1158. skin->setStyle("Expand", expandButtonStyle);
  1159. // Entry
  1160. GUIElementStyle treeViewEntryStyle;
  1161. treeViewEntryStyle.font = defaultFont;
  1162. treeViewEntryStyle.fontSize = DefaultFontSize;
  1163. treeViewEntryStyle.fixedWidth = false;
  1164. treeViewEntryStyle.fixedHeight = true;
  1165. treeViewEntryStyle.height = 16;
  1166. treeViewEntryStyle.minWidth = 10;
  1167. treeViewEntryStyle.normal.textColor = TextNormalColor;
  1168. skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
  1169. // Background
  1170. GUIElementStyle treeViewBackgroundStyle;
  1171. skin->setStyle("TreeViewBackground", treeViewBackgroundStyle);
  1172. // Selection background
  1173. GUIElementStyle treeViewSelBackgroundStyle;
  1174. treeViewSelBackgroundStyle.normal.texture = getGUITexture(SelectionBgTex);
  1175. treeViewSelBackgroundStyle.fixedHeight = false;
  1176. treeViewSelBackgroundStyle.fixedWidth = false;
  1177. treeViewSelBackgroundStyle.height = 2;
  1178. treeViewSelBackgroundStyle.width = 2;
  1179. skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  1180. // Highlight background
  1181. GUIElementStyle treeViewHLBackgroundStyle;
  1182. treeViewHLBackgroundStyle.normal.texture = getGUITexture(TreeViewHighlightBackground);
  1183. treeViewHLBackgroundStyle.fixedHeight = false;
  1184. treeViewHLBackgroundStyle.fixedWidth = false;
  1185. treeViewHLBackgroundStyle.height = 2;
  1186. treeViewHLBackgroundStyle.width = 2;
  1187. skin->setStyle("TreeViewHighlightBackground", treeViewHLBackgroundStyle);
  1188. // Edit box
  1189. GUIElementStyle treeViewEditBox;
  1190. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  1191. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  1192. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  1193. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  1194. treeViewEditBox.normal.textColor = TextNormalColor;
  1195. treeViewEditBox.hover.textColor = TextNormalColor;
  1196. treeViewEditBox.focused.textColor = TextNormalColor;
  1197. treeViewEditBox.active.textColor = TextNormalColor;
  1198. treeViewEditBox.border.left = 1;
  1199. treeViewEditBox.border.right = 1;
  1200. treeViewEditBox.border.top = 1;
  1201. treeViewEditBox.border.bottom = 1;
  1202. treeViewEditBox.margins.left = 1;
  1203. treeViewEditBox.margins.right = 1;
  1204. treeViewEditBox.margins.top = 1;
  1205. treeViewEditBox.margins.bottom = 1;
  1206. treeViewEditBox.fixedHeight = true;
  1207. treeViewEditBox.height = 13;
  1208. treeViewEditBox.minWidth = 10;
  1209. treeViewEditBox.font = defaultFont;
  1210. treeViewEditBox.fontSize = DefaultFontSize;
  1211. treeViewEditBox.textHorzAlign = THA_Left;
  1212. treeViewEditBox.textVertAlign = TVA_Top;
  1213. skin->setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  1214. // Element highlight
  1215. GUIElementStyle treeViewElementHighlight;
  1216. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  1217. treeViewElementHighlight.border.left = 1;
  1218. treeViewElementHighlight.border.right = 1;
  1219. treeViewElementHighlight.border.top = 1;
  1220. treeViewElementHighlight.border.bottom = 1;
  1221. skin->setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  1222. // Element separator highlight
  1223. GUIElementStyle treeViewElementSepHighlight;
  1224. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  1225. treeViewElementSepHighlight.border.left = 1;
  1226. treeViewElementSepHighlight.border.right = 1;
  1227. treeViewElementSepHighlight.border.top = 1;
  1228. treeViewElementSepHighlight.border.bottom = 1;
  1229. skin->setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  1230. /************************************************************************/
  1231. /* OBJECT DROP FIELD */
  1232. /************************************************************************/
  1233. GUIElementStyle objectDropStyle;
  1234. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  1235. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  1236. objectDropStyle.hover.texture = objectDropStyle.normal.texture;
  1237. objectDropStyle.hoverOn.texture = objectDropStyle.normalOn.texture;
  1238. objectDropStyle.active.texture = objectDropStyle.normal.texture;
  1239. objectDropStyle.activeOn.texture = objectDropStyle.normalOn.texture;
  1240. objectDropStyle.normal.textColor = TextNormalColor;
  1241. objectDropStyle.hover.textColor = TextNormalColor;
  1242. objectDropStyle.active.textColor = TextNormalColor;
  1243. objectDropStyle.normalOn.textColor = TextNormalColor;
  1244. objectDropStyle.hoverOn.textColor = TextNormalColor;
  1245. objectDropStyle.activeOn.textColor = TextNormalColor;
  1246. objectDropStyle.border.left = 2;
  1247. objectDropStyle.border.top = 2;
  1248. objectDropStyle.border.bottom = 4;
  1249. objectDropStyle.contentOffset.left = 3;
  1250. objectDropStyle.contentOffset.right = 1;
  1251. objectDropStyle.margins.bottom = 2;
  1252. objectDropStyle.fixedHeight = true;
  1253. objectDropStyle.height = 21;
  1254. objectDropStyle.minWidth = 20;
  1255. objectDropStyle.font = defaultFont;
  1256. objectDropStyle.fontSize = DefaultFontSize;
  1257. objectDropStyle.textHorzAlign = THA_Center;
  1258. objectDropStyle.textVertAlign = TVA_Center;
  1259. skin->setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  1260. GUIElementStyle objectClearBtnStyle;
  1261. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  1262. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  1263. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  1264. objectClearBtnStyle.fixedHeight = true;
  1265. objectClearBtnStyle.fixedWidth = true;
  1266. objectClearBtnStyle.height = 21;
  1267. objectClearBtnStyle.width = 16;
  1268. objectClearBtnStyle.margins.bottom = 2;
  1269. skin->setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  1270. GUIElementStyle editorObjectFieldStyle;
  1271. editorObjectFieldStyle.fixedHeight = true;
  1272. editorObjectFieldStyle.height = 21;
  1273. editorObjectFieldStyle.minWidth = 30;
  1274. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1275. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  1276. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  1277. skin->setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  1278. /************************************************************************/
  1279. /* TEXTURE DROP FIELD */
  1280. /************************************************************************/
  1281. GUIElementStyle textureFieldStyle;
  1282. textureFieldStyle.minHeight = 15;
  1283. textureFieldStyle.minWidth = 15;
  1284. textureFieldStyle.subStyles[TextureFieldDropStyleName] = TextureFieldDropStyleName;
  1285. textureFieldStyle.subStyles[TextureFieldClearBtnStyleName] = TextureFieldClearBtnStyleName;
  1286. textureFieldStyle.subStyles[TextureFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1287. skin->setStyle(TextureFieldStyleName, textureFieldStyle);
  1288. GUIElementStyle textureDropStyle;
  1289. textureDropStyle.font = defaultFont;
  1290. textureDropStyle.fontSize = DefaultFontSize;
  1291. textureDropStyle.textHorzAlign = THA_Center;
  1292. textureDropStyle.textVertAlign = TVA_Center;
  1293. textureDropStyle.normal.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1294. textureDropStyle.normal.texture = getGUITexture(TextureDropTex);
  1295. textureDropStyle.hover.textColor = textureDropStyle.normal.textColor;
  1296. textureDropStyle.hover.texture = textureDropStyle.normal.texture;
  1297. textureDropStyle.active.textColor = textureDropStyle.normal.textColor;
  1298. textureDropStyle.active.texture = textureDropStyle.normal.texture;
  1299. textureDropStyle.normalOn.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1300. textureDropStyle.normalOn.texture = getGUITexture(TextureDropOnTex);
  1301. textureDropStyle.hoverOn.textColor = textureDropStyle.normalOn.textColor;
  1302. textureDropStyle.hoverOn.texture = textureDropStyle.normalOn.texture;
  1303. textureDropStyle.activeOn.textColor = textureDropStyle.normalOn.textColor;
  1304. textureDropStyle.activeOn.texture = textureDropStyle.normalOn.texture;
  1305. textureDropStyle.height = 84;
  1306. textureDropStyle.width = 82;
  1307. textureDropStyle.fixedHeight = true;
  1308. textureDropStyle.fixedWidth = true;
  1309. textureDropStyle.border.left = 2;
  1310. textureDropStyle.border.right = 2;
  1311. textureDropStyle.border.top = 2;
  1312. textureDropStyle.border.bottom = 4;
  1313. textureDropStyle.contentOffset.left = 4;
  1314. textureDropStyle.contentOffset.right = 4;
  1315. textureDropStyle.contentOffset.top = 4;
  1316. textureDropStyle.contentOffset.bottom = 4;
  1317. skin->setStyle(TextureFieldDropStyleName, textureDropStyle);
  1318. GUIElementStyle textureDropClearStyle;
  1319. textureDropClearStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1320. textureDropClearStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1321. textureDropClearStyle.active.texture = getGUITexture(XButtonActiveTex);
  1322. textureDropClearStyle.fixedWidth = true;
  1323. textureDropClearStyle.fixedHeight = true;
  1324. textureDropClearStyle.height = 10;
  1325. textureDropClearStyle.width = 10;
  1326. skin->setStyle(TextureFieldClearBtnStyleName, textureDropClearStyle);
  1327. /************************************************************************/
  1328. /* EDITOR FIELDS */
  1329. /************************************************************************/
  1330. GUIElementStyle editorFieldLabelStyle;
  1331. editorFieldLabelStyle.font = defaultFont;
  1332. editorFieldLabelStyle.fontSize = DefaultFontSize;
  1333. editorFieldLabelStyle.normal.textColor = TextNormalColor;
  1334. editorFieldLabelStyle.fixedWidth = false;
  1335. editorFieldLabelStyle.fixedHeight = true;
  1336. editorFieldLabelStyle.height = 14;
  1337. editorFieldLabelStyle.minWidth = 10;
  1338. editorFieldLabelStyle.textHorzAlign = THA_Left;
  1339. skin->setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  1340. GUIElementStyle editorIntFieldStyle;
  1341. editorIntFieldStyle.fixedHeight = true;
  1342. editorIntFieldStyle.height = 21;
  1343. editorIntFieldStyle.minWidth = 30;
  1344. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1345. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1346. skin->setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  1347. GUIElementStyle editorFloatFieldStyle;
  1348. editorFloatFieldStyle.fixedHeight = true;
  1349. editorFloatFieldStyle.height = 21;
  1350. editorFloatFieldStyle.minWidth = 30;
  1351. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1352. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1353. skin->setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  1354. GUIElementStyle editorTextFieldStyle;
  1355. editorTextFieldStyle.fixedHeight = true;
  1356. editorTextFieldStyle.height = 21;
  1357. editorTextFieldStyle.minWidth = 30;
  1358. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1359. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1360. skin->setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  1361. GUIElementStyle editorColorFieldStyle;
  1362. editorColorFieldStyle.fixedHeight = true;
  1363. editorColorFieldStyle.height = 21;
  1364. editorColorFieldStyle.minWidth = 30;
  1365. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1366. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  1367. skin->setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  1368. GUIElementStyle editorToggleFieldStyle;
  1369. editorToggleFieldStyle.fixedHeight = true;
  1370. editorToggleFieldStyle.height = 15;
  1371. editorToggleFieldStyle.minWidth = 30;
  1372. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1373. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  1374. skin->setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  1375. GUIElementStyle editorVector2FieldStyle;
  1376. editorVector2FieldStyle.fixedHeight = true;
  1377. editorVector2FieldStyle.height = 35;
  1378. editorVector2FieldStyle.minWidth = 30;
  1379. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1380. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1381. skin->setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  1382. GUIElementStyle editorVector3FieldStyle;
  1383. editorVector3FieldStyle.fixedHeight = true;
  1384. editorVector3FieldStyle.height = 35;
  1385. editorVector3FieldStyle.minWidth = 30;
  1386. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1387. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1388. skin->setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  1389. GUIElementStyle editorVector4FieldStyle;
  1390. editorVector4FieldStyle.fixedHeight = true;
  1391. editorVector4FieldStyle.height = 35;
  1392. editorVector4FieldStyle.minWidth = 30;
  1393. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1394. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1395. skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  1396. GUIElementStyle editorListBoxFieldStyle;
  1397. editorListBoxFieldStyle.fixedHeight = true;
  1398. editorListBoxFieldStyle.height = 21;
  1399. editorListBoxFieldStyle.minWidth = 30;
  1400. editorListBoxFieldStyle.subStyles[GUIListBoxField::getLabelStyleType()] = GUIListBoxField::getLabelStyleType();
  1401. editorListBoxFieldStyle.subStyles[GUIListBoxField::getListBoxStyleType()] = GUIListBox::getGUITypeName();
  1402. skin->setStyle(GUIListBoxField::getGUITypeName(), editorListBoxFieldStyle);
  1403. GUIElementStyle editorSliderFieldStyle;
  1404. editorSliderFieldStyle.fixedHeight = true;
  1405. editorSliderFieldStyle.height = 21;
  1406. editorSliderFieldStyle.minWidth = 30;
  1407. editorSliderFieldStyle.subStyles[GUISliderField::getLabelStyleType()] = GUISliderField::getLabelStyleType();
  1408. editorSliderFieldStyle.subStyles[GUISliderField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1409. editorSliderFieldStyle.subStyles[GUISliderField::getSliderStyleType()] = GUISliderHorz::getGUITypeName();
  1410. skin->setStyle(GUISliderField::getGUITypeName(), editorSliderFieldStyle);
  1411. /************************************************************************/
  1412. /* FOLDOUT */
  1413. /************************************************************************/
  1414. GUIElementStyle foldoutStyle;
  1415. foldoutStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  1416. foldoutStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  1417. foldoutStyle.active.texture = getGUITexture(FoldoutOpenActiveTex);
  1418. foldoutStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  1419. foldoutStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  1420. foldoutStyle.activeOn.texture = getGUITexture(FoldoutOpenActiveTex);
  1421. foldoutStyle.normal.textColor = TextNormalColor;
  1422. foldoutStyle.hover.textColor = TextNormalColor;
  1423. foldoutStyle.active.textColor = TextNormalColor;
  1424. foldoutStyle.normalOn.textColor = TextNormalColor;
  1425. foldoutStyle.hoverOn.textColor = TextNormalColor;
  1426. foldoutStyle.activeOn.textColor = TextNormalColor;
  1427. foldoutStyle.fixedHeight = true;
  1428. foldoutStyle.fixedWidth = false;
  1429. foldoutStyle.height = 21;
  1430. foldoutStyle.minWidth = 17;
  1431. foldoutStyle.font = defaultFont;
  1432. foldoutStyle.fontSize = DefaultFontSize;
  1433. foldoutStyle.textHorzAlign = THA_Left;
  1434. foldoutStyle.textVertAlign = TVA_Center;
  1435. foldoutStyle.contentOffset = RectOffset(16, 0, 0, 0);
  1436. foldoutStyle.border.left = 15;
  1437. foldoutStyle.border.right = 2;
  1438. foldoutStyle.border.top = 2;
  1439. foldoutStyle.border.bottom = 4;
  1440. skin->setStyle("Foldout", foldoutStyle);
  1441. /************************************************************************/
  1442. /* PROGRESS BAR */
  1443. /************************************************************************/
  1444. GUIElementStyle progressBarBgStyle;
  1445. progressBarBgStyle.fixedHeight = true;
  1446. progressBarBgStyle.height = 17;
  1447. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  1448. progressBarBgStyle.border.left = 8;
  1449. progressBarBgStyle.border.right = 8;
  1450. skin->setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  1451. GUIElementStyle progressBarFillStyle;
  1452. progressBarFillStyle.fixedHeight = true;
  1453. progressBarFillStyle.height = 16;
  1454. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  1455. progressBarFillStyle.border.left = 9;
  1456. progressBarFillStyle.border.right = 10;
  1457. skin->setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  1458. GUIElementStyle progressBarStyle;
  1459. progressBarStyle.fixedHeight = true;
  1460. progressBarStyle.height = 17;
  1461. progressBarStyle.minWidth = 100;
  1462. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  1463. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  1464. skin->setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  1465. /************************************************************************/
  1466. /* SLIDER */
  1467. /************************************************************************/
  1468. GUIElementStyle sliderHandleStyle;
  1469. sliderHandleStyle.fixedHeight = true;
  1470. sliderHandleStyle.fixedWidth = true;
  1471. sliderHandleStyle.width = 12;
  1472. sliderHandleStyle.height = 13;
  1473. sliderHandleStyle.normal.texture = getGUITexture(SliderHandleNormalTex);
  1474. sliderHandleStyle.hover.texture = getGUITexture(SliderHandleHoverTex);
  1475. sliderHandleStyle.active.texture = getGUITexture(SliderHandleActiveTex);
  1476. skin->setStyle(GUISlider::getHandleStyleType(), sliderHandleStyle);
  1477. GUIElementStyle sliderHorizontalBgStyle;
  1478. sliderHorizontalBgStyle.fixedHeight = true;
  1479. sliderHorizontalBgStyle.height = 10;
  1480. sliderHorizontalBgStyle.normal.texture = getGUITexture(SliderHBackgroundTex);
  1481. sliderHorizontalBgStyle.border.left = 4;
  1482. sliderHorizontalBgStyle.border.right = 4;
  1483. skin->setStyle("SliderHorzBg", sliderHorizontalBgStyle);
  1484. GUIElementStyle sliderHorizontalFillStyle;
  1485. sliderHorizontalFillStyle.fixedHeight = true;
  1486. sliderHorizontalFillStyle.height = 10;
  1487. sliderHorizontalFillStyle.normal.texture = getGUITexture(SliderHFillTex);
  1488. sliderHorizontalFillStyle.border.left = 6;
  1489. sliderHorizontalFillStyle.border.right = 4;
  1490. skin->setStyle("SliderHorzFill", sliderHorizontalFillStyle);
  1491. GUIElementStyle sliderHorizontalStyle;
  1492. sliderHorizontalStyle.fixedHeight = true;
  1493. sliderHorizontalStyle.height = 13;
  1494. sliderHorizontalStyle.width = 150;
  1495. sliderHorizontalStyle.minWidth = 10;
  1496. sliderHorizontalStyle.subStyles[GUISlider::getHandleStyleType()] = GUISlider::getHandleStyleType();
  1497. sliderHorizontalStyle.subStyles[GUISlider::getBackgroundStyleType()] = "SliderHorzBg";
  1498. sliderHorizontalStyle.subStyles[GUISlider::getFillStyleType()] = "SliderHorzFill";
  1499. skin->setStyle(GUISliderHorz::getGUITypeName(), sliderHorizontalStyle);
  1500. GUIElementStyle sliderVerticalBgStyle;
  1501. sliderVerticalBgStyle.fixedWidth = true;
  1502. sliderVerticalBgStyle.width = 10;
  1503. sliderVerticalBgStyle.normal.texture = getGUITexture(SliderVBackgroundTex);
  1504. sliderVerticalBgStyle.border.top = 4;
  1505. sliderVerticalBgStyle.border.bottom = 4;
  1506. skin->setStyle("SliderVertBg", sliderVerticalBgStyle);
  1507. GUIElementStyle sliderVerticalFillStyle;
  1508. sliderVerticalFillStyle.fixedWidth = true;
  1509. sliderVerticalFillStyle.width = 10;
  1510. sliderVerticalFillStyle.normal.texture = getGUITexture(SliderVFillTex);
  1511. sliderVerticalFillStyle.border.top = 6;
  1512. sliderVerticalFillStyle.border.bottom = 4;
  1513. skin->setStyle("SliderVertFill", sliderVerticalFillStyle);
  1514. GUIElementStyle sliderVerticalStyle;
  1515. sliderVerticalStyle.fixedWidth = true;
  1516. sliderVerticalStyle.width = 13;
  1517. sliderVerticalStyle.height = 150;
  1518. sliderVerticalStyle.minHeight = 10;
  1519. sliderVerticalStyle.subStyles[GUISlider::getHandleStyleType()] = GUISlider::getHandleStyleType();
  1520. sliderVerticalStyle.subStyles[GUISlider::getBackgroundStyleType()] = "SliderVertBg";
  1521. sliderVerticalStyle.subStyles[GUISlider::getFillStyleType()] = "SliderVertFill";
  1522. skin->setStyle(GUISliderVert::getGUITypeName(), sliderVerticalStyle);
  1523. /************************************************************************/
  1524. /* COLOR PICKER SLIDER */
  1525. /************************************************************************/
  1526. GUIElementStyle colorPickerSliderHorzHandleStyle;
  1527. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1528. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  1529. colorPickerSliderHorzHandleStyle.height = 20;
  1530. colorPickerSliderHorzHandleStyle.width = 7;
  1531. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  1532. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1533. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1534. skin->setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  1535. GUIElementStyle colorPickerSliderHorzStyle;
  1536. colorPickerSliderHorzStyle.fixedHeight = true;
  1537. colorPickerSliderHorzStyle.height = 32;
  1538. colorPickerSliderHorzStyle.minWidth = 20;
  1539. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  1540. skin->setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  1541. GUIElementStyle colorPickerSliderVertHandleStyle;
  1542. colorPickerSliderVertHandleStyle.fixedHeight = true;
  1543. colorPickerSliderVertHandleStyle.fixedWidth = true;
  1544. colorPickerSliderVertHandleStyle.height = 7;
  1545. colorPickerSliderVertHandleStyle.width = 45;
  1546. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  1547. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1548. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1549. skin->setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  1550. GUIElementStyle colorPickerSliderVertStyle;
  1551. colorPickerSliderVertStyle.fixedWidth = true;
  1552. colorPickerSliderVertStyle.width = 30;
  1553. colorPickerSliderVertStyle.minHeight = 20;
  1554. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  1555. skin->setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  1556. GUIElementStyle colorPickerSlider2DHandleStyle;
  1557. colorPickerSlider2DHandleStyle.fixedHeight = true;
  1558. colorPickerSlider2DHandleStyle.fixedWidth = true;
  1559. colorPickerSlider2DHandleStyle.height = 7;
  1560. colorPickerSlider2DHandleStyle.width = 7;
  1561. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  1562. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1563. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1564. skin->setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  1565. /************************************************************************/
  1566. /* STATUS BAR */
  1567. /************************************************************************/
  1568. GUIElementStyle statusBarBgStyle;
  1569. statusBarBgStyle.height = 16;
  1570. statusBarBgStyle.border.top = 2;
  1571. statusBarBgStyle.normal.texture = getGUITexture(StatusBarBgTex);
  1572. skin->setStyle(GUIStatusBar::getGUIBackgroundTypeName(), statusBarBgStyle);
  1573. GUIElementStyle statusBarMessageBtnStyle;
  1574. statusBarMessageBtnStyle.font = defaultFont;
  1575. statusBarMessageBtnStyle.fontSize = DefaultFontSize;
  1576. statusBarMessageBtnStyle.fixedHeight = true;
  1577. statusBarMessageBtnStyle.height = 16;
  1578. statusBarMessageBtnStyle.minWidth = 10;
  1579. statusBarMessageBtnStyle.textHorzAlign = THA_Left;
  1580. statusBarMessageBtnStyle.textVertAlign = TVA_Center;
  1581. statusBarMessageBtnStyle.imagePosition = GUIImagePosition::Left;
  1582. skin->setStyle(GUIStatusBar::getGUIMessageTypeName(), statusBarMessageBtnStyle);
  1583. GUIElementStyle statusBarStyle;
  1584. statusBarStyle.height = 16;
  1585. statusBarStyle.subStyles[GUIStatusBar::getGUIBackgroundTypeName()] = GUIStatusBar::getGUIBackgroundTypeName();
  1586. statusBarStyle.subStyles[GUIStatusBar::getGUIMessageTypeName()] = GUIStatusBar::getGUIMessageTypeName();
  1587. skin->setStyle(GUIStatusBar::getGUITypeName(), statusBarStyle);
  1588. /************************************************************************/
  1589. /* OTHER */
  1590. /************************************************************************/
  1591. // Centered label
  1592. GUIElementStyle centeredLabelStyle;
  1593. centeredLabelStyle.font = defaultFont;
  1594. centeredLabelStyle.fontSize = DefaultFontSize;
  1595. centeredLabelStyle.fixedWidth = false;
  1596. centeredLabelStyle.fixedHeight = true;
  1597. centeredLabelStyle.height = 11;
  1598. centeredLabelStyle.minWidth = 10;
  1599. centeredLabelStyle.textHorzAlign = THA_Center;
  1600. centeredLabelStyle.normal.textColor = TextNormalColor;
  1601. skin->setStyle("LabelCentered", centeredLabelStyle);
  1602. // Right-aligned label
  1603. GUIElementStyle rightAlignedLabelStyle;
  1604. rightAlignedLabelStyle.font = defaultFont;
  1605. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  1606. rightAlignedLabelStyle.fixedWidth = false;
  1607. rightAlignedLabelStyle.fixedHeight = true;
  1608. rightAlignedLabelStyle.height = 11;
  1609. rightAlignedLabelStyle.minWidth = 10;
  1610. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  1611. rightAlignedLabelStyle.normal.textColor = TextNormalColor;
  1612. skin->setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  1613. // Multi-line label
  1614. GUIElementStyle multiLinelabelStyle;
  1615. multiLinelabelStyle.font = defaultFont;
  1616. multiLinelabelStyle.fontSize = DefaultFontSize;
  1617. multiLinelabelStyle.fixedWidth = false;
  1618. multiLinelabelStyle.fixedHeight = true;
  1619. multiLinelabelStyle.height = 11;
  1620. multiLinelabelStyle.minWidth = 10;
  1621. multiLinelabelStyle.wordWrap = true;
  1622. multiLinelabelStyle.normal.textColor = TextNormalColor;
  1623. skin->setStyle(BuiltinResources::MultiLineLabelStyle, multiLinelabelStyle);
  1624. // Multi-line centered label
  1625. GUIElementStyle multiLineCenteredLabelStyle;
  1626. multiLineCenteredLabelStyle.font = defaultFont;
  1627. multiLineCenteredLabelStyle.fontSize = DefaultFontSize;
  1628. multiLineCenteredLabelStyle.fixedWidth = false;
  1629. multiLineCenteredLabelStyle.fixedHeight = true;
  1630. multiLineCenteredLabelStyle.height = 11;
  1631. multiLineCenteredLabelStyle.minWidth = 10;
  1632. multiLineCenteredLabelStyle.wordWrap = true;
  1633. multiLineCenteredLabelStyle.textHorzAlign = THA_Center;
  1634. multiLineCenteredLabelStyle.normal.textColor = TextNormalColor;
  1635. skin->setStyle("MultiLineLabelCentered", multiLineCenteredLabelStyle);
  1636. // Title label
  1637. GUIElementStyle titleLabel;
  1638. titleLabel.font = defaultAAFont;
  1639. titleLabel.fontSize = TitleFontSize;
  1640. titleLabel.fixedWidth = false;
  1641. titleLabel.fixedHeight = true;
  1642. titleLabel.height = 20;
  1643. titleLabel.minWidth = 10;
  1644. titleLabel.wordWrap = true;
  1645. titleLabel.textHorzAlign = THA_Center;
  1646. titleLabel.normal.textColor = TextNormalColor;
  1647. skin->setStyle("TitleLabel", titleLabel);
  1648. // Selection area
  1649. GUIElementStyle selectionAreaStyle;
  1650. selectionAreaStyle.normal.texture = getGUITexture(SelectionAreaTex);
  1651. selectionAreaStyle.border.left = 1;
  1652. selectionAreaStyle.border.right = 1;
  1653. selectionAreaStyle.border.top = 1;
  1654. selectionAreaStyle.border.bottom = 1;
  1655. skin->setStyle("SelectionArea", selectionAreaStyle);
  1656. // Selectable label
  1657. GUIElementStyle selectableLabelStyle;
  1658. selectableLabelStyle.normalOn.texture = getGUITexture(SelectionBgTex);
  1659. selectableLabelStyle.hoverOn.texture = selectableLabelStyle.normalOn.texture;
  1660. selectableLabelStyle.activeOn.texture = selectableLabelStyle.normalOn.texture;
  1661. selectableLabelStyle.fixedHeight = true;
  1662. selectableLabelStyle.height = 11;
  1663. selectableLabelStyle.minWidth = 10;
  1664. selectableLabelStyle.font = defaultFont;
  1665. selectableLabelStyle.fontSize = DefaultFontSize;
  1666. selectableLabelStyle.textHorzAlign = THA_Left;
  1667. selectableLabelStyle.normal.textColor = TextNormalColor;
  1668. skin->setStyle("SelectableLabel", selectableLabelStyle);
  1669. // Scroll area background
  1670. GUIElementStyle scrollAreaBg;
  1671. scrollAreaBg.normal.texture = getGUITexture(ScrollAreaBgTex);
  1672. scrollAreaBg.minHeight = 6;
  1673. scrollAreaBg.minWidth = 4;
  1674. scrollAreaBg.border.left = 2;
  1675. scrollAreaBg.border.right = 2;
  1676. scrollAreaBg.border.top = 2;
  1677. scrollAreaBg.border.bottom = 4;
  1678. skin->setStyle("ScrollAreaBg", scrollAreaBg);
  1679. // Inspector title area background
  1680. GUIElementStyle inspectorTitleBg;
  1681. inspectorTitleBg.normal.texture = getGUITexture(InspectorTitleBgTex);
  1682. inspectorTitleBg.minHeight = 4;
  1683. inspectorTitleBg.border.bottom = 2;
  1684. skin->setStyle("InspectorTitleBg", inspectorTitleBg);
  1685. // Inspector content background
  1686. GUIElementStyle inspectorContentBg;
  1687. inspectorContentBg.normal.texture = getGUITexture(InspectorContentBgTex);
  1688. inspectorContentBg.minWidth = 4;
  1689. inspectorContentBg.minHeight = 6;
  1690. inspectorContentBg.border.left = 2;
  1691. inspectorContentBg.border.right = 2;
  1692. inspectorContentBg.border.top = 2;
  1693. inspectorContentBg.border.bottom = 4;
  1694. skin->setStyle("InspectorContentBg", inspectorContentBg);
  1695. // Inspector content alternate background
  1696. GUIElementStyle inspectorContentBgAlternate;
  1697. inspectorContentBgAlternate.normal.texture = getGUITexture(InspectorContentBgAlternateTex);
  1698. inspectorContentBgAlternate.minWidth = 4;
  1699. inspectorContentBgAlternate.minHeight = 6;
  1700. inspectorContentBgAlternate.border.left = 2;
  1701. inspectorContentBgAlternate.border.right = 2;
  1702. inspectorContentBgAlternate.border.top = 2;
  1703. inspectorContentBgAlternate.border.bottom = 4;
  1704. skin->setStyle("InspectorContentBgAlternate", inspectorContentBgAlternate);
  1705. // Background for multi-element resource entries in the library window
  1706. GUIElementStyle libraryEntryFirstBg;
  1707. libraryEntryFirstBg.normal.texture = getGUITexture(LibraryEntryFirstBgTex);
  1708. libraryEntryFirstBg.minHeight = 7;
  1709. libraryEntryFirstBg.minWidth = 4;
  1710. libraryEntryFirstBg.border.top = 5;
  1711. libraryEntryFirstBg.border.bottom = 2;
  1712. libraryEntryFirstBg.border.left = 2;
  1713. skin->setStyle("LibraryEntryFirstBg", libraryEntryFirstBg);
  1714. GUIElementStyle libraryEntryBg;
  1715. libraryEntryBg.normal.texture = getGUITexture(LibraryEntryBgTex);
  1716. libraryEntryBg.minHeight = 7;
  1717. libraryEntryBg.minWidth = 4;
  1718. libraryEntryBg.border.top = 5;
  1719. libraryEntryBg.border.bottom = 2;
  1720. skin->setStyle("LibraryEntryBg", libraryEntryBg);
  1721. GUIElementStyle libraryEntryLastBg;
  1722. libraryEntryLastBg.normal.texture = getGUITexture(LibraryEntryLastBgTex);
  1723. libraryEntryLastBg.minHeight = 7;
  1724. libraryEntryFirstBg.minWidth = 4;
  1725. libraryEntryLastBg.border.top = 5;
  1726. libraryEntryLastBg.border.bottom = 2;
  1727. libraryEntryLastBg.border.right = 2;
  1728. skin->setStyle("LibraryEntryLastBg", libraryEntryLastBg);
  1729. GUIElementStyle libraryEntryVertFirstBg;
  1730. libraryEntryVertFirstBg.normal.texture = getGUITexture(LibraryEntryVertFirstBgTex);
  1731. libraryEntryVertFirstBg.minHeight = 5;
  1732. libraryEntryVertFirstBg.minWidth = 6;
  1733. libraryEntryVertFirstBg.border.top = 4;
  1734. libraryEntryVertFirstBg.border.left = 2;
  1735. libraryEntryVertFirstBg.border.right = 4;
  1736. skin->setStyle("LibraryEntryVertFirstBg", libraryEntryVertFirstBg);
  1737. GUIElementStyle libraryEntryVertBg;
  1738. libraryEntryVertBg.normal.texture = getGUITexture(LibraryEntryVertBgTex);
  1739. libraryEntryVertBg.minHeight = 4;
  1740. libraryEntryVertBg.minWidth = 6;
  1741. libraryEntryVertBg.border.left = 2;
  1742. libraryEntryVertBg.border.right = 4;
  1743. skin->setStyle("LibraryEntryVertBg", libraryEntryVertBg);
  1744. GUIElementStyle libraryEntryVertLastBg;
  1745. libraryEntryVertLastBg.normal.texture = getGUITexture(LibraryEntryVertLastBgTex);
  1746. libraryEntryVertLastBg.minHeight = 4;
  1747. libraryEntryVertLastBg.minWidth = 6;
  1748. libraryEntryVertLastBg.border.bottom = 2;
  1749. libraryEntryVertLastBg.border.left = 2;
  1750. libraryEntryVertLastBg.border.right = 4;
  1751. skin->setStyle("LibraryEntryVertLastBg", libraryEntryVertLastBg);
  1752. GUIElementStyle canvas;
  1753. skin->setStyle("Canvas", canvas);
  1754. return skin;
  1755. }
  1756. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name) const
  1757. {
  1758. Path texturePath = EditorSkinSpritesFolder;
  1759. texturePath.append(L"sprite_" + name + L".asset");
  1760. return gResources().load<SpriteTexture>(texturePath);
  1761. }
  1762. HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name) const
  1763. {
  1764. Path texturePath = EditorIconSpritesFolder;
  1765. texturePath.append(L"sprite_" + name + L".asset");
  1766. return gResources().load<SpriteTexture>(texturePath);
  1767. }
  1768. HShader BuiltinEditorResources::getShader(const WString& name) const
  1769. {
  1770. Path programPath = EditorShaderFolder;
  1771. programPath.append(name + L".asset");
  1772. HShader shader = gResources().load<Shader>(programPath);
  1773. #if BS_DEBUG_MODE
  1774. BuiltinResourcesHelper::verifyAndReportShader(shader);
  1775. #endif
  1776. return shader;
  1777. }
  1778. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1779. {
  1780. return Material::create(mShaderDockOverlay);
  1781. }
  1782. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1783. {
  1784. return Material::create(mShaderSceneGrid);
  1785. }
  1786. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1787. {
  1788. UINT32 modeIdx = (UINT32)cullMode;
  1789. return Material::create(mShaderPicking[modeIdx]);
  1790. }
  1791. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1792. {
  1793. UINT32 modeIdx = (UINT32)cullMode;
  1794. return Material::create(mShaderPickingAlpha[modeIdx]);
  1795. }
  1796. HMaterial BuiltinEditorResources::createLineGizmoMat() const
  1797. {
  1798. return Material::create(mShaderGizmoLine);
  1799. }
  1800. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1801. {
  1802. return Material::create(mShaderGizmoSolid);
  1803. }
  1804. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1805. {
  1806. return Material::create(mShaderGizmoWire);
  1807. }
  1808. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1809. {
  1810. return Material::create(mShaderGizmoIcon);
  1811. }
  1812. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1813. {
  1814. return Material::create(mShaderGizmoPicking);
  1815. }
  1816. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1817. {
  1818. return Material::create(mShaderGizmoAlphaPicking);
  1819. }
  1820. HMaterial BuiltinEditorResources::createLineHandleMat() const
  1821. {
  1822. return Material::create(mShaderHandleLine);
  1823. }
  1824. HMaterial BuiltinEditorResources::createTextGizmoMat() const
  1825. {
  1826. return Material::create(mShaderGizmoText);
  1827. }
  1828. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1829. {
  1830. return Material::create(mShaderHandleSolid);
  1831. }
  1832. HMaterial BuiltinEditorResources::createHandleClearAlphaMat() const
  1833. {
  1834. return Material::create(mShaderHandleClearAlpha);
  1835. }
  1836. HMaterial BuiltinEditorResources::createSelectionMat() const
  1837. {
  1838. return Material::create(mShaderSelection);
  1839. }
  1840. HSpriteTexture BuiltinEditorResources::getLibraryIcon(ProjectIcon icon, int size) const
  1841. {
  1842. WString iconName;
  1843. switch (icon)
  1844. {
  1845. case ProjectIcon::Folder:
  1846. iconName = FolderIconTex;
  1847. break;
  1848. case ProjectIcon::Font:
  1849. iconName = FontIconTex;
  1850. break;
  1851. case ProjectIcon::Mesh:
  1852. iconName = MeshIconTex;
  1853. break;
  1854. case ProjectIcon::Texture:
  1855. iconName = TextureIconTex;
  1856. break;
  1857. case ProjectIcon::PlainText:
  1858. iconName = PlainTextIconTex;
  1859. break;
  1860. case ProjectIcon::ScriptCode:
  1861. iconName = ScriptCodeIconTex;
  1862. break;
  1863. case ProjectIcon::Shader:
  1864. iconName = ShaderIconTex;
  1865. break;
  1866. case ProjectIcon::ShaderInclude:
  1867. iconName = ShaderIncludeIconTex;
  1868. break;
  1869. case ProjectIcon::Material:
  1870. iconName = MaterialIconTex;
  1871. break;
  1872. case ProjectIcon::SpriteTexture:
  1873. iconName = SpriteTextureIconTex;
  1874. break;
  1875. case ProjectIcon::Prefab:
  1876. iconName = PrefabIconTex;
  1877. break;
  1878. case ProjectIcon::GUISkin:
  1879. iconName = GUISkinIconTex;
  1880. break;
  1881. case ProjectIcon::PhysicsMaterial:
  1882. iconName = PhysicsMaterialIconTex;
  1883. break;
  1884. case ProjectIcon::PhysicsMesh:
  1885. iconName = PhysicsMeshIconTex;
  1886. break;
  1887. case ProjectIcon::AudioClip:
  1888. iconName = AudioClipIconTex;
  1889. break;
  1890. case ProjectIcon::AnimationClip:
  1891. iconName = AnimationClipIconTex;
  1892. break;
  1893. }
  1894. if (iconName.empty())
  1895. return HSpriteTexture();
  1896. if (size <= 16)
  1897. iconName += L"16";
  1898. else if (size <= 32)
  1899. iconName += L"32";
  1900. else if (size <= 48)
  1901. iconName += L"48";
  1902. return getGUIIcon(iconName);
  1903. }
  1904. HSpriteTexture BuiltinEditorResources::getToolbarIcon(ToolbarIcon icon) const
  1905. {
  1906. switch (icon)
  1907. {
  1908. case ToolbarIcon::NewCamera:
  1909. return getGUIIcon(L"ToolbarNewCameraIcon.png");
  1910. case ToolbarIcon::NewRenderable:
  1911. return getGUIIcon(L"ToolbarNewRenderableIcon.png");
  1912. case ToolbarIcon::NewPointLight:
  1913. return getGUIIcon(L"ToolbarNewPointLightIcon.png");
  1914. case ToolbarIcon::NewDirLight:
  1915. return getGUIIcon(L"ToolbarNewDirectionalLightIcon.png");
  1916. case ToolbarIcon::NewSpotLight:
  1917. return getGUIIcon(L"ToolbarNewSpotLightIcon.png");
  1918. case ToolbarIcon::NewSceneObject:
  1919. return getGUIIcon(L"ToolbarNewSceneObjectIcon.png");
  1920. case ToolbarIcon::NewCube:
  1921. return getGUIIcon(L"ToolbarNewCubeIcon.png");
  1922. case ToolbarIcon::NewSphere:
  1923. return getGUIIcon(L"ToolbarNewSphereIcon.png");
  1924. case ToolbarIcon::NewCone:
  1925. return getGUIIcon(L"ToolbarNewConeIcon.png");
  1926. case ToolbarIcon::NewQuad:
  1927. return getGUIIcon(L"ToolbarNewQuadIcon.png");
  1928. case ToolbarIcon::NewMat:
  1929. return getGUIIcon(L"ToolbarNewMaterialIcon.png");
  1930. case ToolbarIcon::NewCSScript:
  1931. return getGUIIcon(L"ToolbarNewCSScriptIcon.png");
  1932. case ToolbarIcon::NewShader:
  1933. return getGUIIcon(L"ToolbarNewShaderIcon.png");
  1934. case ToolbarIcon::NewSpriteTex:
  1935. return getGUIIcon(L"ToolbarNewSpriteTextureIcon.png");
  1936. case ToolbarIcon::Pause:
  1937. return getGUIIcon(L"ToolbarPauseIcon.png");
  1938. case ToolbarIcon::Play:
  1939. return getGUIIcon(L"ToolbarPlayIcon.png");
  1940. case ToolbarIcon::Step:
  1941. return getGUIIcon(L"ToolbarStepIcon.png");
  1942. case ToolbarIcon::Undo:
  1943. return getGUIIcon(L"ToolbarUndoIcon.png");
  1944. case ToolbarIcon::Redo:
  1945. return getGUIIcon(L"ToolbarRedoIcon.png");
  1946. case ToolbarIcon::OpenProject:
  1947. return getGUIIcon(L"ToolbarOpenProjectIcon.png");
  1948. case ToolbarIcon::SaveProject:
  1949. return getGUIIcon(L"ToolbarSaveProjectIcon.png");
  1950. case ToolbarIcon::SaveScene:
  1951. return getGUIIcon(L"ToolbarSaveSceneIcon.png");
  1952. }
  1953. return HSpriteTexture();
  1954. }
  1955. GUIContentImages BuiltinEditorResources::getSceneWindowIcon(SceneWindowIcon icon) const
  1956. {
  1957. HSpriteTexture off;
  1958. HSpriteTexture on;
  1959. switch (icon)
  1960. {
  1961. case SceneWindowIcon::View:
  1962. off = getGUIIcon(L"SceneViewIcon.png");
  1963. on = getGUIIcon(L"SceneViewIconOn.png");
  1964. break;
  1965. case SceneWindowIcon::Move:
  1966. off = getGUIIcon(L"SceneMoveIcon.png");
  1967. on = getGUIIcon(L"SceneMoveIconOn.png");
  1968. break;
  1969. case SceneWindowIcon::Rotate:
  1970. off = getGUIIcon(L"SceneRotateIcon.png");
  1971. on = getGUIIcon(L"SceneRotateIconOn.png");
  1972. break;
  1973. case SceneWindowIcon::Scale:
  1974. off = getGUIIcon(L"SceneScaleIcon.png");
  1975. on = getGUIIcon(L"SceneScaleIconOn.png");
  1976. break;
  1977. case SceneWindowIcon::Pivot:
  1978. off = getGUIIcon(L"ScenePivotIcon.png");
  1979. on = getGUIIcon(L"ScenePivotIconOn.png");
  1980. break;
  1981. case SceneWindowIcon::Center:
  1982. off = getGUIIcon(L"SceneCenterIcon.png");
  1983. on = getGUIIcon(L"SceneCenterIconOn.png");
  1984. break;
  1985. case SceneWindowIcon::Local:
  1986. off = getGUIIcon(L"SceneLocalIcon.png");
  1987. on = getGUIIcon(L"SceneLocalIconOn.png");
  1988. break;
  1989. case SceneWindowIcon::World:
  1990. off = getGUIIcon(L"SceneWorldIcon.png");
  1991. on = getGUIIcon(L"SceneWorldIconOn.png");
  1992. break;
  1993. case SceneWindowIcon::MoveSnap:
  1994. off = getGUIIcon(L"SceneMoveSnapIcon.png");
  1995. on = getGUIIcon(L"SceneMoveSnapIconOn.png");
  1996. break;
  1997. case SceneWindowIcon::RotateSnap:
  1998. off = getGUIIcon(L"SceneRotateSnapIcon.png");
  1999. on = getGUIIcon(L"SceneRotateSnapIconOn.png");
  2000. break;
  2001. }
  2002. GUIContentImages output;
  2003. output.normal = off;
  2004. output.hover = off;
  2005. output.active = on;
  2006. output.focused = off;
  2007. output.normalOn = on;
  2008. output.hoverOn = on;
  2009. output.activeOn = on;
  2010. output.focusedOn = on;
  2011. return output;
  2012. }
  2013. HSpriteTexture BuiltinEditorResources::getLibraryWindowIcon(LibraryWindowIcon icon) const
  2014. {
  2015. switch (icon)
  2016. {
  2017. case LibraryWindowIcon::Home:
  2018. return getGUIIcon(L"LibraryHomeIcon.png");
  2019. case LibraryWindowIcon::Up:
  2020. return getGUIIcon(L"LibraryUpIcon.png");
  2021. case LibraryWindowIcon::Clear:
  2022. return getGUIIcon(L"LibraryClearSearchIcon.png");
  2023. case LibraryWindowIcon::Options:
  2024. return getGUIIcon(L"LibraryOptionsIcon.png");
  2025. }
  2026. return HSpriteTexture();
  2027. }
  2028. HSpriteTexture BuiltinEditorResources::getInspectorWindowIcon(InspectorWindowIcon icon) const
  2029. {
  2030. switch (icon)
  2031. {
  2032. case InspectorWindowIcon::Create:
  2033. return getGUIIcon(L"InspectorCreateIcon.png");
  2034. case InspectorWindowIcon::Clone:
  2035. return getGUIIcon(L"InspectorCloneIcon.png");
  2036. case InspectorWindowIcon::Clear:
  2037. return getGUIIcon(L"InspectorClearIcon.png");
  2038. case InspectorWindowIcon::Resize:
  2039. return getGUIIcon(L"InspectorResizeIcon.png");
  2040. case InspectorWindowIcon::Delete:
  2041. return getGUIIcon(L"InspectorDeleteIcon.png");
  2042. case InspectorWindowIcon::MoveUp:
  2043. return getGUIIcon(L"InspectorMoveUpIcon.png");
  2044. case InspectorWindowIcon::MoveDown:
  2045. return getGUIIcon(L"InspectorMoveDownIcon.png");
  2046. case InspectorWindowIcon::Edit:
  2047. return getGUIIcon(L"InspectorEditIcon.png");
  2048. case InspectorWindowIcon::Apply:
  2049. return getGUIIcon(L"InspectorApplyIcon.png");
  2050. case InspectorWindowIcon::Add:
  2051. return getGUIIcon(L"InspectorAddIcon.png");
  2052. case InspectorWindowIcon::Cancel:
  2053. return getGUIIcon(L"InspectorCancelIcon.png");
  2054. }
  2055. return HSpriteTexture();
  2056. }
  2057. GUIContentImages BuiltinEditorResources::getAnimationWindowIcon(AnimationWindowIcon icon) const
  2058. {
  2059. HSpriteTexture off;
  2060. HSpriteTexture on;
  2061. switch (icon)
  2062. {
  2063. case AnimationWindowIcon::Play:
  2064. off = getGUIIcon(L"AnimationPlayIcon.png");
  2065. on = getGUIIcon(L"AnimationPlayIconOn.png");
  2066. break;
  2067. case AnimationWindowIcon::Record:
  2068. off = getGUIIcon(L"AnimationRecordIcon.png");
  2069. on = getGUIIcon(L"AnimationRecordIconOn.png");
  2070. break;
  2071. case AnimationWindowIcon::FrameForward:
  2072. off = getGUIIcon(L"AnimationFrameForwardIcon.png");
  2073. on = getGUIIcon(L"AnimationFrameForwardIconOn.png");
  2074. break;
  2075. case AnimationWindowIcon::FrameBack:
  2076. off = getGUIIcon(L"AnimationFrameBackIcon.png");
  2077. on = getGUIIcon(L"AnimationFrameBackIconOn.png");
  2078. break;
  2079. case AnimationWindowIcon::AddEvent:
  2080. off = getGUIIcon(L"AnimationAddEventIcon.png");
  2081. on = getGUIIcon(L"AnimationAddEventIconOn.png");
  2082. break;
  2083. case AnimationWindowIcon::AddKeyframe:
  2084. off = getGUIIcon(L"AnimationAddKeyframeIcon.png");
  2085. on = getGUIIcon(L"AnimationAddKeyframeIconOn.png");
  2086. break;
  2087. case AnimationWindowIcon::Event:
  2088. off = getGUIIcon(L"AnimationEventIcon.png");
  2089. on = off;
  2090. break;
  2091. case AnimationWindowIcon::Keyframe:
  2092. off = getGUIIcon(L"AnimationKeyframeIcon.png");
  2093. on = off;
  2094. break;
  2095. }
  2096. GUIContentImages output;
  2097. output.normal = off;
  2098. output.hover = off;
  2099. output.active = on;
  2100. output.focused = off;
  2101. output.normalOn = on;
  2102. output.hoverOn = on;
  2103. output.activeOn = on;
  2104. output.focusedOn = on;
  2105. return output;
  2106. }
  2107. HSpriteTexture BuiltinEditorResources::getIcon(EditorIcon icon) const
  2108. {
  2109. switch (icon)
  2110. {
  2111. case EditorIcon::X:
  2112. return getGUIIcon(XButtonNormalTex);
  2113. case EditorIcon::Component:
  2114. return getGUIIcon(L"IconComponent.png");
  2115. case EditorIcon::SceneObject:
  2116. return getGUIIcon(L"IconSceneObject.png");
  2117. }
  2118. return HSpriteTexture();
  2119. }
  2120. HSpriteTexture BuiltinEditorResources::getLogMessageIcon(LogMessageIcon icon, UINT32 size, bool dark) const
  2121. {
  2122. if (size < 24) // Round to 16
  2123. {
  2124. if (dark)
  2125. {
  2126. switch (icon)
  2127. {
  2128. case LogMessageIcon::Info:
  2129. return getGUIIcon(L"IconInfoDark.png");
  2130. case LogMessageIcon::Warning:
  2131. return getGUIIcon(L"IconWarningDark.png");
  2132. case LogMessageIcon::Error:
  2133. return getGUIIcon(L"IconErrorDark.png");
  2134. }
  2135. }
  2136. else
  2137. {
  2138. switch (icon)
  2139. {
  2140. case LogMessageIcon::Info:
  2141. return getGUIIcon(L"IconInfo.png");
  2142. case LogMessageIcon::Warning:
  2143. return getGUIIcon(L"IconWarning.png");
  2144. case LogMessageIcon::Error:
  2145. return getGUIIcon(L"IconError.png");
  2146. }
  2147. }
  2148. }
  2149. else // Round to 32
  2150. {
  2151. switch (icon)
  2152. {
  2153. case LogMessageIcon::Info:
  2154. return getGUIIcon(L"IconInfo32.png");
  2155. case LogMessageIcon::Warning:
  2156. return getGUIIcon(L"IconWarning32.png");
  2157. case LogMessageIcon::Error:
  2158. return getGUIIcon(L"IconError32.png");
  2159. }
  2160. }
  2161. return HSpriteTexture();
  2162. }
  2163. WString BuiltinEditorResources::getEmptyShaderCode() const
  2164. {
  2165. Path filePath = BuiltinDataFolder;
  2166. filePath.append(EmptyShaderCodeFile);
  2167. SPtr<DataStream> fileStream = FileSystem::openFile(filePath);
  2168. if (fileStream != nullptr)
  2169. return fileStream->getAsWString();
  2170. return StringUtil::WBLANK;
  2171. }
  2172. WString BuiltinEditorResources::getEmptyCSScriptCode() const
  2173. {
  2174. Path filePath = BuiltinDataFolder;
  2175. filePath.append(EmptyCSScriptCodeFile);
  2176. SPtr<DataStream> fileStream = FileSystem::openFile(filePath);
  2177. if (fileStream != nullptr)
  2178. return fileStream->getAsWString();
  2179. return StringUtil::WBLANK;
  2180. }
  2181. Path BuiltinEditorResources::getShaderIncludeFolder()
  2182. {
  2183. return Paths::getRuntimeDataPath() + EDITOR_DATA_FOLDER + ShaderIncludeFolder;
  2184. }
  2185. Path BuiltinEditorResources::getDefaultWidgetLayoutPath()
  2186. {
  2187. return Paths::getRuntimeDataPath() + EDITOR_DATA_FOLDER + "Layout.asset";
  2188. }
  2189. }