BsBuiltinEditorResources.cpp 99 KB

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