BsBuiltinEditorResources.cpp 83 KB

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