BsBuiltinEditorResources.cpp 94 KB

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