BsBuiltinEditorResources.cpp 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855
  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 "BsGUIComponentFoldout.h"
  22. #include "BsGUIFoldout.h"
  23. #include "BsGUIProgressBar.h"
  24. #include "BsGUISlider.h"
  25. #include "BsGUIDropDownContent.h"
  26. #include "BsGUIStatusBar.h"
  27. #include "BsGUIMenuBar.h"
  28. #include "BsFont.h"
  29. #include "BsFontImportOptions.h"
  30. #include "BsImporter.h"
  31. #include "BsGpuProgram.h"
  32. #include "BsShader.h"
  33. #include "BsShaderInclude.h"
  34. #include "BsTechnique.h"
  35. #include "BsPass.h"
  36. #include "BsMaterial.h"
  37. #include "BsBlendState.h"
  38. #include "BsDepthStencilState.h"
  39. #include "BsRasterizerState.h"
  40. #include "BsResources.h"
  41. #include "BsRTTIType.h"
  42. #include "BsFileSystem.h"
  43. #include "BsResourceManifest.h"
  44. namespace BansheeEngine
  45. {
  46. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  47. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  48. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  49. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  50. const String BuiltinEditorResources::TextureFieldStyleName = "GUITextureField";
  51. const String BuiltinEditorResources::TextureFieldLabelStyleName = "TextureFieldLabel";
  52. const String BuiltinEditorResources::TextureFieldDropStyleName = "TextureDrop";
  53. const String BuiltinEditorResources::TextureFieldClearBtnStyleName = "TextureClearButton";
  54. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  55. const UINT32 BuiltinEditorResources::DefaultFontSize = 11;
  56. const Color BuiltinEditorResources::TextNormalColor = Color(0.7f, 0.7f, 0.7f);
  57. const Color BuiltinEditorResources::TextActiveColor = Color(0.0f, 0.0f, 0.0f);
  58. const WString BuiltinEditorResources::GUISkinFile = L"GUISkin";
  59. const Path BuiltinEditorResources::ShaderFolder = L"Shaders\\";
  60. const Path BuiltinEditorResources::SkinFolder = L"Skin\\";
  61. const Path BuiltinEditorResources::IconFolder = L"Skin\\Icons";
  62. const Path BuiltinEditorResources::ShaderIncludeFolder = L"Includes\\";
  63. const Path BuiltinEditorResources::BuiltinRawDataFolder = RUNTIME_DATA_PATH + L"Raw\\Editor\\";
  64. const Path BuiltinEditorResources::EditorRawSkinFolder = BuiltinRawDataFolder + SkinFolder;
  65. const Path BuiltinEditorResources::EditorRawShaderFolder = BuiltinRawDataFolder + ShaderFolder;
  66. const Path BuiltinEditorResources::EditorRawShaderIncludeFolder = BuiltinRawDataFolder + ShaderIncludeFolder;
  67. const Path BuiltinEditorResources::BuiltinDataFolder = RUNTIME_DATA_PATH + L"Editor\\";
  68. const Path BuiltinEditorResources::EditorSkinFolder = BuiltinDataFolder + SkinFolder;
  69. const Path BuiltinEditorResources::EditorIconFolder = BuiltinDataFolder + IconFolder;
  70. const Path BuiltinEditorResources::EditorShaderFolder = BuiltinDataFolder + ShaderFolder;
  71. const Path BuiltinEditorResources::EditorShaderIncludeFolder = BuiltinDataFolder + ShaderIncludeFolder;
  72. const Path BuiltinEditorResources::ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
  73. const Path BuiltinEditorResources::DefaultWidgetLayoutPath = BuiltinDataFolder + "Layout.asset";
  74. const WString BuiltinEditorResources::FolderIconTex = L"FolderIcon.psd";
  75. const WString BuiltinEditorResources::MeshIconTex = L"MeshIcon.psd";
  76. const WString BuiltinEditorResources::TextureIconTex = L"TextureIcon.psd";
  77. const WString BuiltinEditorResources::FontIconTex = L"FontIcon.psd";
  78. const WString BuiltinEditorResources::PlainTextIconTex = L"TextIcon.psd";
  79. const WString BuiltinEditorResources::ScriptCodeIconTex = L"CSharpIcon.psd";
  80. const WString BuiltinEditorResources::ShaderIconTex = L"ShaderIcon.psd";
  81. const WString BuiltinEditorResources::ShaderIncludeIconTex = L"ShaderIncludeIcon.psd";
  82. const WString BuiltinEditorResources::MaterialIconTex = L"MaterialIcon.psd";
  83. const WString BuiltinEditorResources::SpriteTextureIconTex = L"SpriteIcon.psd";
  84. const WString BuiltinEditorResources::PrefabIconTex = L"PrefabIcon.psd";
  85. const WString BuiltinEditorResources::LogInfoIconTex = L"IconInfo.psd";
  86. const WString BuiltinEditorResources::LogWarningIconTex = L"IconWarning.psd";
  87. const WString BuiltinEditorResources::LogErrorIconTex = L"IconError.psd";
  88. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.png";
  89. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.png";
  90. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.png";
  91. const WString BuiltinEditorResources::ButtonLeftNormalTex = L"ButtonLeftNormal.png";
  92. const WString BuiltinEditorResources::ButtonLeftHoverTex = L"ButtonLeftHover.png";
  93. const WString BuiltinEditorResources::ButtonLeftActiveTex = L"ButtonLeftActive.png";
  94. const WString BuiltinEditorResources::ButtonRightNormalTex = L"ButtonRightNormal.png";
  95. const WString BuiltinEditorResources::ButtonRightHoverTex = L"ButtonRightHover.png";
  96. const WString BuiltinEditorResources::ButtonRightActiveTex = L"ButtonRightActive.png";
  97. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.png";
  98. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.png";
  99. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleNormalOn.png";
  100. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleHoverOn.png";
  101. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.png";
  102. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.png";
  103. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxActive.png";
  104. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectDropNormal.png";
  105. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectDropNormalOn.png";
  106. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectDropClearNormal.png";
  107. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectDropClearHover.png";
  108. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectDropClearActive.png";
  109. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownButtonNormal.png";
  110. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownButtonHover.png";
  111. const WString BuiltinEditorResources::DropDownBtnActiveTex = L"DropDownButtonActive.png";
  112. const WString BuiltinEditorResources::SliderHBackgroundTex = L"SliderHBackground.png";
  113. const WString BuiltinEditorResources::SliderHFillTex = L"SliderHFill.png";
  114. const WString BuiltinEditorResources::SliderVBackgroundTex = L"SliderVBackground.png";
  115. const WString BuiltinEditorResources::SliderVFillTex = L"SliderVFill.png";
  116. const WString BuiltinEditorResources::SliderHandleNormalTex = L"SliderHandleNormal.png";
  117. const WString BuiltinEditorResources::SliderHandleHoverTex = L"SliderHandleHover.png";
  118. const WString BuiltinEditorResources::SliderHandleActiveTex = L"SliderHandleActive.png";
  119. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutOpenNormal.psd";
  120. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutOpenHover.psd";
  121. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutClosedNormal.psd";
  122. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutClosedHover.psd";
  123. const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"CmpFoldoutOpenNormal.psd";
  124. const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"CmpFoldoutOpenHover.psd";
  125. const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"CmpFoldoutOpenActive.psd";
  126. const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"CmpFoldoutClosedNormal.psd";
  127. const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"CmpFoldoutClosedHover.psd";
  128. const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"CmpFoldoutClosedActive.psd";
  129. const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
  130. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.png";
  131. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.png";
  132. const WString BuiltinEditorResources::CloseButtonNormalTex = L"CloseButtonNormal.png";
  133. const WString BuiltinEditorResources::CloseButtonHoverTex = L"CloseButtonHover.png";
  134. const WString BuiltinEditorResources::CloseButtonActiveTex = L"CloseButtonActive.png";
  135. const WString BuiltinEditorResources::MinButtonNormalTex = L"MinimizeButtonNormal.png";
  136. const WString BuiltinEditorResources::MinButtonHoverTex = L"MinimizeButtonHover.png";
  137. const WString BuiltinEditorResources::MinButtonActiveTex = L"MinimizeButtonActive.png";
  138. const WString BuiltinEditorResources::MaxButtonNormalTex = L"MaximizeButtonNormal.png";
  139. const WString BuiltinEditorResources::MaxButtonHoverTex = L"MaximizeButtonHover.png";
  140. const WString BuiltinEditorResources::MaxButtonActiveTex = L"MaximizeButtonActive.png";
  141. const WString BuiltinEditorResources::TabBarBackgroundTex = L"TabBarBackground.png";
  142. const WString BuiltinEditorResources::TitleBarBackgroundTex = L"TitleBarBackground.png";
  143. const WString BuiltinEditorResources::TabButtonNormalTex = L"TabButtonNormal.png";
  144. const WString BuiltinEditorResources::TabButtonFocusedTex = L"TabButtonFocused.png";
  145. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollArrowUpNormal.png";
  146. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollArrowUpHover.png";
  147. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollArrowUpActive.png";
  148. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollArrowDownNormal.png";
  149. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollArrowDownHover.png";
  150. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollArrowDownActive.png";
  151. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollArrowLeftNormal.png";
  152. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollArrowLeftHover.png";
  153. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollArrowLeftActive.png";
  154. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollArrowRightNormal.png";
  155. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollArrowRightHover.png";
  156. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollArrowRightActive.png";
  157. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHHandleNormal.png";
  158. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHHandleHover.png";
  159. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHHandleActive.png";
  160. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVHandleNormal.png";
  161. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVHandleHover.png";
  162. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVHandleActive.png";
  163. const WString BuiltinEditorResources::ScrollBarHBgTex = L"ScrollBarHBackground.png";
  164. const WString BuiltinEditorResources::ScrollBarVBgTex = L"ScrollBarVBackground.png";
  165. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.psd";
  166. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownButtonNormal.psd";
  167. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownButtonHover.psd";
  168. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxBtnUpNormal.psd";
  169. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxBtnUpHover.psd";
  170. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxBtnDownNormal.psd";
  171. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxBtnDownHover.psd";
  172. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownExpNormal.psd";
  173. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownExpHover.psd";
  174. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownSeparator.psd";
  175. const WString BuiltinEditorResources::DropDownBoxBtnUpArrowTex = L"DropDownBoxBtnUpArrow.psd";
  176. const WString BuiltinEditorResources::DropDownBoxBtnDownArrowTex = L"DropDownBoxBtnDownArrow.psd";
  177. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBackground.png";
  178. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarLog.png";
  179. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.png";
  180. const WString BuiltinEditorResources::MenuBarBtnActiveTex = L"MenuBarButtonActive.png";
  181. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.png";
  182. const WString BuiltinEditorResources::MenuBarLineNormalTex = L"MenuBarLineNormal.png";
  183. const WString BuiltinEditorResources::MenuBarLineActiveTex = L"MenuBarLineActive.png";
  184. const WString BuiltinEditorResources::ToolBarBtnNormalTex = L"ToolBarButtonNormal.png";
  185. const WString BuiltinEditorResources::ToolBarBtnHoverTex = L"ToolBarButtonNormal.png";
  186. const WString BuiltinEditorResources::ToolBarBtnActiveTex = L"ToolBarButtonNormal.png";
  187. const WString BuiltinEditorResources::ToolBarSeparatorTex = L"ToolBarSeparator.png";
  188. const WString BuiltinEditorResources::DockSliderNormalTex = L"DockSliderNormal.png";
  189. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"TreeViewExpandButtonOffNormal.psd";
  190. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"TreeViewExpandButtonOffHover.psd";
  191. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"TreeViewExpandButtonOnNormal.psd";
  192. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
  193. const WString BuiltinEditorResources::TreeViewHighlightBackground = L"TreeViewHighlightBackground.psd";
  194. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  195. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  196. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  197. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  198. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  199. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  200. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.png";
  201. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.png";
  202. const WString BuiltinEditorResources::SelectionAreaTex = L"SelectionHighlight.png";
  203. const WString BuiltinEditorResources::SelectionBgTex = L"SelectionBg.psd";
  204. const WString BuiltinEditorResources::TextureDropTex = L"TextureDrop.psd";
  205. const WString BuiltinEditorResources::TextureDropOnTex = L"TextureDropOn.psd";
  206. const WString BuiltinEditorResources::XButtonNormalTex = L"XBtnNormal.psd";
  207. const WString BuiltinEditorResources::XButtonHoverTex = L"XBtnHover.psd";
  208. const WString BuiltinEditorResources::StatusBarBgTex = L"StatusBarBackground.png";
  209. const WString BuiltinEditorResources::ScrollAreaBgTex = L"ScrollAreaBg.png";
  210. /************************************************************************/
  211. /* SHADERS */
  212. /************************************************************************/
  213. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  214. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  215. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  216. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  217. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  218. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  219. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  220. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  221. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  222. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  223. const WString BuiltinEditorResources::ShaderWireHandleFile = L"WireHandle.bsl";
  224. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  225. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  226. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  227. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  228. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  229. BuiltinEditorResources::BuiltinEditorResources()
  230. {
  231. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  232. absoluteDataPath.append(BuiltinDataFolder);
  233. #if BS_DEBUG_MODE
  234. if (BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder, BuiltinDataFolder + L"Timestamp.asset"))
  235. {
  236. mResourceManifest = ResourceManifest::create("BuiltinResources");
  237. gResources().registerResourceManifest(mResourceManifest);
  238. preprocess();
  239. BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
  240. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  241. absoluteDataPath.append(BuiltinDataFolder);
  242. ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
  243. }
  244. #endif
  245. if (mResourceManifest == nullptr)
  246. {
  247. if (FileSystem::exists(ResourceManifestPath))
  248. mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
  249. if (mResourceManifest == nullptr)
  250. mResourceManifest = ResourceManifest::create("BuiltinResources");
  251. gResources().registerResourceManifest(mResourceManifest);
  252. }
  253. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  254. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  255. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  256. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  257. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  258. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  259. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  260. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  261. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  262. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  263. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  264. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  265. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  266. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  267. mShaderHandleWire = getShader(ShaderWireHandleFile);
  268. mShaderSelection = getShader(ShaderSelectionFile);
  269. mSkin = gResources().load<GUISkin>(BuiltinDataFolder + (GUISkinFile + L".asset"));
  270. }
  271. BuiltinEditorResources::~BuiltinEditorResources()
  272. { }
  273. void BuiltinEditorResources::preprocess()
  274. {
  275. FileSystem::remove(EditorShaderIncludeFolder);
  276. FileSystem::remove(EditorShaderFolder);
  277. FileSystem::remove(EditorSkinFolder);
  278. BuiltinResourcesHelper::importAssets(EditorRawShaderIncludeFolder, EditorShaderIncludeFolder, mResourceManifest); // Hidden dependency: Includes must be imported before shaders
  279. BuiltinResourcesHelper::importAssets(EditorRawShaderFolder, EditorShaderFolder, mResourceManifest);
  280. BuiltinResourcesHelper::importAssets(EditorRawSkinFolder, EditorSkinFolder, mResourceManifest);
  281. // Import font
  282. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, BuiltinDataFolder, DefaultFontSize, false, mResourceManifest);
  283. // Generate & save GUI sprite textures
  284. BuiltinResourcesHelper::generateSpriteTextures(EditorSkinFolder, mResourceManifest);
  285. // Generate & save GUI skin
  286. {
  287. HGUISkin skin = generateGUISkin();
  288. Path outputPath = FileSystem::getWorkingDirectoryPath() + BuiltinDataFolder + (GUISkinFile + L".asset");
  289. Resources::instance().save(skin, outputPath, true);
  290. mResourceManifest->registerResource(skin.getUUID(), outputPath);
  291. }
  292. Resources::instance().unloadAllUnused();
  293. }
  294. HGUISkin BuiltinEditorResources::generateGUISkin()
  295. {
  296. HGUISkin skin = GUISkin::create();
  297. Path fontPath = FileSystem::getWorkingDirectoryPath();
  298. fontPath.append(BuiltinDataFolder);
  299. fontPath.append(DefaultFontFilename + L".asset");
  300. HFont font = Resources::instance().load<Font>(fontPath);
  301. // Blank entry
  302. GUIElementStyle blankStyle;
  303. skin->setStyle("Blank", blankStyle);
  304. skin->setStyle(GUITexture::getGUITypeName(), blankStyle);
  305. // Label
  306. GUIElementStyle labelStyle;
  307. labelStyle.font = font;
  308. labelStyle.fontSize = DefaultFontSize;
  309. labelStyle.fixedWidth = false;
  310. labelStyle.fixedHeight = true;
  311. labelStyle.height = 14;
  312. labelStyle.minWidth = 10;
  313. labelStyle.normal.textColor = TextNormalColor;
  314. skin->setStyle(GUILabel::getGUITypeName(), labelStyle);
  315. // Window frame
  316. GUIElementStyle windowFrameStyle;
  317. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  318. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  319. windowFrameStyle.border.left = 1;
  320. windowFrameStyle.border.right = 1;
  321. windowFrameStyle.border.top = 1;
  322. windowFrameStyle.border.bottom = 1;
  323. skin->setStyle("WindowFrame", windowFrameStyle);
  324. // Button
  325. GUIElementStyle buttonStyle;
  326. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  327. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  328. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  329. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  330. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  331. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  332. buttonStyle.normal.textColor = TextNormalColor;
  333. buttonStyle.hover.textColor = TextNormalColor;
  334. buttonStyle.active.textColor = TextActiveColor;
  335. buttonStyle.normalOn.textColor = TextActiveColor;
  336. buttonStyle.hoverOn.textColor = TextActiveColor;
  337. buttonStyle.activeOn.textColor = TextActiveColor;
  338. buttonStyle.border.left = 2;
  339. buttonStyle.border.right = 2;
  340. buttonStyle.border.top = 2;
  341. buttonStyle.border.bottom = 4;
  342. buttonStyle.contentOffset.top = 2;
  343. buttonStyle.contentOffset.left = 3;
  344. buttonStyle.contentOffset.right = 3;
  345. buttonStyle.margins.bottom = 2;
  346. buttonStyle.fixedHeight = true;
  347. buttonStyle.height = 21;
  348. buttonStyle.minWidth = 20;
  349. buttonStyle.font = font;
  350. buttonStyle.fontSize = DefaultFontSize;
  351. buttonStyle.textHorzAlign = THA_Center;
  352. buttonStyle.textVertAlign = TVA_Center;
  353. skin->setStyle(GUIButton::getGUITypeName(), buttonStyle);
  354. // Left edge button
  355. GUIElementStyle leftButtonStyle;
  356. leftButtonStyle.normal.texture = getGUITexture(ButtonLeftNormalTex);
  357. leftButtonStyle.hover.texture = getGUITexture(ButtonLeftHoverTex);
  358. leftButtonStyle.active.texture = getGUITexture(ButtonLeftActiveTex);
  359. leftButtonStyle.normalOn.texture = getGUITexture(ButtonLeftActiveTex);
  360. leftButtonStyle.hoverOn.texture = getGUITexture(ButtonLeftActiveTex);
  361. leftButtonStyle.activeOn.texture = getGUITexture(ButtonLeftActiveTex);
  362. leftButtonStyle.normal.textColor = TextNormalColor;
  363. leftButtonStyle.hover.textColor = TextNormalColor;
  364. leftButtonStyle.active.textColor = TextActiveColor;
  365. leftButtonStyle.normalOn.textColor = TextActiveColor;
  366. leftButtonStyle.hoverOn.textColor = TextActiveColor;
  367. leftButtonStyle.activeOn.textColor = TextActiveColor;
  368. leftButtonStyle.border.left = 7;
  369. leftButtonStyle.border.right = 2;
  370. leftButtonStyle.border.top = 2;
  371. leftButtonStyle.border.bottom = 4;
  372. leftButtonStyle.contentOffset.top = 2;
  373. leftButtonStyle.contentOffset.left = 7;
  374. leftButtonStyle.contentOffset.right = 3;
  375. leftButtonStyle.margins.bottom = 2;
  376. leftButtonStyle.fixedHeight = true;
  377. leftButtonStyle.height = 21;
  378. leftButtonStyle.minWidth = 20;
  379. leftButtonStyle.font = font;
  380. leftButtonStyle.fontSize = DefaultFontSize;
  381. leftButtonStyle.textHorzAlign = THA_Center;
  382. leftButtonStyle.textVertAlign = TVA_Center;
  383. skin->setStyle("ButtonLeft", leftButtonStyle);
  384. // Right edge button
  385. GUIElementStyle rightButtonStyle;
  386. rightButtonStyle.normal.texture = getGUITexture(ButtonRightNormalTex);
  387. rightButtonStyle.hover.texture = getGUITexture(ButtonRightHoverTex);
  388. rightButtonStyle.active.texture = getGUITexture(ButtonRightActiveTex);
  389. rightButtonStyle.normalOn.texture = getGUITexture(ButtonRightActiveTex);
  390. rightButtonStyle.hoverOn.texture = getGUITexture(ButtonRightActiveTex);
  391. rightButtonStyle.activeOn.texture = getGUITexture(ButtonRightActiveTex);
  392. rightButtonStyle.normal.textColor = TextNormalColor;
  393. rightButtonStyle.hover.textColor = TextNormalColor;
  394. rightButtonStyle.active.textColor = TextActiveColor;
  395. rightButtonStyle.normalOn.textColor = TextActiveColor;
  396. rightButtonStyle.hoverOn.textColor = TextActiveColor;
  397. rightButtonStyle.activeOn.textColor = TextActiveColor;
  398. rightButtonStyle.border.left = 2;
  399. rightButtonStyle.border.right = 7;
  400. rightButtonStyle.border.top = 2;
  401. rightButtonStyle.border.bottom = 4;
  402. rightButtonStyle.contentOffset.top = 2;
  403. rightButtonStyle.contentOffset.left = 3;
  404. rightButtonStyle.contentOffset.right = 7;
  405. rightButtonStyle.margins.bottom = 2;
  406. rightButtonStyle.fixedHeight = true;
  407. rightButtonStyle.height = 21;
  408. rightButtonStyle.minWidth = 20;
  409. rightButtonStyle.font = font;
  410. rightButtonStyle.fontSize = DefaultFontSize;
  411. rightButtonStyle.textHorzAlign = THA_Center;
  412. rightButtonStyle.textVertAlign = TVA_Center;
  413. skin->setStyle("ButtonRight", rightButtonStyle);
  414. // Toggle
  415. GUIElementStyle toggleStyle;
  416. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  417. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  418. toggleStyle.active.texture = toggleStyle.hover.texture;
  419. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  420. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  421. toggleStyle.activeOn.texture = toggleStyle.hoverOn.texture;
  422. toggleStyle.fixedHeight = true;
  423. toggleStyle.fixedWidth = true;
  424. toggleStyle.margins.bottom = 2;
  425. toggleStyle.height = 15;
  426. toggleStyle.width = 13;
  427. skin->setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  428. // Color
  429. GUIElementStyle colorStyle;
  430. colorStyle.margins.left = 2;
  431. colorStyle.margins.right = 2;
  432. colorStyle.margins.top = 2;
  433. colorStyle.margins.bottom = 2;
  434. colorStyle.fixedHeight = true;
  435. colorStyle.height = 10;
  436. colorStyle.minWidth = 10;
  437. skin->setStyle(GUIColor::getGUITypeName(), colorStyle);
  438. // Window background texture
  439. GUIElementStyle windowBgStyle;
  440. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTex);
  441. skin->setStyle("WindowBackground", windowBgStyle);
  442. // Window tab bar background
  443. GUIElementStyle tabBarBgStyle;
  444. tabBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
  445. tabBarBgStyle.fixedHeight = true;
  446. tabBarBgStyle.height = 16;
  447. skin->setStyle("TabBarBackground", tabBarBgStyle);
  448. // Tabbed title bar tab button
  449. GUIElementStyle tabbedBarButton;
  450. tabbedBarButton.normal.texture = getGUITexture(TabButtonNormalTex);
  451. tabbedBarButton.hover.texture = tabbedBarButton.normal.texture;
  452. tabbedBarButton.active.texture = getGUITexture(TabButtonFocusedTex);
  453. tabbedBarButton.normalOn.texture = tabbedBarButton.active.texture;
  454. tabbedBarButton.hoverOn.texture = tabbedBarButton.active.texture;
  455. tabbedBarButton.activeOn.texture = tabbedBarButton.active.texture;
  456. tabbedBarButton.normal.textColor = TextNormalColor;
  457. tabbedBarButton.hover.textColor = TextNormalColor;
  458. tabbedBarButton.active.textColor = TextActiveColor;
  459. tabbedBarButton.normalOn.textColor = TextActiveColor;
  460. tabbedBarButton.hoverOn.textColor = TextActiveColor;
  461. tabbedBarButton.activeOn.textColor = TextActiveColor;
  462. tabbedBarButton.border.left = 12;
  463. tabbedBarButton.border.right = 12;
  464. tabbedBarButton.margins.left = 5;
  465. tabbedBarButton.margins.right = 5;
  466. tabbedBarButton.contentOffset.top = 3;
  467. tabbedBarButton.contentOffset.left = 6;
  468. tabbedBarButton.contentOffset.right = 6;
  469. tabbedBarButton.fixedHeight = true;
  470. tabbedBarButton.height = 15;
  471. tabbedBarButton.minWidth = 24;
  472. tabbedBarButton.maxWidth = 110;
  473. tabbedBarButton.font = font;
  474. tabbedBarButton.fontSize = DefaultFontSize;
  475. tabbedBarButton.textHorzAlign = THA_Center;
  476. tabbedBarButton.textVertAlign = TVA_Center;
  477. skin->setStyle("TabbedBarBtn", tabbedBarButton);
  478. // Tabbed title bar drag/drop button
  479. GUIElementStyle tabbedBarDropButton;
  480. tabbedBarDropButton.fixedHeight = true;
  481. tabbedBarDropButton.fixedWidth = true;
  482. tabbedBarDropButton.height = 13;
  483. tabbedBarDropButton.width = 6;
  484. skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
  485. // Window title bar background
  486. GUIElementStyle titleBarBgStyle;
  487. titleBarBgStyle.normal.texture = getGUITexture(TitleBarBackgroundTex);
  488. titleBarBgStyle.fixedHeight = true;
  489. titleBarBgStyle.height = 17;
  490. skin->setStyle("TitleBarBackground", titleBarBgStyle);
  491. // Window minimize button
  492. GUIElementStyle winMinButtonStyle;
  493. winMinButtonStyle.normal.texture = getGUITexture(MinButtonNormalTex);
  494. winMinButtonStyle.hover.texture = getGUITexture(MinButtonHoverTex);
  495. winMinButtonStyle.active.texture = getGUITexture(MinButtonActiveTex);
  496. winMinButtonStyle.fixedHeight = true;
  497. winMinButtonStyle.fixedWidth = true;
  498. winMinButtonStyle.height = 14;
  499. winMinButtonStyle.width = 14;
  500. skin->setStyle("WinMinimizeBtn", winMinButtonStyle);
  501. // Window maximize button
  502. GUIElementStyle winMaxButtonStyle;
  503. winMaxButtonStyle.normal.texture = getGUITexture(MaxButtonNormalTex);
  504. winMaxButtonStyle.hover.texture = getGUITexture(MaxButtonHoverTex);
  505. winMaxButtonStyle.active.texture = getGUITexture(MaxButtonActiveTex);
  506. winMaxButtonStyle.fixedHeight = true;
  507. winMaxButtonStyle.fixedWidth = true;
  508. winMaxButtonStyle.height = 14;
  509. winMaxButtonStyle.width = 14;
  510. skin->setStyle("WinMaximizeBtn", winMaxButtonStyle);
  511. // Window close button
  512. GUIElementStyle winCloseButtonStyle;
  513. winCloseButtonStyle.normal.texture = getGUITexture(CloseButtonNormalTex);
  514. winCloseButtonStyle.hover.texture = getGUITexture(CloseButtonHoverTex);
  515. winCloseButtonStyle.active.texture = getGUITexture(CloseButtonActiveTex);
  516. winCloseButtonStyle.fixedHeight = true;
  517. winCloseButtonStyle.fixedWidth = true;
  518. winCloseButtonStyle.height = 14;
  519. winCloseButtonStyle.width = 14;
  520. skin->setStyle("WinCloseBtn", winCloseButtonStyle);
  521. // Input box
  522. GUIElementStyle inputBoxStyle;
  523. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  524. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  525. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  526. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  527. inputBoxStyle.normal.textColor = TextNormalColor;
  528. inputBoxStyle.hover.textColor = TextNormalColor;
  529. inputBoxStyle.focused.textColor = TextNormalColor;
  530. inputBoxStyle.active.textColor = TextNormalColor;
  531. inputBoxStyle.border.left = 4;
  532. inputBoxStyle.border.right = 4;
  533. inputBoxStyle.border.top = 4;
  534. inputBoxStyle.border.bottom = 6;
  535. inputBoxStyle.contentOffset.left = 4;
  536. inputBoxStyle.contentOffset.right = 4;
  537. inputBoxStyle.contentOffset.top = 4;
  538. inputBoxStyle.contentOffset.bottom = 4;
  539. inputBoxStyle.margins.bottom = 2;
  540. inputBoxStyle.fixedHeight = true;
  541. inputBoxStyle.height = 21;
  542. inputBoxStyle.minWidth = 10;
  543. inputBoxStyle.font = font;
  544. inputBoxStyle.fontSize = DefaultFontSize;
  545. inputBoxStyle.textHorzAlign = THA_Left;
  546. inputBoxStyle.textVertAlign = TVA_Top;
  547. skin->setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  548. /************************************************************************/
  549. /* SCROLL BAR */
  550. /************************************************************************/
  551. // Up button
  552. GUIElementStyle scrollUpBtnStyle;
  553. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  554. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  555. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  556. scrollUpBtnStyle.fixedHeight = true;
  557. scrollUpBtnStyle.fixedWidth = true;
  558. scrollUpBtnStyle.height = 11;
  559. scrollUpBtnStyle.width = 13;
  560. skin->setStyle("ScrollUpBtn", scrollUpBtnStyle);
  561. // Down button
  562. GUIElementStyle scrollDownBtnStyle;
  563. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  564. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  565. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  566. scrollDownBtnStyle.fixedHeight = true;
  567. scrollDownBtnStyle.fixedWidth = true;
  568. scrollDownBtnStyle.height = 11;
  569. scrollDownBtnStyle.width = 13;
  570. skin->setStyle("ScrollDownBtn", scrollDownBtnStyle);
  571. // Left button
  572. GUIElementStyle scrollLeftBtnStyle;
  573. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  574. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  575. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  576. scrollLeftBtnStyle.fixedHeight = true;
  577. scrollLeftBtnStyle.fixedWidth = true;
  578. scrollLeftBtnStyle.height = 13;
  579. scrollLeftBtnStyle.width = 11;
  580. skin->setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  581. // Right button
  582. GUIElementStyle scrollRightBtnStyle;
  583. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  584. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  585. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  586. scrollRightBtnStyle.fixedHeight = true;
  587. scrollRightBtnStyle.fixedWidth = true;
  588. scrollRightBtnStyle.height = 13;
  589. scrollRightBtnStyle.width = 11;
  590. skin->setStyle("ScrollRightBtn", scrollRightBtnStyle);
  591. // Horizontal handle
  592. GUIElementStyle scrollBarHorzBtnStyle;
  593. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  594. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  595. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  596. scrollBarHorzBtnStyle.fixedHeight = true;
  597. scrollBarHorzBtnStyle.fixedWidth = false;
  598. scrollBarHorzBtnStyle.width = 10;
  599. scrollBarHorzBtnStyle.height = 13;
  600. scrollBarHorzBtnStyle.border.left = 4;
  601. scrollBarHorzBtnStyle.border.right = 4;
  602. skin->setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  603. // Vertical handle
  604. GUIElementStyle scrollBarVertBtnStyle;
  605. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  606. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  607. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  608. scrollBarVertBtnStyle.fixedHeight = false;
  609. scrollBarVertBtnStyle.fixedWidth = true;
  610. scrollBarVertBtnStyle.width = 13;
  611. scrollBarVertBtnStyle.height = 10;
  612. scrollBarVertBtnStyle.border.top = 4;
  613. scrollBarVertBtnStyle.border.bottom = 4;
  614. skin->setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  615. // Vertical scroll bar
  616. GUIElementStyle vertScrollBarStyle;
  617. vertScrollBarStyle.normal.texture = getGUITexture(ScrollBarVBgTex);
  618. vertScrollBarStyle.hover.texture = vertScrollBarStyle.normal.texture;
  619. vertScrollBarStyle.active.texture = vertScrollBarStyle.normal.texture;
  620. vertScrollBarStyle.fixedHeight = false;
  621. vertScrollBarStyle.fixedWidth = true;
  622. vertScrollBarStyle.minHeight = 8;
  623. vertScrollBarStyle.width = 16;
  624. skin->setStyle("ScrollBarVert", vertScrollBarStyle);
  625. // Horizontal scroll bar
  626. GUIElementStyle horzScrollBarStyle;
  627. horzScrollBarStyle.normal.texture = getGUITexture(ScrollBarHBgTex);
  628. horzScrollBarStyle.hover.texture = horzScrollBarStyle.normal.texture;
  629. horzScrollBarStyle.active.texture = horzScrollBarStyle.normal.texture;
  630. horzScrollBarStyle.fixedHeight = true;
  631. horzScrollBarStyle.fixedWidth = false;
  632. horzScrollBarStyle.minWidth = 8;
  633. horzScrollBarStyle.height = 16;
  634. skin->setStyle("ScrollBarHorz", horzScrollBarStyle);
  635. /************************************************************************/
  636. /* DROP DOWN BOX */
  637. /************************************************************************/
  638. // ListBox button
  639. GUIElementStyle dropDownListStyle;
  640. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  641. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  642. dropDownListStyle.active.texture = getGUITexture(DropDownBtnActiveTex);
  643. dropDownListStyle.normalOn.texture = dropDownListStyle.active.texture;
  644. dropDownListStyle.hoverOn.texture = dropDownListStyle.active.texture;
  645. dropDownListStyle.activeOn.texture = dropDownListStyle.active.texture;
  646. dropDownListStyle.normal.textColor = TextNormalColor;
  647. dropDownListStyle.hover.textColor = TextNormalColor;
  648. dropDownListStyle.active.textColor = TextNormalColor;
  649. dropDownListStyle.normalOn.textColor = TextNormalColor;
  650. dropDownListStyle.hoverOn.textColor = TextNormalColor;
  651. dropDownListStyle.activeOn.textColor = TextNormalColor;
  652. dropDownListStyle.fixedHeight = true;
  653. dropDownListStyle.fixedWidth = false;
  654. dropDownListStyle.height = 21;
  655. dropDownListStyle.minWidth = 20;
  656. dropDownListStyle.contentOffset.left = 3;
  657. dropDownListStyle.contentOffset.right = 18;
  658. dropDownListStyle.contentOffset.top = 2;
  659. dropDownListStyle.contentOffset.bottom = 2;
  660. dropDownListStyle.border.left = 2;
  661. dropDownListStyle.border.right = 16;
  662. dropDownListStyle.border.top = 2;
  663. dropDownListStyle.border.bottom = 4;
  664. dropDownListStyle.margins.bottom = 2;
  665. dropDownListStyle.font = font;
  666. dropDownListStyle.fontSize = DefaultFontSize;
  667. dropDownListStyle.textHorzAlign = THA_Left;
  668. dropDownListStyle.textVertAlign = TVA_Center;
  669. skin->setStyle("ListBox", dropDownListStyle);
  670. // DropDown scroll up button arrow
  671. HSpriteTexture dropDownBtnScrollUpArrow = getGUITexture(DropDownBoxBtnUpArrowTex);
  672. GUIElementStyle dropDownScrollUpBtnArrowStyle;
  673. dropDownScrollUpBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnUpArrowTex);
  674. dropDownScrollUpBtnArrowStyle.hover.texture = dropDownScrollUpBtnArrowStyle.normal.texture;
  675. dropDownScrollUpBtnArrowStyle.active.texture = dropDownScrollUpBtnArrowStyle.hover.texture;
  676. dropDownScrollUpBtnArrowStyle.fixedHeight = true;
  677. dropDownScrollUpBtnArrowStyle.fixedWidth = false;
  678. dropDownScrollUpBtnArrowStyle.height = 7;
  679. dropDownScrollUpBtnArrowStyle.width = 30;
  680. dropDownScrollUpBtnArrowStyle.border.left = 1;
  681. dropDownScrollUpBtnArrowStyle.border.right = 1;
  682. dropDownScrollUpBtnArrowStyle.border.top = 1;
  683. dropDownScrollUpBtnArrowStyle.border.bottom = 1;
  684. skin->setStyle("ListBoxScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  685. skin->setStyle("MenuBarScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  686. skin->setStyle("ContextMenuScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  687. // DropDown scroll up button
  688. GUIElementStyle dropDownScrollUpBtnStyle;
  689. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  690. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  691. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  692. dropDownScrollUpBtnStyle.fixedHeight = true;
  693. dropDownScrollUpBtnStyle.fixedWidth = false;
  694. dropDownScrollUpBtnStyle.height = 7;
  695. dropDownScrollUpBtnStyle.width = 30;
  696. dropDownScrollUpBtnStyle.border.left = 1;
  697. dropDownScrollUpBtnStyle.border.right = 1;
  698. dropDownScrollUpBtnStyle.border.top = 1;
  699. dropDownScrollUpBtnStyle.border.bottom = 1;
  700. skin->setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  701. skin->setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  702. skin->setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  703. // DropDown scroll down button arrow
  704. GUIElementStyle dropDownScrollDownBtnArrowStyle;
  705. dropDownScrollDownBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnDownArrowTex);
  706. dropDownScrollDownBtnArrowStyle.hover.texture = dropDownScrollDownBtnArrowStyle.normal.texture;
  707. dropDownScrollDownBtnArrowStyle.active.texture = dropDownScrollDownBtnArrowStyle.hover.texture;
  708. dropDownScrollDownBtnArrowStyle.fixedHeight = true;
  709. dropDownScrollDownBtnArrowStyle.fixedWidth = false;
  710. dropDownScrollDownBtnArrowStyle.height = 7;
  711. dropDownScrollDownBtnArrowStyle.width = 30;
  712. dropDownScrollDownBtnArrowStyle.border.left = 1;
  713. dropDownScrollDownBtnArrowStyle.border.right = 1;
  714. dropDownScrollDownBtnArrowStyle.border.top = 1;
  715. dropDownScrollDownBtnArrowStyle.border.bottom = 1;
  716. skin->setStyle("ListBoxScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  717. skin->setStyle("MenuBarScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  718. skin->setStyle("ContextMenuScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  719. // DropDown scroll down button
  720. GUIElementStyle dropDownScrollDownBtnStyle;
  721. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  722. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  723. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  724. dropDownScrollDownBtnStyle.fixedHeight = true;
  725. dropDownScrollDownBtnStyle.fixedWidth = false;
  726. dropDownScrollDownBtnStyle.height = 7;
  727. dropDownScrollDownBtnStyle.width = 30;
  728. dropDownScrollDownBtnStyle.border.left = 1;
  729. dropDownScrollDownBtnStyle.border.right = 1;
  730. dropDownScrollDownBtnStyle.border.top = 1;
  731. dropDownScrollDownBtnStyle.border.bottom = 1;
  732. skin->setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  733. skin->setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  734. skin->setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  735. // DropDown entry button
  736. GUIElementStyle dropDownEntryBtnStyle;
  737. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  738. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  739. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  740. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  741. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  742. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  743. dropDownEntryBtnStyle.normal.textColor = TextNormalColor;
  744. dropDownEntryBtnStyle.hover.textColor = TextNormalColor;
  745. dropDownEntryBtnStyle.active.textColor = TextNormalColor;
  746. dropDownEntryBtnStyle.normalOn.textColor = TextNormalColor;
  747. dropDownEntryBtnStyle.hoverOn.textColor = TextNormalColor;
  748. dropDownEntryBtnStyle.activeOn.textColor = TextNormalColor;
  749. dropDownEntryBtnStyle.fixedHeight = true;
  750. dropDownEntryBtnStyle.fixedWidth = false;
  751. dropDownEntryBtnStyle.height = 14;
  752. dropDownEntryBtnStyle.width = 30;
  753. dropDownEntryBtnStyle.border.left = 1;
  754. dropDownEntryBtnStyle.border.right = 1;
  755. dropDownEntryBtnStyle.border.top = 1;
  756. dropDownEntryBtnStyle.border.bottom = 1;
  757. dropDownEntryBtnStyle.font = font;
  758. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  759. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  760. dropDownEntryBtnStyle.textVertAlign = TVA_Top;
  761. skin->setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  762. // DropDown entry button with expand
  763. GUIElementStyle dropDownEntryExpBtnStyle;
  764. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  765. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  766. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  767. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  768. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  769. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  770. dropDownEntryExpBtnStyle.normal.textColor = TextNormalColor;
  771. dropDownEntryExpBtnStyle.hover.textColor = TextNormalColor;
  772. dropDownEntryExpBtnStyle.active.textColor = TextNormalColor;
  773. dropDownEntryExpBtnStyle.normalOn.textColor = TextNormalColor;
  774. dropDownEntryExpBtnStyle.hoverOn.textColor = TextNormalColor;
  775. dropDownEntryExpBtnStyle.activeOn.textColor = TextNormalColor;
  776. dropDownEntryExpBtnStyle.fixedHeight = true;
  777. dropDownEntryExpBtnStyle.fixedWidth = false;
  778. dropDownEntryExpBtnStyle.height = 14;
  779. dropDownEntryExpBtnStyle.width = 30;
  780. dropDownEntryExpBtnStyle.border.left = 1;
  781. dropDownEntryExpBtnStyle.border.right = 6;
  782. dropDownEntryExpBtnStyle.border.top = 1;
  783. dropDownEntryExpBtnStyle.border.bottom = 1;
  784. dropDownEntryExpBtnStyle.font = font;
  785. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  786. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  787. dropDownEntryExpBtnStyle.textVertAlign = TVA_Top;
  788. skin->setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  789. // Drop down separator
  790. GUIElementStyle dropDownSeparatorStyle;
  791. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  792. dropDownSeparatorStyle.fixedHeight = true;
  793. dropDownSeparatorStyle.fixedWidth = false;
  794. dropDownSeparatorStyle.height = 3;
  795. dropDownSeparatorStyle.width = 30;
  796. dropDownSeparatorStyle.border.left = 1;
  797. dropDownSeparatorStyle.border.right = 1;
  798. dropDownSeparatorStyle.border.top = 1;
  799. dropDownSeparatorStyle.border.bottom = 1;
  800. skin->setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  801. // Drop down content
  802. GUIElementStyle dropDownContentStyle;
  803. dropDownContentStyle.minWidth = 50;
  804. dropDownContentStyle.minHeight = 20;
  805. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  806. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  807. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  808. skin->setStyle("ListBoxContent", dropDownContentStyle);
  809. skin->setStyle("MenuBarContent", dropDownContentStyle);
  810. skin->setStyle("ContextMenuContent", dropDownContentStyle);
  811. // DropDown box frame
  812. GUIElementStyle dropDownBoxStyle;
  813. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  814. dropDownBoxStyle.hover.texture = dropDownEntryBtnStyle.normal.texture;
  815. dropDownBoxStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  816. dropDownBoxStyle.fixedHeight = false;
  817. dropDownBoxStyle.fixedWidth = false;
  818. dropDownBoxStyle.border.left = 1;
  819. dropDownBoxStyle.border.right = 1;
  820. dropDownBoxStyle.border.top = 1;
  821. dropDownBoxStyle.border.bottom = 1;
  822. dropDownBoxStyle.margins.left = 1;
  823. dropDownBoxStyle.margins.right = 1;
  824. dropDownBoxStyle.margins.top = 1;
  825. dropDownBoxStyle.margins.bottom = 1;
  826. skin->setStyle("ListBoxFrame", dropDownBoxStyle);
  827. skin->setStyle("MenuBarFrame", dropDownBoxStyle);
  828. skin->setStyle("ContextMenuFrame", dropDownBoxStyle);
  829. /************************************************************************/
  830. /* MENU BAR */
  831. /************************************************************************/
  832. // MenuBar background
  833. GUIElementStyle menuBarBgStyle;
  834. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  835. menuBarBgStyle.height = 14;
  836. menuBarBgStyle.width = 2;
  837. menuBarBgStyle.border.bottom = 2;
  838. skin->setStyle(GUIMenuBar::getBackgroundStyleType(), menuBarBgStyle);
  839. // MenuBar separator line
  840. GUIElementStyle menuBarLineStyle;
  841. menuBarLineStyle.normal.texture = getGUITexture(MenuBarLineNormalTex);
  842. menuBarLineStyle.normalOn.texture = getGUITexture(MenuBarLineActiveTex);
  843. menuBarLineStyle.fixedHeight = true;
  844. menuBarLineStyle.height = 1;
  845. skin->setStyle(GUIMenuBar::getLineStyleType(), menuBarLineStyle);
  846. // MenuBar Banshee logo
  847. GUIElementStyle menuBarBansheeLogoStyle;
  848. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  849. menuBarBansheeLogoStyle.fixedHeight = true;
  850. menuBarBansheeLogoStyle.fixedWidth = true;
  851. menuBarBansheeLogoStyle.height = 46;
  852. menuBarBansheeLogoStyle.width = 46;
  853. skin->setStyle(GUIMenuBar::getLogoStyleType(), menuBarBansheeLogoStyle);
  854. // MenuBar button
  855. GUIElementStyle menuBarBtnStyle;
  856. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  857. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  858. menuBarBtnStyle.active.texture = getGUITexture(MenuBarBtnActiveTex);
  859. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.active.texture;
  860. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.active.texture;
  861. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.active.texture;
  862. menuBarBtnStyle.normal.textColor = TextNormalColor;
  863. menuBarBtnStyle.hover.textColor = TextNormalColor;
  864. menuBarBtnStyle.active.textColor = TextActiveColor;
  865. menuBarBtnStyle.normalOn.textColor = TextActiveColor;
  866. menuBarBtnStyle.hoverOn.textColor = TextActiveColor;
  867. menuBarBtnStyle.activeOn.textColor = TextActiveColor;
  868. menuBarBtnStyle.fixedHeight = true;
  869. menuBarBtnStyle.fixedWidth = false;
  870. menuBarBtnStyle.height = 14;
  871. menuBarBtnStyle.width = 4;
  872. menuBarBtnStyle.margins.left = 2;
  873. menuBarBtnStyle.margins.right = 2;
  874. menuBarBtnStyle.margins.top = 2;
  875. menuBarBtnStyle.margins.bottom = 2;
  876. menuBarBtnStyle.font = font;
  877. menuBarBtnStyle.fontSize = DefaultFontSize;
  878. menuBarBtnStyle.textHorzAlign = THA_Left;
  879. menuBarBtnStyle.textVertAlign = TVA_Top;
  880. skin->setStyle(GUIMenuBar::getMenuItemButtonStyleType(), menuBarBtnStyle);
  881. // ToolBar separator
  882. GUIElementStyle toolBarSeparator;
  883. toolBarSeparator.normal.texture = getGUITexture(ToolBarSeparatorTex);
  884. toolBarSeparator.fixedWidth = true;
  885. toolBarSeparator.width = 3;
  886. toolBarSeparator.height = 30;
  887. skin->setStyle(GUIMenuBar::getToolBarSeparatorStyleType(), toolBarSeparator);
  888. // ToolBar button
  889. GUIElementStyle toolBarBtnStyle;
  890. toolBarBtnStyle.normal.texture = getGUITexture(ToolBarBtnNormalTex);
  891. toolBarBtnStyle.hover.texture = getGUITexture(ToolBarBtnHoverTex);
  892. toolBarBtnStyle.active.texture = getGUITexture(ToolBarBtnActiveTex);
  893. toolBarBtnStyle.normal.textColor = TextNormalColor;
  894. toolBarBtnStyle.hover.textColor = TextNormalColor;
  895. toolBarBtnStyle.active.textColor = TextActiveColor;
  896. toolBarBtnStyle.fixedHeight = true;
  897. toolBarBtnStyle.fixedWidth = true;
  898. toolBarBtnStyle.height = 30;
  899. toolBarBtnStyle.width = 30;
  900. skin->setStyle(GUIMenuBar::getToolBarButtonStyleType(), toolBarBtnStyle);
  901. /************************************************************************/
  902. /* DOCK SLIDER */
  903. /************************************************************************/
  904. GUIElementStyle dockSliderBtnStyle;
  905. dockSliderBtnStyle.normal.texture = getGUITexture(DockSliderNormalTex);
  906. dockSliderBtnStyle.hover.texture = dockSliderBtnStyle.normal.texture;
  907. dockSliderBtnStyle.active.texture = dockSliderBtnStyle.normal.texture;
  908. dockSliderBtnStyle.fixedHeight = false;
  909. dockSliderBtnStyle.fixedWidth = false;
  910. dockSliderBtnStyle.height = 2;
  911. dockSliderBtnStyle.width = 2;
  912. skin->setStyle("DockSliderBtn", dockSliderBtnStyle);
  913. /************************************************************************/
  914. /* TREE VIEW */
  915. /************************************************************************/
  916. // Expand button
  917. GUIElementStyle treeViewExpandButtonStyle;
  918. treeViewExpandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  919. treeViewExpandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  920. treeViewExpandButtonStyle.active.texture = treeViewExpandButtonStyle.hover.texture;
  921. treeViewExpandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  922. treeViewExpandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  923. treeViewExpandButtonStyle.activeOn.texture = treeViewExpandButtonStyle.hoverOn.texture;
  924. treeViewExpandButtonStyle.margins.left = 4;
  925. treeViewExpandButtonStyle.margins.right = 4;
  926. treeViewExpandButtonStyle.margins.top = 5;
  927. treeViewExpandButtonStyle.margins.bottom = 4;
  928. treeViewExpandButtonStyle.fixedHeight = true;
  929. treeViewExpandButtonStyle.fixedWidth = true;
  930. treeViewExpandButtonStyle.height = 16;
  931. treeViewExpandButtonStyle.width = 16;
  932. skin->setStyle("TreeViewFoldoutBtn", treeViewExpandButtonStyle);
  933. // Entry
  934. GUIElementStyle treeViewEntryStyle;
  935. treeViewEntryStyle.font = font;
  936. treeViewEntryStyle.fontSize = DefaultFontSize;
  937. treeViewEntryStyle.fixedWidth = false;
  938. treeViewEntryStyle.fixedHeight = true;
  939. treeViewEntryStyle.height = 16;
  940. treeViewEntryStyle.minWidth = 10;
  941. treeViewEntryStyle.normal.textColor = TextNormalColor;
  942. skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
  943. // Selection background
  944. GUIElementStyle treeViewSelBackgroundStyle;
  945. treeViewSelBackgroundStyle.normal.texture = getGUITexture(SelectionBgTex);
  946. treeViewSelBackgroundStyle.fixedHeight = false;
  947. treeViewSelBackgroundStyle.fixedWidth = false;
  948. treeViewSelBackgroundStyle.height = 2;
  949. treeViewSelBackgroundStyle.width = 2;
  950. skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  951. // Highlight background
  952. GUIElementStyle treeViewHLBackgroundStyle;
  953. treeViewHLBackgroundStyle.normal.texture = getGUITexture(TreeViewHighlightBackground);
  954. treeViewHLBackgroundStyle.fixedHeight = false;
  955. treeViewHLBackgroundStyle.fixedWidth = false;
  956. treeViewHLBackgroundStyle.height = 2;
  957. treeViewHLBackgroundStyle.width = 2;
  958. skin->setStyle("TreeViewHighlightBackground", treeViewHLBackgroundStyle);
  959. // Edit box
  960. GUIElementStyle treeViewEditBox;
  961. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  962. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  963. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  964. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  965. treeViewEditBox.normal.textColor = TextNormalColor;
  966. treeViewEditBox.hover.textColor = TextNormalColor;
  967. treeViewEditBox.focused.textColor = TextNormalColor;
  968. treeViewEditBox.active.textColor = TextNormalColor;
  969. treeViewEditBox.border.left = 1;
  970. treeViewEditBox.border.right = 1;
  971. treeViewEditBox.border.top = 1;
  972. treeViewEditBox.border.bottom = 1;
  973. treeViewEditBox.margins.left = 1;
  974. treeViewEditBox.margins.right = 1;
  975. treeViewEditBox.margins.top = 1;
  976. treeViewEditBox.margins.bottom = 1;
  977. treeViewEditBox.fixedHeight = true;
  978. treeViewEditBox.height = 13;
  979. treeViewEditBox.minWidth = 10;
  980. treeViewEditBox.font = font;
  981. treeViewEditBox.fontSize = DefaultFontSize;
  982. treeViewEditBox.textHorzAlign = THA_Left;
  983. treeViewEditBox.textVertAlign = TVA_Top;
  984. skin->setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  985. // Element highlight
  986. GUIElementStyle treeViewElementHighlight;
  987. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  988. treeViewElementHighlight.border.left = 1;
  989. treeViewElementHighlight.border.right = 1;
  990. treeViewElementHighlight.border.top = 1;
  991. treeViewElementHighlight.border.bottom = 1;
  992. skin->setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  993. // Element separator highlight
  994. GUIElementStyle treeViewElementSepHighlight;
  995. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  996. treeViewElementSepHighlight.border.left = 1;
  997. treeViewElementSepHighlight.border.right = 1;
  998. treeViewElementSepHighlight.border.top = 1;
  999. treeViewElementSepHighlight.border.bottom = 1;
  1000. skin->setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  1001. /************************************************************************/
  1002. /* OBJECT DROP FIELD */
  1003. /************************************************************************/
  1004. GUIElementStyle objectDropStyle;
  1005. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  1006. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  1007. objectDropStyle.normal.textColor = TextNormalColor;
  1008. objectDropStyle.hover.textColor = TextNormalColor;
  1009. objectDropStyle.active.textColor = TextNormalColor;
  1010. objectDropStyle.normalOn.textColor = TextNormalColor;
  1011. objectDropStyle.hoverOn.textColor = TextNormalColor;
  1012. objectDropStyle.activeOn.textColor = TextNormalColor;
  1013. objectDropStyle.border.left = 2;
  1014. objectDropStyle.border.top = 2;
  1015. objectDropStyle.border.bottom = 4;
  1016. objectDropStyle.contentOffset.left = 3;
  1017. objectDropStyle.contentOffset.right = 1;
  1018. objectDropStyle.margins.bottom = 2;
  1019. objectDropStyle.fixedHeight = true;
  1020. objectDropStyle.height = 21;
  1021. objectDropStyle.minWidth = 20;
  1022. objectDropStyle.font = font;
  1023. objectDropStyle.fontSize = DefaultFontSize;
  1024. objectDropStyle.textHorzAlign = THA_Center;
  1025. objectDropStyle.textVertAlign = TVA_Center;
  1026. skin->setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  1027. GUIElementStyle objectClearBtnStyle;
  1028. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  1029. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  1030. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  1031. objectClearBtnStyle.fixedHeight = true;
  1032. objectClearBtnStyle.fixedWidth = true;
  1033. objectClearBtnStyle.height = 21;
  1034. objectClearBtnStyle.width = 16;
  1035. objectClearBtnStyle.margins.bottom = 2;
  1036. skin->setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  1037. GUIElementStyle editorObjectFieldStyle;
  1038. editorObjectFieldStyle.fixedHeight = true;
  1039. editorObjectFieldStyle.height = 15;
  1040. editorObjectFieldStyle.minWidth = 30;
  1041. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1042. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  1043. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  1044. skin->setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  1045. /************************************************************************/
  1046. /* TEXTURE DROP FIELD */
  1047. /************************************************************************/
  1048. GUIElementStyle textureFieldStyle;
  1049. textureFieldStyle.minHeight = 15;
  1050. textureFieldStyle.minWidth = 15;
  1051. textureFieldStyle.subStyles[TextureFieldDropStyleName] = TextureFieldDropStyleName;
  1052. textureFieldStyle.subStyles[TextureFieldClearBtnStyleName] = TextureFieldClearBtnStyleName;
  1053. textureFieldStyle.subStyles[TextureFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1054. skin->setStyle(TextureFieldStyleName, textureFieldStyle);
  1055. GUIElementStyle textureDropStyle;
  1056. textureDropStyle.font = font;
  1057. textureDropStyle.fontSize = DefaultFontSize;
  1058. textureDropStyle.textHorzAlign = THA_Center;
  1059. textureDropStyle.textVertAlign = TVA_Center;
  1060. textureDropStyle.normal.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1061. textureDropStyle.normal.texture = getGUITexture(TextureDropTex);
  1062. textureDropStyle.hover.textColor = textureDropStyle.normal.textColor;
  1063. textureDropStyle.hover.texture = textureDropStyle.normal.texture;
  1064. textureDropStyle.active.textColor = textureDropStyle.normal.textColor;
  1065. textureDropStyle.active.texture = textureDropStyle.normal.texture;
  1066. textureDropStyle.normalOn.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1067. textureDropStyle.normalOn.texture = getGUITexture(TextureDropOnTex);
  1068. textureDropStyle.hoverOn.textColor = textureDropStyle.normalOn.textColor;
  1069. textureDropStyle.hoverOn.texture = textureDropStyle.normalOn.texture;
  1070. textureDropStyle.activeOn.textColor = textureDropStyle.normalOn.textColor;
  1071. textureDropStyle.activeOn.texture = textureDropStyle.normalOn.texture;
  1072. textureDropStyle.height = 82;
  1073. textureDropStyle.width = 82;
  1074. textureDropStyle.fixedHeight = true;
  1075. textureDropStyle.fixedWidth = true;
  1076. textureDropStyle.border.left = 2;
  1077. textureDropStyle.border.right = 2;
  1078. textureDropStyle.border.top = 2;
  1079. textureDropStyle.border.bottom = 2;
  1080. skin->setStyle(TextureFieldDropStyleName, textureDropStyle);
  1081. GUIElementStyle textureDropClearStyle;
  1082. textureDropClearStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1083. textureDropClearStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1084. textureDropClearStyle.active.texture = textureDropStyle.hover.texture;
  1085. textureDropClearStyle.fixedWidth = true;
  1086. textureDropClearStyle.fixedHeight = true;
  1087. textureDropClearStyle.height = 11;
  1088. textureDropClearStyle.width = 11;
  1089. skin->setStyle(TextureFieldClearBtnStyleName, textureDropClearStyle);
  1090. /************************************************************************/
  1091. /* EDITOR FIELDS */
  1092. /************************************************************************/
  1093. GUIElementStyle editorFieldLabelStyle;
  1094. editorFieldLabelStyle.font = font;
  1095. editorFieldLabelStyle.fontSize = DefaultFontSize;
  1096. editorFieldLabelStyle.fixedWidth = false;
  1097. editorFieldLabelStyle.fixedHeight = true;
  1098. editorFieldLabelStyle.height = 11;
  1099. editorFieldLabelStyle.minWidth = 10;
  1100. editorFieldLabelStyle.textHorzAlign = THA_Left;
  1101. skin->setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  1102. GUIElementStyle editorIntFieldStyle;
  1103. editorIntFieldStyle.fixedHeight = true;
  1104. editorIntFieldStyle.height = 21;
  1105. editorIntFieldStyle.minWidth = 30;
  1106. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1107. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1108. skin->setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  1109. GUIElementStyle editorFloatFieldStyle;
  1110. editorFloatFieldStyle.fixedHeight = true;
  1111. editorFloatFieldStyle.height = 21;
  1112. editorFloatFieldStyle.minWidth = 30;
  1113. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1114. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1115. skin->setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  1116. GUIElementStyle editorTextFieldStyle;
  1117. editorTextFieldStyle.fixedHeight = true;
  1118. editorTextFieldStyle.height = 21;
  1119. editorTextFieldStyle.minWidth = 30;
  1120. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1121. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1122. skin->setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  1123. GUIElementStyle editorColorFieldStyle;
  1124. editorColorFieldStyle.fixedHeight = true;
  1125. editorColorFieldStyle.height = 15;
  1126. editorColorFieldStyle.minWidth = 30;
  1127. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1128. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  1129. skin->setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  1130. GUIElementStyle editorToggleFieldStyle;
  1131. editorToggleFieldStyle.fixedHeight = true;
  1132. editorToggleFieldStyle.height = 15;
  1133. editorToggleFieldStyle.minWidth = 30;
  1134. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1135. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  1136. skin->setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  1137. GUIElementStyle editorVector2FieldStyle;
  1138. editorVector2FieldStyle.fixedHeight = true;
  1139. editorVector2FieldStyle.height = 30;
  1140. editorVector2FieldStyle.minWidth = 30;
  1141. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1142. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1143. skin->setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  1144. GUIElementStyle editorVector3FieldStyle;
  1145. editorVector3FieldStyle.fixedHeight = true;
  1146. editorVector3FieldStyle.height = 30;
  1147. editorVector3FieldStyle.minWidth = 30;
  1148. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1149. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1150. skin->setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  1151. GUIElementStyle editorVector4FieldStyle;
  1152. editorVector4FieldStyle.fixedHeight = true;
  1153. editorVector4FieldStyle.height = 30;
  1154. editorVector4FieldStyle.minWidth = 30;
  1155. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1156. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1157. skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  1158. /************************************************************************/
  1159. /* COMPONENT FOLDOUT */
  1160. /************************************************************************/
  1161. GUIElementStyle cmpFoldoutBtnStyle;
  1162. cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
  1163. cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
  1164. cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1165. cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
  1166. cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
  1167. cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1168. cmpFoldoutBtnStyle.normal.textColor = TextNormalColor;
  1169. cmpFoldoutBtnStyle.hover.textColor = TextNormalColor;
  1170. cmpFoldoutBtnStyle.active.textColor = TextNormalColor;
  1171. cmpFoldoutBtnStyle.normalOn.textColor = TextNormalColor;
  1172. cmpFoldoutBtnStyle.hoverOn.textColor = TextNormalColor;
  1173. cmpFoldoutBtnStyle.activeOn.textColor = TextNormalColor;
  1174. cmpFoldoutBtnStyle.fixedHeight = true;
  1175. cmpFoldoutBtnStyle.fixedWidth = false;
  1176. cmpFoldoutBtnStyle.height = 10;
  1177. cmpFoldoutBtnStyle.minWidth = 10;
  1178. cmpFoldoutBtnStyle.font = font;
  1179. cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
  1180. cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
  1181. cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
  1182. cmpFoldoutBtnStyle.contentOffset = RectOffset(12, 0, 0, 0);
  1183. cmpFoldoutBtnStyle.border.left = 8;
  1184. skin->setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
  1185. GUIElementStyle cmpFoldoutRemoveBtnStyle;
  1186. cmpFoldoutRemoveBtnStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1187. cmpFoldoutRemoveBtnStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1188. cmpFoldoutRemoveBtnStyle.active.texture = cmpFoldoutRemoveBtnStyle.hover.texture;
  1189. cmpFoldoutRemoveBtnStyle.fixedHeight = true;
  1190. cmpFoldoutRemoveBtnStyle.fixedWidth = true;
  1191. cmpFoldoutRemoveBtnStyle.height = 11;
  1192. cmpFoldoutRemoveBtnStyle.width = 11;
  1193. skin->setStyle(GUIComponentFoldout::getFoldoutRemoveButtonStyleType(), cmpFoldoutRemoveBtnStyle);
  1194. GUIElementStyle cmpFoldoutStyle;
  1195. cmpFoldoutStyle.fixedHeight = true;
  1196. cmpFoldoutStyle.height = 12;
  1197. cmpFoldoutStyle.minWidth = 30;
  1198. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
  1199. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutRemoveButtonStyleType()] = GUIComponentFoldout::getFoldoutRemoveButtonStyleType();
  1200. skin->setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
  1201. /************************************************************************/
  1202. /* FOLDOUT */
  1203. /************************************************************************/
  1204. GUIElementStyle foldoutBtnStyle;
  1205. foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  1206. foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  1207. foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
  1208. foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  1209. foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  1210. foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
  1211. foldoutBtnStyle.fixedHeight = true;
  1212. foldoutBtnStyle.fixedWidth = true;
  1213. foldoutBtnStyle.height = 10;
  1214. foldoutBtnStyle.width = 8;
  1215. skin->setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
  1216. GUIElementStyle foldoutStyle;
  1217. foldoutStyle.fixedHeight = true;
  1218. foldoutStyle.height = 12;
  1219. foldoutStyle.minWidth = 30;
  1220. foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
  1221. foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
  1222. skin->setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
  1223. /************************************************************************/
  1224. /* PROGRESS BAR */
  1225. /************************************************************************/
  1226. GUIElementStyle progressBarBgStyle;
  1227. progressBarBgStyle.fixedHeight = true;
  1228. progressBarBgStyle.height = 17;
  1229. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  1230. progressBarBgStyle.border.left = 8;
  1231. progressBarBgStyle.border.right = 8;
  1232. skin->setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  1233. GUIElementStyle progressBarFillStyle;
  1234. progressBarFillStyle.fixedHeight = true;
  1235. progressBarFillStyle.height = 16;
  1236. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  1237. progressBarFillStyle.border.left = 9;
  1238. progressBarFillStyle.border.right = 10;
  1239. skin->setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  1240. GUIElementStyle progressBarStyle;
  1241. progressBarStyle.fixedHeight = true;
  1242. progressBarStyle.height = 17;
  1243. progressBarStyle.minWidth = 100;
  1244. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  1245. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  1246. skin->setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  1247. /************************************************************************/
  1248. /* SLIDER */
  1249. /************************************************************************/
  1250. GUIElementStyle sliderHandleStyle;
  1251. sliderHandleStyle.fixedHeight = true;
  1252. sliderHandleStyle.fixedWidth = true;
  1253. sliderHandleStyle.width = 12;
  1254. sliderHandleStyle.height = 13;
  1255. sliderHandleStyle.normal.texture = getGUITexture(SliderHandleNormalTex);
  1256. sliderHandleStyle.hover.texture = getGUITexture(SliderHandleHoverTex);
  1257. sliderHandleStyle.active.texture = getGUITexture(SliderHandleActiveTex);
  1258. skin->setStyle(GUISlider::getHandleStyleType(), sliderHandleStyle);
  1259. GUIElementStyle sliderHorizontalBgStyle;
  1260. sliderHorizontalBgStyle.fixedHeight = true;
  1261. sliderHorizontalBgStyle.height = 10;
  1262. sliderHorizontalBgStyle.normal.texture = getGUITexture(SliderHBackgroundTex);
  1263. sliderHorizontalBgStyle.border.left = 4;
  1264. sliderHorizontalBgStyle.border.right = 4;
  1265. skin->setStyle("SliderHorzBg", sliderHorizontalBgStyle);
  1266. GUIElementStyle sliderHorizontalFillStyle;
  1267. sliderHorizontalFillStyle.fixedHeight = true;
  1268. sliderHorizontalFillStyle.height = 10;
  1269. sliderHorizontalFillStyle.normal.texture = getGUITexture(SliderHFillTex);
  1270. sliderHorizontalFillStyle.border.left = 6;
  1271. sliderHorizontalFillStyle.border.right = 4;
  1272. skin->setStyle("SliderHorzFill", sliderHorizontalFillStyle);
  1273. GUIElementStyle sliderHorizontalStyle;
  1274. sliderHorizontalStyle.fixedHeight = true;
  1275. sliderHorizontalStyle.height = 13;
  1276. sliderHorizontalStyle.width = 150;
  1277. sliderHorizontalStyle.minWidth = 10;
  1278. sliderHorizontalStyle.subStyles[GUISlider::getHandleStyleType()] = GUISlider::getHandleStyleType();
  1279. sliderHorizontalStyle.subStyles[GUISlider::getBackgroundStyleType()] = "SliderHorzBg";
  1280. sliderHorizontalStyle.subStyles[GUISlider::getFillStyleType()] = "SliderHorzFill";
  1281. skin->setStyle(GUISliderHorz::getGUITypeName(), sliderHorizontalStyle);
  1282. GUIElementStyle sliderVerticalBgStyle;
  1283. sliderVerticalBgStyle.fixedWidth = true;
  1284. sliderVerticalBgStyle.width = 10;
  1285. sliderVerticalBgStyle.normal.texture = getGUITexture(SliderVBackgroundTex);
  1286. sliderVerticalBgStyle.border.top = 4;
  1287. sliderVerticalBgStyle.border.bottom = 4;
  1288. skin->setStyle("SliderVertBg", sliderVerticalBgStyle);
  1289. GUIElementStyle sliderVerticalFillStyle;
  1290. sliderVerticalFillStyle.fixedWidth = true;
  1291. sliderVerticalFillStyle.width = 10;
  1292. sliderVerticalFillStyle.normal.texture = getGUITexture(SliderVFillTex);
  1293. sliderVerticalFillStyle.border.top = 6;
  1294. sliderVerticalFillStyle.border.bottom = 4;
  1295. skin->setStyle("SliderVertFill", sliderVerticalFillStyle);
  1296. GUIElementStyle sliderVerticalStyle;
  1297. sliderVerticalStyle.fixedWidth = true;
  1298. sliderVerticalStyle.width = 13;
  1299. sliderVerticalStyle.height = 150;
  1300. sliderVerticalStyle.minHeight = 10;
  1301. sliderVerticalStyle.subStyles[GUISlider::getHandleStyleType()] = GUISlider::getHandleStyleType();
  1302. sliderVerticalStyle.subStyles[GUISlider::getBackgroundStyleType()] = "SliderVertBg";
  1303. sliderVerticalStyle.subStyles[GUISlider::getFillStyleType()] = "SliderVertFill";
  1304. skin->setStyle(GUISliderVert::getGUITypeName(), sliderVerticalStyle);
  1305. /************************************************************************/
  1306. /* COLOR PICKER SLIDER */
  1307. /************************************************************************/
  1308. GUIElementStyle colorPickerSliderHorzHandleStyle;
  1309. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1310. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  1311. colorPickerSliderHorzHandleStyle.height = 20;
  1312. colorPickerSliderHorzHandleStyle.width = 7;
  1313. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  1314. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1315. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1316. skin->setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  1317. GUIElementStyle colorPickerSliderHorzStyle;
  1318. colorPickerSliderHorzStyle.fixedHeight = true;
  1319. colorPickerSliderHorzStyle.height = 32;
  1320. colorPickerSliderHorzStyle.minWidth = 20;
  1321. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  1322. skin->setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  1323. GUIElementStyle colorPickerSliderVertHandleStyle;
  1324. colorPickerSliderVertHandleStyle.fixedHeight = true;
  1325. colorPickerSliderVertHandleStyle.fixedWidth = true;
  1326. colorPickerSliderVertHandleStyle.height = 7;
  1327. colorPickerSliderVertHandleStyle.width = 45;
  1328. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  1329. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1330. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1331. skin->setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  1332. GUIElementStyle colorPickerSliderVertStyle;
  1333. colorPickerSliderVertStyle.fixedWidth = true;
  1334. colorPickerSliderVertStyle.width = 30;
  1335. colorPickerSliderVertStyle.minHeight = 20;
  1336. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  1337. skin->setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  1338. GUIElementStyle colorPickerSlider2DHandleStyle;
  1339. colorPickerSlider2DHandleStyle.fixedHeight = true;
  1340. colorPickerSlider2DHandleStyle.fixedWidth = true;
  1341. colorPickerSlider2DHandleStyle.height = 8;
  1342. colorPickerSlider2DHandleStyle.width = 8;
  1343. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  1344. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1345. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1346. skin->setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  1347. /************************************************************************/
  1348. /* STATUS BAR */
  1349. /************************************************************************/
  1350. GUIElementStyle statusBarBgStyle;
  1351. statusBarBgStyle.height = 16;
  1352. statusBarBgStyle.border.top = 2;
  1353. statusBarBgStyle.normal.texture = getGUITexture(StatusBarBgTex);
  1354. skin->setStyle(GUIStatusBar::getGUIBackgroundTypeName(), statusBarBgStyle);
  1355. GUIElementStyle statusBarMessageBtnStyle;
  1356. statusBarMessageBtnStyle.font = font;
  1357. statusBarMessageBtnStyle.fontSize = DefaultFontSize;
  1358. statusBarMessageBtnStyle.fixedHeight = true;
  1359. statusBarMessageBtnStyle.height = 16;
  1360. statusBarMessageBtnStyle.minWidth = 10;
  1361. statusBarMessageBtnStyle.textHorzAlign = THA_Left;
  1362. statusBarMessageBtnStyle.textVertAlign = TVA_Center;
  1363. statusBarMessageBtnStyle.imagePosition = GUIImagePosition::Left;
  1364. skin->setStyle(GUIStatusBar::getGUIMessageTypeName(), statusBarMessageBtnStyle);
  1365. GUIElementStyle statusBarStyle;
  1366. statusBarStyle.height = 16;
  1367. statusBarStyle.subStyles[GUIStatusBar::getGUIBackgroundTypeName()] = GUIStatusBar::getGUIBackgroundTypeName();
  1368. statusBarStyle.subStyles[GUIStatusBar::getGUIMessageTypeName()] = GUIStatusBar::getGUIMessageTypeName();
  1369. skin->setStyle(GUIStatusBar::getGUITypeName(), statusBarStyle);
  1370. /************************************************************************/
  1371. /* OTHER */
  1372. /************************************************************************/
  1373. // Right-aligned label
  1374. GUIElementStyle rightAlignedLabelStyle;
  1375. rightAlignedLabelStyle.font = font;
  1376. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  1377. rightAlignedLabelStyle.fixedWidth = false;
  1378. rightAlignedLabelStyle.fixedHeight = true;
  1379. rightAlignedLabelStyle.height = 11;
  1380. rightAlignedLabelStyle.minWidth = 10;
  1381. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  1382. rightAlignedLabelStyle.normal.textColor = TextNormalColor;
  1383. skin->setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  1384. // Multi-line label
  1385. GUIElementStyle multiLinelabelStyle;
  1386. multiLinelabelStyle.font = font;
  1387. multiLinelabelStyle.fontSize = DefaultFontSize;
  1388. multiLinelabelStyle.fixedWidth = false;
  1389. multiLinelabelStyle.fixedHeight = true;
  1390. multiLinelabelStyle.height = 11;
  1391. multiLinelabelStyle.minWidth = 10;
  1392. multiLinelabelStyle.wordWrap = true;
  1393. multiLinelabelStyle.normal.textColor = TextNormalColor;
  1394. skin->setStyle("MultiLineLabel", multiLinelabelStyle);
  1395. // Multi-line centered label
  1396. GUIElementStyle multiLineCenteredLabelStyle;
  1397. multiLineCenteredLabelStyle.font = font;
  1398. multiLineCenteredLabelStyle.fontSize = DefaultFontSize;
  1399. multiLineCenteredLabelStyle.fixedWidth = false;
  1400. multiLineCenteredLabelStyle.fixedHeight = true;
  1401. multiLineCenteredLabelStyle.height = 11;
  1402. multiLineCenteredLabelStyle.minWidth = 10;
  1403. multiLineCenteredLabelStyle.wordWrap = true;
  1404. multiLineCenteredLabelStyle.textHorzAlign = THA_Center;
  1405. multiLineCenteredLabelStyle.normal.textColor = TextNormalColor;
  1406. skin->setStyle("MultiLineLabelCentered", multiLineCenteredLabelStyle);
  1407. // Selection area
  1408. GUIElementStyle selectionAreaStyle;
  1409. selectionAreaStyle.normal.texture = getGUITexture(SelectionAreaTex);
  1410. selectionAreaStyle.border.left = 1;
  1411. selectionAreaStyle.border.right = 1;
  1412. selectionAreaStyle.border.top = 1;
  1413. selectionAreaStyle.border.bottom = 1;
  1414. skin->setStyle("SelectionArea", selectionAreaStyle);
  1415. // Selectable label
  1416. GUIElementStyle selectableLabelStyle;
  1417. selectableLabelStyle.normalOn.texture = getGUITexture(SelectionBgTex);
  1418. selectableLabelStyle.hoverOn.texture = selectableLabelStyle.normalOn.texture;
  1419. selectableLabelStyle.activeOn.texture = selectableLabelStyle.normalOn.texture;
  1420. selectableLabelStyle.fixedHeight = true;
  1421. selectableLabelStyle.height = 11;
  1422. selectableLabelStyle.minWidth = 10;
  1423. selectableLabelStyle.font = font;
  1424. selectableLabelStyle.fontSize = DefaultFontSize;
  1425. selectableLabelStyle.textHorzAlign = THA_Left;
  1426. selectableLabelStyle.normal.textColor = TextNormalColor;
  1427. skin->setStyle("SelectableLabel", selectableLabelStyle);
  1428. // Scroll area background
  1429. GUIElementStyle scrollAreaBg;
  1430. scrollAreaBg.normal.texture = getGUITexture(ScrollAreaBgTex);
  1431. scrollAreaBg.minHeight = 6;
  1432. scrollAreaBg.minWidth = 4;
  1433. scrollAreaBg.border.left = 2;
  1434. scrollAreaBg.border.right = 2;
  1435. scrollAreaBg.border.top = 2;
  1436. scrollAreaBg.border.bottom = 4;
  1437. skin->setStyle("ScrollAreaBg", scrollAreaBg);
  1438. return skin;
  1439. }
  1440. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name)
  1441. {
  1442. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1443. texturePath.append(EditorSkinFolder);
  1444. texturePath.append(L"sprite_" + name + L".asset");
  1445. return Resources::instance().load<SpriteTexture>(texturePath);
  1446. }
  1447. HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name)
  1448. {
  1449. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1450. texturePath.append(EditorIconFolder);
  1451. texturePath.append(L"sprite_" + name + L".asset");
  1452. return Resources::instance().load<SpriteTexture>(texturePath);
  1453. }
  1454. HShader BuiltinEditorResources::getShader(const WString& name)
  1455. {
  1456. Path programPath = EditorShaderFolder;
  1457. programPath.append(name + L".asset");
  1458. return gResources().load<Shader>(programPath);
  1459. }
  1460. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1461. {
  1462. return Material::create(mShaderDockOverlay);
  1463. }
  1464. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1465. {
  1466. return Material::create(mShaderSceneGrid);
  1467. }
  1468. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1469. {
  1470. UINT32 modeIdx = (UINT32)cullMode;
  1471. return Material::create(mShaderPicking[modeIdx]);
  1472. }
  1473. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1474. {
  1475. UINT32 modeIdx = (UINT32)cullMode;
  1476. return Material::create(mShaderPickingAlpha[modeIdx]);
  1477. }
  1478. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1479. {
  1480. return Material::create(mShaderGizmoWire);
  1481. }
  1482. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1483. {
  1484. return Material::create(mShaderGizmoSolid);
  1485. }
  1486. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1487. {
  1488. return Material::create(mShaderGizmoIcon);
  1489. }
  1490. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1491. {
  1492. return Material::create(mShaderGizmoPicking);
  1493. }
  1494. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1495. {
  1496. return Material::create(mShaderGizmoAlphaPicking);
  1497. }
  1498. HMaterial BuiltinEditorResources::createWireHandleMat() const
  1499. {
  1500. return Material::create(mShaderHandleWire);
  1501. }
  1502. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1503. {
  1504. return Material::create(mShaderHandleSolid);
  1505. }
  1506. HMaterial BuiltinEditorResources::createSelectionMat() const
  1507. {
  1508. return Material::create(mShaderSelection);
  1509. }
  1510. HSpriteTexture BuiltinEditorResources::getLibraryIcon(ProjectIcon icon) const
  1511. {
  1512. switch (icon)
  1513. {
  1514. case ProjectIcon::Folder:
  1515. return getGUIIcon(FolderIconTex);
  1516. case ProjectIcon::Font:
  1517. return getGUIIcon(FontIconTex);
  1518. case ProjectIcon::Mesh:
  1519. return getGUIIcon(MeshIconTex);
  1520. case ProjectIcon::Texture:
  1521. return getGUIIcon(TextureIconTex);
  1522. case ProjectIcon::PlainText:
  1523. return getGUIIcon(PlainTextIconTex);
  1524. case ProjectIcon::ScriptCode:
  1525. return getGUIIcon(ScriptCodeIconTex);
  1526. case ProjectIcon::Shader:
  1527. return getGUIIcon(ShaderIconTex);
  1528. case ProjectIcon::ShaderInclude:
  1529. return getGUIIcon(ShaderIncludeIconTex);
  1530. case ProjectIcon::Material:
  1531. return getGUIIcon(MaterialIconTex);
  1532. case ProjectIcon::SpriteTexture:
  1533. return getGUIIcon(SpriteTextureIconTex);
  1534. case ProjectIcon::Prefab:
  1535. return getGUIIcon(PrefabIconTex);
  1536. }
  1537. return HSpriteTexture();
  1538. }
  1539. HSpriteTexture BuiltinEditorResources::getLogMessageIcon(LogMessageIcon icon) const
  1540. {
  1541. switch (icon)
  1542. {
  1543. case LogMessageIcon::Info:
  1544. return getGUIIcon(LogInfoIconTex);
  1545. case LogMessageIcon::Warning:
  1546. return getGUIIcon(LogWarningIconTex);
  1547. case LogMessageIcon::Error:
  1548. return getGUIIcon(LogErrorIconTex);
  1549. }
  1550. return HSpriteTexture();
  1551. }
  1552. }