BsBuiltinEditorResources.cpp 82 KB

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