BsBuiltinEditorResources.cpp 94 KB

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