BsBuiltinEditorResources.cpp 110 KB

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