BsBuiltinEditorResources.cpp 82 KB

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