BsBuiltinEditorResources.cpp 109 KB

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