BsBuiltinEditorResources.cpp 110 KB

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