BsBuiltinEditorResources.cpp 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354
  1. #include "BsBuiltinEditorResources.h"
  2. #include "BsGUIElementStyle.h"
  3. #include "BsGUILabel.h"
  4. #include "BsGUIButton.h"
  5. #include "BsGUIInputBox.h"
  6. #include "BsGUIToggle.h"
  7. #include "BsGUIColor.h"
  8. #include "BsTextSprite.h"
  9. #include "BsSpriteTexture.h"
  10. #include "BsGUITreeViewEditBox.h"
  11. #include "BsGUIIntField.h"
  12. #include "BsGUIFloatField.h"
  13. #include "BsGUIColorField.h"
  14. #include "BsGUITextField.h"
  15. #include "BsGUIToggleField.h"
  16. #include "BsGUIVector2Field.h"
  17. #include "BsGUIVector3Field.h"
  18. #include "BsGUIVector4Field.h"
  19. #include "BsGUIComponentFoldout.h"
  20. #include "BsGUIFoldout.h"
  21. #include "BsGUIProgressBar.h"
  22. #include "BsGUISlider.h"
  23. #include "BsGUIDropDownContent.h"
  24. #include "BsFont.h"
  25. #include "BsFontImportOptions.h"
  26. #include "BsImporter.h"
  27. #include "BsGpuProgram.h"
  28. #include "BsShader.h"
  29. #include "BsShaderInclude.h"
  30. #include "BsTechnique.h"
  31. #include "BsPass.h"
  32. #include "BsMaterial.h"
  33. #include "BsBlendState.h"
  34. #include "BsDepthStencilState.h"
  35. #include "BsRasterizerState.h"
  36. #include "BsResources.h"
  37. #include "BsRTTIType.h"
  38. #include "BsFileSystem.h"
  39. namespace BansheeEngine
  40. {
  41. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  42. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  43. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  44. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  45. const Path BuiltinEditorResources::DefaultSkinFolderRaw = L"..\\..\\..\\..\\Data\\Raw\\Editor\\Skin\\";
  46. const Path BuiltinEditorResources::DefaultShaderFolderRaw = L"..\\..\\..\\..\\Data\\Raw\\Editor\\Shaders\\";
  47. const Path BuiltinEditorResources::DefaultSkinFolder = L"..\\..\\..\\..\\Data\\Editor\\Skin\\";
  48. const Path BuiltinEditorResources::DefaultShaderFolder = L"..\\..\\..\\..\\Data\\Editor\\Shaders\\";
  49. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  50. const UINT32 BuiltinEditorResources::DefaultFontSize = 10;
  51. const WString BuiltinEditorResources::WindowBackgroundTexture = L"WindowBgTile.psd";
  52. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.psd";
  53. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.psd";
  54. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.psd";
  55. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.psd";
  56. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.psd";
  57. const WString BuiltinEditorResources::ToggleActiveTex = L"ToggleActive.psd";
  58. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleOnNormal.psd";
  59. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleOnHover.psd";
  60. const WString BuiltinEditorResources::ToggleActiveOnTex = L"ToggleOnActive.psd";
  61. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectFieldDropNormal.psd";
  62. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectFieldDropOnNormal.psd";
  63. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectFieldBtnNormal.psd";
  64. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectFieldBtnHover.psd";
  65. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectFieldBtnActive.psd";
  66. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutOpenNormal.psd";
  67. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutOpenHover.psd";
  68. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutClosedNormal.psd";
  69. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutClosedHover.psd";
  70. const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"CmpFoldoutOpenNormal.psd";
  71. const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"CmpFoldoutOpenHover.psd";
  72. const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"CmpFoldoutOpenActive.psd";
  73. const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"CmpFoldoutClosedNormal.psd";
  74. const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"CmpFoldoutClosedHover.psd";
  75. const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"CmpFoldoutClosedActive.psd";
  76. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.psd";
  77. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.psd";
  78. const WString BuiltinEditorResources::WindowTitleBarBg = L"WindowTitleBarBg.psd";
  79. const WString BuiltinEditorResources::WindowCloseButtonNormal = L"WindowCloseBtnNormal.psd";
  80. const WString BuiltinEditorResources::WindowCloseButtonHover = L"WindowCloseBtnHover.psd";
  81. const WString BuiltinEditorResources::WindowMinButtonNormal = L"WindowMinBtnNormal.psd";
  82. const WString BuiltinEditorResources::WindowMinButtonHover = L"WindowMinBtnHover.psd";
  83. const WString BuiltinEditorResources::WindowMaxButtonNormal = L"WindowMaxBtnNormal.psd";
  84. const WString BuiltinEditorResources::WindowMaxButtonHover = L"WindowMaxBtnHover.psd";
  85. const WString BuiltinEditorResources::TabbedBarBtnNormal = L"TabbedButtonNormal.psd";
  86. const WString BuiltinEditorResources::TabbedBarBtnActive = L"TabbedButtonActive.psd";
  87. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.psd";
  88. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.psd";
  89. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxFocused.psd";
  90. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollBarUpNormal.psd";
  91. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollBarUpHover.psd";
  92. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollBarUpActive.psd";
  93. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollBarDownNormal.psd";
  94. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollBarDownHover.psd";
  95. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollBarDownActive.psd";
  96. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollBarLeftNormal.psd";
  97. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollBarLeftHover.psd";
  98. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollBarLeftActive.psd";
  99. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollBarRightNormal.psd";
  100. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollBarRightHover.psd";
  101. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollBarRightActive.psd";
  102. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHorzHandleNormal.psd";
  103. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHorzHandleHover.psd";
  104. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHorzHandleActive.psd";
  105. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVertHandleNormal.psd";
  106. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVertHandleHover.psd";
  107. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVertHandleActive.psd";
  108. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownNormal.psd";
  109. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownHover.psd";
  110. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.psd";
  111. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownButtonNormal.psd";
  112. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownButtonHover.psd";
  113. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxBtnUpNormal.psd";
  114. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxBtnUpHover.psd";
  115. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxBtnDownNormal.psd";
  116. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxBtnDownHover.psd";
  117. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownExpNormal.psd";
  118. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownExpHover.psd";
  119. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownSeparator.psd";
  120. const WString BuiltinEditorResources::DropDownBoxBtnUpArrowTex = L"DropDownBoxBtnUpArrow.psd";
  121. const WString BuiltinEditorResources::DropDownBoxBtnDownArrowTex = L"DropDownBoxBtnDownArrow.psd";
  122. const WString BuiltinEditorResources::ScrollBarBgTex = L"ScrollBarBg.psd";
  123. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBg.psd";
  124. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.psd";
  125. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.psd";
  126. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarBansheeLogo.psd";
  127. const WString BuiltinEditorResources::DockSliderNormalTex = L"DockSliderBtn.psd";
  128. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"TreeViewExpandButtonOffNormal.psd";
  129. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"TreeViewExpandButtonOffHover.psd";
  130. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"TreeViewExpandButtonOnNormal.psd";
  131. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
  132. const WString BuiltinEditorResources::TreeViewSelectionBackground = L"TreeViewSelectionBackground.psd";
  133. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  134. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  135. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  136. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  137. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  138. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  139. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.psd";
  140. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.psd";
  141. /************************************************************************/
  142. /* SHADERS */
  143. /************************************************************************/
  144. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  145. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  146. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  147. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  148. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  149. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  150. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  151. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  152. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  153. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  154. const WString BuiltinEditorResources::ShaderWireHandleFile = L"WireHandle.bsl";
  155. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  156. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  157. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  158. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  159. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  160. BuiltinEditorResources::BuiltinEditorResources()
  161. {
  162. preprocess();
  163. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  164. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  165. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  166. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  167. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  168. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  169. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  170. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  171. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  172. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  173. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  174. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  175. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  176. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  177. mShaderHandleWire = getShader(ShaderWireHandleFile);
  178. mShaderSelection = getShader(ShaderSelectionFile);
  179. Path fontPath = FileSystem::getWorkingDirectoryPath();
  180. fontPath.append(DefaultSkinFolder);
  181. fontPath.append(DefaultFontFilename + L".asset");
  182. HFont font = Resources::instance().load<Font>(fontPath);
  183. // Label
  184. GUIElementStyle labelStyle;
  185. labelStyle.font = font;
  186. labelStyle.fontSize = DefaultFontSize;
  187. labelStyle.fixedWidth = false;
  188. labelStyle.fixedHeight = true;
  189. labelStyle.height = 11;
  190. labelStyle.minWidth = 10;
  191. mSkin.setStyle(GUILabel::getGUITypeName(), labelStyle);
  192. // Window frame
  193. GUIElementStyle windowFrameStyle;
  194. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  195. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  196. windowFrameStyle.border.left = 1;
  197. windowFrameStyle.border.right = 1;
  198. windowFrameStyle.border.top = 1;
  199. windowFrameStyle.border.bottom = 1;
  200. mSkin.setStyle("WindowFrame", windowFrameStyle);
  201. // Button
  202. GUIElementStyle buttonStyle;
  203. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  204. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  205. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  206. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  207. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  208. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  209. buttonStyle.border.left = 6;
  210. buttonStyle.border.right = 6;
  211. buttonStyle.border.top = 6;
  212. buttonStyle.border.bottom = 6;
  213. buttonStyle.contentOffset.left = 3;
  214. buttonStyle.contentOffset.right = 3;
  215. buttonStyle.fixedHeight = true;
  216. buttonStyle.height = 15;
  217. buttonStyle.minWidth = 50;
  218. buttonStyle.font = font;
  219. buttonStyle.fontSize = DefaultFontSize;
  220. buttonStyle.textHorzAlign = THA_Center;
  221. buttonStyle.textVertAlign = TVA_Center;
  222. mSkin.setStyle(GUIButton::getGUITypeName(), buttonStyle);
  223. // Toggle
  224. GUIElementStyle toggleStyle;
  225. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  226. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  227. toggleStyle.active.texture = getGUITexture(ToggleActiveTex);
  228. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  229. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  230. toggleStyle.activeOn.texture = getGUITexture(ToggleActiveOnTex);
  231. toggleStyle.fixedHeight = true;
  232. toggleStyle.fixedWidth = true;
  233. toggleStyle.height = 15;
  234. toggleStyle.width = 15;
  235. mSkin.setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  236. // Color
  237. GUIElementStyle colorStyle;
  238. colorStyle.margins.left = 2;
  239. colorStyle.margins.right = 2;
  240. colorStyle.margins.top = 2;
  241. colorStyle.margins.bottom = 2;
  242. colorStyle.fixedHeight = true;
  243. colorStyle.height = 10;
  244. colorStyle.minWidth = 10;
  245. mSkin.setStyle(GUIColor::getGUITypeName(), colorStyle);
  246. // Window background texture
  247. GUIElementStyle windowBgStyle;
  248. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTexture);
  249. mSkin.setStyle("WindowBackground", windowBgStyle);
  250. // Window title bar background
  251. GUIElementStyle titleBarBgStyle;
  252. titleBarBgStyle.normal.texture = getGUITexture(WindowTitleBarBg);
  253. titleBarBgStyle.fixedHeight = true;
  254. titleBarBgStyle.height = 13;
  255. mSkin.setStyle("TitleBarBackground", titleBarBgStyle);
  256. // Tabbed title bar tab button
  257. GUIElementStyle tabbedBarButton;
  258. tabbedBarButton.normal.texture = getGUITexture(TabbedBarBtnNormal);
  259. tabbedBarButton.hover.texture = getGUITexture(TabbedBarBtnActive);
  260. tabbedBarButton.active.texture = tabbedBarButton.hover.texture;
  261. tabbedBarButton.normalOn.texture = tabbedBarButton.hover.texture;
  262. tabbedBarButton.hoverOn.texture = tabbedBarButton.hover.texture;
  263. tabbedBarButton.activeOn.texture = tabbedBarButton.hover.texture;
  264. tabbedBarButton.fixedHeight = true;
  265. tabbedBarButton.height = 13;
  266. tabbedBarButton.minWidth = 10;
  267. tabbedBarButton.maxWidth = 110;
  268. tabbedBarButton.font = font;
  269. tabbedBarButton.fontSize = DefaultFontSize;
  270. tabbedBarButton.textHorzAlign = THA_Center;
  271. tabbedBarButton.textVertAlign = TVA_Center;
  272. mSkin.setStyle("TabbedBarBtn", tabbedBarButton);
  273. // Tabbed title bar drag/drop button
  274. GUIElementStyle tabbedBarDropButton;
  275. tabbedBarDropButton.fixedHeight = true;
  276. tabbedBarDropButton.fixedWidth = true;
  277. tabbedBarDropButton.height = 13;
  278. tabbedBarDropButton.width = 6;
  279. mSkin.setStyle("TabbedBarDropArea", tabbedBarDropButton);
  280. // Window minimize button
  281. GUIElementStyle winMinButtonStyle;
  282. winMinButtonStyle.normal.texture = getGUITexture(WindowMinButtonNormal);
  283. winMinButtonStyle.hover.texture = getGUITexture(WindowMinButtonHover);
  284. winMinButtonStyle.active.texture = winMinButtonStyle.hover.texture;
  285. winMinButtonStyle.fixedHeight = true;
  286. winMinButtonStyle.fixedWidth = true;
  287. winMinButtonStyle.height = 7;
  288. winMinButtonStyle.width = 8;
  289. mSkin.setStyle("WinMinimizeBtn", winMinButtonStyle);
  290. // Window maximize button
  291. GUIElementStyle winMaxButtonStyle;
  292. winMaxButtonStyle.normal.texture = getGUITexture(WindowMaxButtonNormal);
  293. winMaxButtonStyle.hover.texture = getGUITexture(WindowMaxButtonHover);
  294. winMaxButtonStyle.active.texture = winMaxButtonStyle.hover.texture;
  295. winMaxButtonStyle.fixedHeight = true;
  296. winMaxButtonStyle.fixedWidth = true;
  297. winMaxButtonStyle.height = 8;
  298. winMaxButtonStyle.width = 8;
  299. mSkin.setStyle("WinMaximizeBtn", winMaxButtonStyle);
  300. // Window close button
  301. GUIElementStyle winCloseButtonStyle;
  302. winCloseButtonStyle.normal.texture = getGUITexture(WindowCloseButtonNormal);
  303. winCloseButtonStyle.hover.texture = getGUITexture(WindowCloseButtonHover);
  304. winCloseButtonStyle.active.texture = winCloseButtonStyle.hover.texture;
  305. winCloseButtonStyle.fixedHeight = true;
  306. winCloseButtonStyle.fixedWidth = true;
  307. winCloseButtonStyle.height = 7;
  308. winCloseButtonStyle.width = 8;
  309. mSkin.setStyle("WinCloseBtn", winCloseButtonStyle);
  310. // Input box
  311. GUIElementStyle inputBoxStyle;
  312. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  313. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  314. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  315. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  316. inputBoxStyle.border.left = 1;
  317. inputBoxStyle.border.right = 1;
  318. inputBoxStyle.border.top = 1;
  319. inputBoxStyle.border.bottom = 1;
  320. inputBoxStyle.contentOffset.left = 3;
  321. inputBoxStyle.contentOffset.right = 3;
  322. inputBoxStyle.contentOffset.top = 2;
  323. inputBoxStyle.contentOffset.bottom = 2;
  324. inputBoxStyle.fixedHeight = true;
  325. inputBoxStyle.height = 15;
  326. inputBoxStyle.minWidth = 10;
  327. inputBoxStyle.font = font;
  328. inputBoxStyle.fontSize = DefaultFontSize;
  329. inputBoxStyle.textHorzAlign = THA_Left;
  330. inputBoxStyle.textVertAlign = TVA_Top;
  331. mSkin.setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  332. /************************************************************************/
  333. /* SCROLL BAR */
  334. /************************************************************************/
  335. // Up button
  336. GUIElementStyle scrollUpBtnStyle;
  337. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  338. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  339. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  340. scrollUpBtnStyle.fixedHeight = true;
  341. scrollUpBtnStyle.fixedWidth = true;
  342. scrollUpBtnStyle.height = 4;
  343. scrollUpBtnStyle.width = 8;
  344. mSkin.setStyle("ScrollUpBtn", scrollUpBtnStyle);
  345. // Down button
  346. GUIElementStyle scrollDownBtnStyle;
  347. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  348. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  349. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  350. scrollDownBtnStyle.fixedHeight = true;
  351. scrollDownBtnStyle.fixedWidth = true;
  352. scrollDownBtnStyle.height = 4;
  353. scrollDownBtnStyle.width = 8;
  354. mSkin.setStyle("ScrollDownBtn", scrollDownBtnStyle);
  355. // Left button
  356. GUIElementStyle scrollLeftBtnStyle;
  357. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  358. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  359. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  360. scrollLeftBtnStyle.fixedHeight = true;
  361. scrollLeftBtnStyle.fixedWidth = true;
  362. scrollLeftBtnStyle.height = 8;
  363. scrollLeftBtnStyle.width = 4;
  364. mSkin.setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  365. // Right button
  366. GUIElementStyle scrollRightBtnStyle;
  367. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  368. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  369. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  370. scrollRightBtnStyle.fixedHeight = true;
  371. scrollRightBtnStyle.fixedWidth = true;
  372. scrollRightBtnStyle.height = 8;
  373. scrollRightBtnStyle.width = 4;
  374. mSkin.setStyle("ScrollRightBtn", scrollRightBtnStyle);
  375. // Horizontal handle
  376. GUIElementStyle scrollBarHorzBtnStyle;
  377. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  378. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  379. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  380. scrollBarHorzBtnStyle.fixedHeight = true;
  381. scrollBarHorzBtnStyle.fixedWidth = true;
  382. scrollBarHorzBtnStyle.height = 6;
  383. scrollBarHorzBtnStyle.width = 4;
  384. mSkin.setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  385. // Vertical handle
  386. GUIElementStyle scrollBarVertBtnStyle;
  387. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  388. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  389. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  390. scrollBarVertBtnStyle.fixedHeight = true;
  391. scrollBarVertBtnStyle.fixedWidth = true;
  392. scrollBarVertBtnStyle.height = 4;
  393. scrollBarVertBtnStyle.width = 6;
  394. mSkin.setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  395. HSpriteTexture scrollBarBgPtr = getGUITexture(ScrollBarBgTex);
  396. // Vertical scroll bar
  397. GUIElementStyle vertScrollBarStyle;
  398. vertScrollBarStyle.normal.texture = scrollBarBgPtr;
  399. vertScrollBarStyle.hover.texture = scrollBarBgPtr;
  400. vertScrollBarStyle.active.texture = scrollBarBgPtr;
  401. vertScrollBarStyle.fixedHeight = false;
  402. vertScrollBarStyle.fixedWidth = true;
  403. vertScrollBarStyle.minHeight = 16;
  404. vertScrollBarStyle.width = 8;
  405. mSkin.setStyle("ScrollBarVert", vertScrollBarStyle);
  406. // Horizontal scroll bar
  407. GUIElementStyle horzScrollBarStyle;
  408. horzScrollBarStyle.normal.texture = scrollBarBgPtr;
  409. horzScrollBarStyle.hover.texture = scrollBarBgPtr;
  410. horzScrollBarStyle.active.texture = scrollBarBgPtr;
  411. horzScrollBarStyle.fixedHeight = true;
  412. horzScrollBarStyle.fixedWidth = false;
  413. horzScrollBarStyle.minWidth = 16;
  414. horzScrollBarStyle.height = 8;
  415. mSkin.setStyle("ScrollBarHorz", horzScrollBarStyle);
  416. /************************************************************************/
  417. /* DROP DOWN BOX */
  418. /************************************************************************/
  419. // ListBox button
  420. GUIElementStyle dropDownListStyle;
  421. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  422. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  423. dropDownListStyle.active.texture = dropDownListStyle.hover.texture;
  424. dropDownListStyle.normalOn.texture = dropDownListStyle.hover.texture;
  425. dropDownListStyle.hoverOn.texture = dropDownListStyle.hover.texture;
  426. dropDownListStyle.activeOn.texture = dropDownListStyle.hover.texture;
  427. dropDownListStyle.fixedHeight = true;
  428. dropDownListStyle.fixedWidth = false;
  429. dropDownListStyle.height = 13;
  430. dropDownListStyle.width = 30;
  431. dropDownListStyle.contentOffset.left = 3;
  432. dropDownListStyle.contentOffset.right = 11;
  433. dropDownListStyle.contentOffset.top = 1;
  434. dropDownListStyle.contentOffset.bottom = 1;
  435. dropDownListStyle.border.left = 1;
  436. dropDownListStyle.border.right = 10;
  437. dropDownListStyle.border.top = 1;
  438. dropDownListStyle.border.bottom = 1;
  439. dropDownListStyle.font = font;
  440. dropDownListStyle.fontSize = DefaultFontSize;
  441. dropDownListStyle.textHorzAlign = THA_Left;
  442. dropDownListStyle.textVertAlign = TVA_Top;
  443. mSkin.setStyle("ListBox", dropDownListStyle);
  444. // DropDown scroll up button arrow
  445. HSpriteTexture dropDownBtnScrollUpArrow = getGUITexture(DropDownBoxBtnUpArrowTex);
  446. GUIElementStyle dropDownScrollUpBtnArrowStyle;
  447. dropDownScrollUpBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnUpArrowTex);
  448. dropDownScrollUpBtnArrowStyle.hover.texture = dropDownScrollUpBtnArrowStyle.normal.texture;
  449. dropDownScrollUpBtnArrowStyle.active.texture = dropDownScrollUpBtnArrowStyle.hover.texture;
  450. dropDownScrollUpBtnArrowStyle.fixedHeight = true;
  451. dropDownScrollUpBtnArrowStyle.fixedWidth = false;
  452. dropDownScrollUpBtnArrowStyle.height = 7;
  453. dropDownScrollUpBtnArrowStyle.width = 30;
  454. dropDownScrollUpBtnArrowStyle.border.left = 1;
  455. dropDownScrollUpBtnArrowStyle.border.right = 1;
  456. dropDownScrollUpBtnArrowStyle.border.top = 1;
  457. dropDownScrollUpBtnArrowStyle.border.bottom = 1;
  458. mSkin.setStyle("ListBoxScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  459. mSkin.setStyle("MenuBarScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  460. mSkin.setStyle("ContextMenuScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  461. // DropDown scroll up button
  462. GUIElementStyle dropDownScrollUpBtnStyle;
  463. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  464. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  465. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  466. dropDownScrollUpBtnStyle.fixedHeight = true;
  467. dropDownScrollUpBtnStyle.fixedWidth = false;
  468. dropDownScrollUpBtnStyle.height = 7;
  469. dropDownScrollUpBtnStyle.width = 30;
  470. dropDownScrollUpBtnStyle.border.left = 1;
  471. dropDownScrollUpBtnStyle.border.right = 1;
  472. dropDownScrollUpBtnStyle.border.top = 1;
  473. dropDownScrollUpBtnStyle.border.bottom = 1;
  474. mSkin.setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  475. mSkin.setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  476. mSkin.setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  477. // DropDown scroll down button arrow
  478. GUIElementStyle dropDownScrollDownBtnArrowStyle;
  479. dropDownScrollDownBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnDownArrowTex);
  480. dropDownScrollDownBtnArrowStyle.hover.texture = dropDownScrollDownBtnArrowStyle.normal.texture;
  481. dropDownScrollDownBtnArrowStyle.active.texture = dropDownScrollDownBtnArrowStyle.hover.texture;
  482. dropDownScrollDownBtnArrowStyle.fixedHeight = true;
  483. dropDownScrollDownBtnArrowStyle.fixedWidth = false;
  484. dropDownScrollDownBtnArrowStyle.height = 7;
  485. dropDownScrollDownBtnArrowStyle.width = 30;
  486. dropDownScrollDownBtnArrowStyle.border.left = 1;
  487. dropDownScrollDownBtnArrowStyle.border.right = 1;
  488. dropDownScrollDownBtnArrowStyle.border.top = 1;
  489. dropDownScrollDownBtnArrowStyle.border.bottom = 1;
  490. mSkin.setStyle("ListBoxScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  491. mSkin.setStyle("MenuBarScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  492. mSkin.setStyle("ContextMenuScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  493. // DropDown scroll down button
  494. GUIElementStyle dropDownScrollDownBtnStyle;
  495. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  496. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  497. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  498. dropDownScrollDownBtnStyle.fixedHeight = true;
  499. dropDownScrollDownBtnStyle.fixedWidth = false;
  500. dropDownScrollDownBtnStyle.height = 7;
  501. dropDownScrollDownBtnStyle.width = 30;
  502. dropDownScrollDownBtnStyle.border.left = 1;
  503. dropDownScrollDownBtnStyle.border.right = 1;
  504. dropDownScrollDownBtnStyle.border.top = 1;
  505. dropDownScrollDownBtnStyle.border.bottom = 1;
  506. mSkin.setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  507. mSkin.setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  508. mSkin.setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  509. // DropDown entry button
  510. GUIElementStyle dropDownEntryBtnStyle;
  511. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  512. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  513. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  514. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  515. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  516. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  517. dropDownEntryBtnStyle.fixedHeight = true;
  518. dropDownEntryBtnStyle.fixedWidth = false;
  519. dropDownEntryBtnStyle.height = 14;
  520. dropDownEntryBtnStyle.width = 30;
  521. dropDownEntryBtnStyle.border.left = 1;
  522. dropDownEntryBtnStyle.border.right = 1;
  523. dropDownEntryBtnStyle.border.top = 1;
  524. dropDownEntryBtnStyle.border.bottom = 1;
  525. dropDownEntryBtnStyle.font = font;
  526. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  527. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  528. dropDownEntryBtnStyle.textVertAlign = TVA_Top;
  529. mSkin.setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  530. // DropDown entry button with expand
  531. GUIElementStyle dropDownEntryExpBtnStyle;
  532. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  533. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  534. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  535. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  536. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  537. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  538. dropDownEntryExpBtnStyle.fixedHeight = true;
  539. dropDownEntryExpBtnStyle.fixedWidth = false;
  540. dropDownEntryExpBtnStyle.height = 14;
  541. dropDownEntryExpBtnStyle.width = 30;
  542. dropDownEntryExpBtnStyle.border.left = 1;
  543. dropDownEntryExpBtnStyle.border.right = 6;
  544. dropDownEntryExpBtnStyle.border.top = 1;
  545. dropDownEntryExpBtnStyle.border.bottom = 1;
  546. dropDownEntryExpBtnStyle.font = font;
  547. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  548. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  549. dropDownEntryExpBtnStyle.textVertAlign = TVA_Top;
  550. mSkin.setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  551. // Drop down separator
  552. GUIElementStyle dropDownSeparatorStyle;
  553. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  554. dropDownSeparatorStyle.fixedHeight = true;
  555. dropDownSeparatorStyle.fixedWidth = false;
  556. dropDownSeparatorStyle.height = 3;
  557. dropDownSeparatorStyle.width = 30;
  558. dropDownSeparatorStyle.border.left = 1;
  559. dropDownSeparatorStyle.border.right = 1;
  560. dropDownSeparatorStyle.border.top = 1;
  561. dropDownSeparatorStyle.border.bottom = 1;
  562. mSkin.setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  563. // Drop down content
  564. GUIElementStyle dropDownContentStyle;
  565. dropDownContentStyle.minWidth = 50;
  566. dropDownContentStyle.minHeight = 20;
  567. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  568. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  569. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  570. mSkin.setStyle("ListBoxContent", dropDownContentStyle);
  571. mSkin.setStyle("MenuBarContent", dropDownContentStyle);
  572. mSkin.setStyle("ContextMenuContent", dropDownContentStyle);
  573. // DropDown box frame
  574. GUIElementStyle dropDownBoxStyle;
  575. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  576. dropDownBoxStyle.hover.texture = dropDownEntryBtnStyle.normal.texture;
  577. dropDownBoxStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  578. dropDownBoxStyle.fixedHeight = false;
  579. dropDownBoxStyle.fixedWidth = false;
  580. dropDownBoxStyle.border.left = 1;
  581. dropDownBoxStyle.border.right = 1;
  582. dropDownBoxStyle.border.top = 1;
  583. dropDownBoxStyle.border.bottom = 1;
  584. dropDownBoxStyle.margins.left = 1;
  585. dropDownBoxStyle.margins.right = 1;
  586. dropDownBoxStyle.margins.top = 1;
  587. dropDownBoxStyle.margins.bottom = 1;
  588. mSkin.setStyle("ListBoxFrame", dropDownBoxStyle);
  589. mSkin.setStyle("MenuBarFrame", dropDownBoxStyle);
  590. mSkin.setStyle("ContextMenuFrame", dropDownBoxStyle);
  591. /************************************************************************/
  592. /* MENU BAR */
  593. /************************************************************************/
  594. // MenuBar background
  595. GUIElementStyle menuBarBgStyle;
  596. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  597. menuBarBgStyle.fixedHeight = false;
  598. menuBarBgStyle.fixedWidth = false;
  599. menuBarBgStyle.height = 4;
  600. menuBarBgStyle.width = 4;
  601. mSkin.setStyle("MenuBarBg", menuBarBgStyle);
  602. // MenuBar Banshee logo
  603. GUIElementStyle menuBarBansheeLogoStyle;
  604. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  605. menuBarBansheeLogoStyle.fixedHeight = true;
  606. menuBarBansheeLogoStyle.fixedWidth = true;
  607. menuBarBansheeLogoStyle.height = 7;
  608. menuBarBansheeLogoStyle.width = 51;
  609. mSkin.setStyle("MenuBarBansheeLogo", menuBarBansheeLogoStyle);
  610. // MenuBar button
  611. GUIElementStyle menuBarBtnStyle;
  612. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  613. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  614. menuBarBtnStyle.active.texture = menuBarBtnStyle.hover.texture;
  615. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.hover.texture;
  616. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.hover.texture;
  617. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.hover.texture;
  618. menuBarBtnStyle.fixedHeight = true;
  619. menuBarBtnStyle.fixedWidth = false;
  620. menuBarBtnStyle.height = 15;
  621. menuBarBtnStyle.width = 4;
  622. menuBarBtnStyle.margins.left = 2;
  623. menuBarBtnStyle.margins.right = 2;
  624. menuBarBtnStyle.margins.top = 2;
  625. menuBarBtnStyle.margins.bottom = 2;
  626. menuBarBtnStyle.font = font;
  627. menuBarBtnStyle.fontSize = DefaultFontSize;
  628. menuBarBtnStyle.textHorzAlign = THA_Left;
  629. menuBarBtnStyle.textVertAlign = TVA_Top;
  630. mSkin.setStyle("MenuBarBtn", menuBarBtnStyle);
  631. /************************************************************************/
  632. /* DOCK SLIDER */
  633. /************************************************************************/
  634. GUIElementStyle dockSliderBtnStyle;
  635. dockSliderBtnStyle.normal.texture = getGUITexture(DockSliderNormalTex);
  636. dockSliderBtnStyle.fixedHeight = false;
  637. dockSliderBtnStyle.fixedWidth = false;
  638. dockSliderBtnStyle.height = 2;
  639. dockSliderBtnStyle.width = 2;
  640. mSkin.setStyle("DockSliderBtn", dockSliderBtnStyle);
  641. /************************************************************************/
  642. /* TREE VIEW */
  643. /************************************************************************/
  644. // Expand button
  645. GUIElementStyle treeViewExpandButtonStyle;
  646. treeViewExpandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  647. treeViewExpandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  648. treeViewExpandButtonStyle.active.texture = treeViewExpandButtonStyle.hover.texture;
  649. treeViewExpandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  650. treeViewExpandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  651. treeViewExpandButtonStyle.activeOn.texture = treeViewExpandButtonStyle.hoverOn.texture;
  652. treeViewExpandButtonStyle.margins.left = 4;
  653. treeViewExpandButtonStyle.margins.right = 4;
  654. treeViewExpandButtonStyle.margins.top = 5;
  655. treeViewExpandButtonStyle.margins.bottom = 4;
  656. treeViewExpandButtonStyle.fixedHeight = true;
  657. treeViewExpandButtonStyle.fixedWidth = true;
  658. treeViewExpandButtonStyle.height = 16;
  659. treeViewExpandButtonStyle.width = 16;
  660. mSkin.setStyle("TreeViewFoldoutBtn", treeViewExpandButtonStyle);
  661. // Entry
  662. GUIElementStyle treeViewEntryStyle;
  663. treeViewEntryStyle.font = font;
  664. treeViewEntryStyle.fontSize = DefaultFontSize;
  665. treeViewEntryStyle.fixedWidth = false;
  666. treeViewEntryStyle.fixedHeight = true;
  667. treeViewEntryStyle.height = 16;
  668. treeViewEntryStyle.minWidth = 10;
  669. mSkin.setStyle("TreeViewElementBtn", treeViewEntryStyle);
  670. // Selection background
  671. GUIElementStyle treeViewSelBackgroundStyle;
  672. treeViewSelBackgroundStyle.normal.texture = getGUITexture(TreeViewSelectionBackground);
  673. treeViewSelBackgroundStyle.fixedHeight = false;
  674. treeViewSelBackgroundStyle.fixedWidth = false;
  675. treeViewSelBackgroundStyle.height = 2;
  676. treeViewSelBackgroundStyle.width = 2;
  677. mSkin.setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  678. // Edit box
  679. GUIElementStyle treeViewEditBox;
  680. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  681. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  682. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  683. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  684. treeViewEditBox.border.left = 1;
  685. treeViewEditBox.border.right = 1;
  686. treeViewEditBox.border.top = 1;
  687. treeViewEditBox.border.bottom = 1;
  688. treeViewEditBox.margins.left = 1;
  689. treeViewEditBox.margins.right = 1;
  690. treeViewEditBox.margins.top = 1;
  691. treeViewEditBox.margins.bottom = 1;
  692. treeViewEditBox.fixedHeight = true;
  693. treeViewEditBox.height = 13;
  694. treeViewEditBox.minWidth = 10;
  695. treeViewEditBox.font = font;
  696. treeViewEditBox.fontSize = DefaultFontSize;
  697. treeViewEditBox.textHorzAlign = THA_Left;
  698. treeViewEditBox.textVertAlign = TVA_Top;
  699. mSkin.setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  700. // Element highlight
  701. GUIElementStyle treeViewElementHighlight;
  702. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  703. treeViewElementHighlight.border.left = 1;
  704. treeViewElementHighlight.border.right = 1;
  705. treeViewElementHighlight.border.top = 1;
  706. treeViewElementHighlight.border.bottom = 1;
  707. mSkin.setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  708. // Element separator highlight
  709. GUIElementStyle treeViewElementSepHighlight;
  710. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  711. treeViewElementSepHighlight.border.left = 1;
  712. treeViewElementSepHighlight.border.right = 1;
  713. treeViewElementSepHighlight.border.top = 1;
  714. treeViewElementSepHighlight.border.bottom = 1;
  715. mSkin.setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  716. /************************************************************************/
  717. /* OBJECT DROP FIELD */
  718. /************************************************************************/
  719. GUIElementStyle objectDropStyle;
  720. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  721. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  722. objectDropStyle.fixedHeight = true;
  723. objectDropStyle.height = 15;
  724. objectDropStyle.minWidth = 50;
  725. objectDropStyle.font = font;
  726. objectDropStyle.fontSize = DefaultFontSize;
  727. objectDropStyle.textHorzAlign = THA_Center;
  728. objectDropStyle.textVertAlign = TVA_Center;
  729. mSkin.setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  730. GUIElementStyle objectClearBtnStyle;
  731. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  732. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  733. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  734. objectClearBtnStyle.fixedHeight = true;
  735. objectClearBtnStyle.fixedWidth = true;
  736. objectClearBtnStyle.height = 15;
  737. objectClearBtnStyle.width = 13;
  738. mSkin.setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  739. GUIElementStyle editorObjectFieldStyle;
  740. editorObjectFieldStyle.fixedHeight = true;
  741. editorObjectFieldStyle.height = 15;
  742. editorObjectFieldStyle.minWidth = 30;
  743. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  744. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  745. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  746. mSkin.setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  747. /************************************************************************/
  748. /* EDITOR FIELDS */
  749. /************************************************************************/
  750. GUIElementStyle editorFieldLabelStyle;
  751. editorFieldLabelStyle.font = font;
  752. editorFieldLabelStyle.fontSize = DefaultFontSize;
  753. editorFieldLabelStyle.fixedWidth = false;
  754. editorFieldLabelStyle.fixedHeight = true;
  755. editorFieldLabelStyle.height = 11;
  756. editorFieldLabelStyle.minWidth = 10;
  757. editorFieldLabelStyle.textHorzAlign = THA_Left;
  758. mSkin.setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  759. GUIElementStyle editorIntFieldStyle;
  760. editorIntFieldStyle.fixedHeight = true;
  761. editorIntFieldStyle.height = 15;
  762. editorIntFieldStyle.minWidth = 30;
  763. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  764. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  765. mSkin.setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  766. GUIElementStyle editorFloatFieldStyle;
  767. editorFloatFieldStyle.fixedHeight = true;
  768. editorFloatFieldStyle.height = 15;
  769. editorFloatFieldStyle.minWidth = 30;
  770. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  771. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  772. mSkin.setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  773. GUIElementStyle editorTextFieldStyle;
  774. editorTextFieldStyle.fixedHeight = true;
  775. editorTextFieldStyle.height = 15;
  776. editorTextFieldStyle.minWidth = 30;
  777. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  778. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  779. mSkin.setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  780. GUIElementStyle editorColorFieldStyle;
  781. editorColorFieldStyle.fixedHeight = true;
  782. editorColorFieldStyle.height = 15;
  783. editorColorFieldStyle.minWidth = 30;
  784. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  785. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  786. mSkin.setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  787. GUIElementStyle editorToggleFieldStyle;
  788. editorToggleFieldStyle.fixedHeight = true;
  789. editorToggleFieldStyle.height = 15;
  790. editorToggleFieldStyle.minWidth = 30;
  791. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  792. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  793. mSkin.setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  794. GUIElementStyle editorVector2FieldStyle;
  795. editorVector2FieldStyle.fixedHeight = true;
  796. editorVector2FieldStyle.height = 30;
  797. editorVector2FieldStyle.minWidth = 30;
  798. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  799. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  800. mSkin.setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  801. GUIElementStyle editorVector3FieldStyle;
  802. editorVector3FieldStyle.fixedHeight = true;
  803. editorVector3FieldStyle.height = 30;
  804. editorVector3FieldStyle.minWidth = 30;
  805. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  806. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  807. mSkin.setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  808. GUIElementStyle editorVector4FieldStyle;
  809. editorVector4FieldStyle.fixedHeight = true;
  810. editorVector4FieldStyle.height = 30;
  811. editorVector4FieldStyle.minWidth = 30;
  812. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  813. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  814. mSkin.setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  815. /************************************************************************/
  816. /* COMPONENT FOLDOUT */
  817. /************************************************************************/
  818. GUIElementStyle cmpFoldoutBtnStyle;
  819. cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
  820. cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
  821. cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  822. cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
  823. cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
  824. cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  825. cmpFoldoutBtnStyle.fixedHeight = true;
  826. cmpFoldoutBtnStyle.fixedWidth = false;
  827. cmpFoldoutBtnStyle.height = 10;
  828. cmpFoldoutBtnStyle.minWidth = 10;
  829. cmpFoldoutBtnStyle.font = font;
  830. cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
  831. cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
  832. cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
  833. cmpFoldoutBtnStyle.contentOffset = RectOffset(12, 0, 0, 0);
  834. cmpFoldoutBtnStyle.border.left = 8;
  835. mSkin.setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
  836. GUIElementStyle cmpFoldoutStyle;
  837. cmpFoldoutStyle.fixedHeight = true;
  838. cmpFoldoutStyle.height = 12;
  839. cmpFoldoutStyle.minWidth = 30;
  840. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
  841. mSkin.setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
  842. /************************************************************************/
  843. /* FOLDOUT */
  844. /************************************************************************/
  845. GUIElementStyle foldoutBtnStyle;
  846. foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  847. foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  848. foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
  849. foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  850. foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  851. foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
  852. foldoutBtnStyle.fixedHeight = true;
  853. foldoutBtnStyle.fixedWidth = true;
  854. foldoutBtnStyle.height = 10;
  855. foldoutBtnStyle.width = 8;
  856. mSkin.setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
  857. GUIElementStyle foldoutStyle;
  858. foldoutStyle.fixedHeight = true;
  859. foldoutStyle.height = 12;
  860. foldoutStyle.minWidth = 30;
  861. foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
  862. foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
  863. mSkin.setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
  864. /************************************************************************/
  865. /* PROGRESS BAR */
  866. /************************************************************************/
  867. GUIElementStyle progressBarBgStyle;
  868. progressBarBgStyle.fixedHeight = true;
  869. progressBarBgStyle.height = 18;
  870. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  871. mSkin.setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  872. GUIElementStyle progressBarFillStyle;
  873. progressBarFillStyle.fixedHeight = true;
  874. progressBarFillStyle.height = 12;
  875. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  876. mSkin.setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  877. GUIElementStyle progressBarStyle;
  878. progressBarStyle.fixedHeight = true;
  879. progressBarStyle.height = 18;
  880. progressBarStyle.minWidth = 100;
  881. progressBarStyle.margins.top = 3;
  882. progressBarStyle.margins.bottom = 3;
  883. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  884. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  885. mSkin.setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  886. /************************************************************************/
  887. /* COLOR PICKER SLIDER */
  888. /************************************************************************/
  889. GUIElementStyle colorPickerSliderHorzHandleStyle;
  890. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  891. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  892. colorPickerSliderHorzHandleStyle.height = 20;
  893. colorPickerSliderHorzHandleStyle.width = 7;
  894. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  895. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  896. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  897. mSkin.setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  898. GUIElementStyle colorPickerSliderHorzStyle;
  899. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  900. colorPickerSliderHorzHandleStyle.height = 32;
  901. colorPickerSliderHorzHandleStyle.minWidth = 20;
  902. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  903. mSkin.setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  904. GUIElementStyle colorPickerSliderVertHandleStyle;
  905. colorPickerSliderVertHandleStyle.fixedHeight = true;
  906. colorPickerSliderVertHandleStyle.fixedWidth = true;
  907. colorPickerSliderVertHandleStyle.height = 7;
  908. colorPickerSliderVertHandleStyle.width = 45;
  909. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  910. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  911. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  912. mSkin.setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  913. GUIElementStyle colorPickerSliderVertStyle;
  914. colorPickerSliderVertStyle.fixedWidth = true;
  915. colorPickerSliderVertStyle.width = 30;
  916. colorPickerSliderVertStyle.minHeight = 20;
  917. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  918. mSkin.setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  919. GUIElementStyle colorPickerSlider2DHandleStyle;
  920. colorPickerSlider2DHandleStyle.fixedHeight = true;
  921. colorPickerSlider2DHandleStyle.fixedWidth = true;
  922. colorPickerSlider2DHandleStyle.height = 8;
  923. colorPickerSlider2DHandleStyle.width = 8;
  924. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  925. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  926. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  927. mSkin.setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  928. /************************************************************************/
  929. /* OTHER */
  930. /************************************************************************/
  931. // Right-aligned label
  932. GUIElementStyle rightAlignedLabelStyle;
  933. rightAlignedLabelStyle.font = font;
  934. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  935. rightAlignedLabelStyle.fixedWidth = false;
  936. rightAlignedLabelStyle.fixedHeight = true;
  937. rightAlignedLabelStyle.height = 11;
  938. rightAlignedLabelStyle.minWidth = 10;
  939. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  940. mSkin.setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  941. }
  942. void BuiltinEditorResources::preprocess()
  943. {
  944. static const WString GUI_TEXTURES[] =
  945. { WindowBackgroundTexture, ButtonNormalTex, ButtonHoverTex, ButtonActiveTex, ToggleNormalTex,
  946. ToggleHoverTex, ToggleActiveTex, ToggleNormalOnTex, ToggleHoverOnTex, ToggleActiveOnTex,
  947. ObjectDropBtnNormalTex, ObjectDropBtnNormalOnTex, ObjectClearBtnNormalTex, ObjectClearBtnHoverTex,
  948. ObjectClearBtnActiveTex, FoldoutOpenNormalTex, FoldoutOpenHoverTex, FoldoutClosedNormalTex,
  949. FoldoutClosedHoverTex, CmpFoldoutOpenNormalTex, CmpFoldoutOpenHoverTex, CmpFoldoutOpenActiveTex,
  950. CmpFoldoutClosedNormalTex, CmpFoldoutClosedHoverTex, CmpFoldoutClosedActiveTex, WindowFrameNormal,
  951. WindowFrameFocused, WindowTitleBarBg, WindowCloseButtonNormal, WindowCloseButtonHover, WindowMinButtonNormal,
  952. WindowMinButtonHover, WindowMaxButtonNormal, WindowMaxButtonHover, TabbedBarBtnNormal, TabbedBarBtnActive,
  953. InputBoxNormalTex, InputBoxHoverTex, InputBoxFocusedTex, ScrollBarUpNormalTex, ScrollBarUpHoverTex,
  954. ScrollBarUpActiveTex, ScrollBarDownNormalTex, ScrollBarDownHoverTex, ScrollBarDownActiveTex, ScrollBarLeftNormalTex,
  955. ScrollBarLeftHoverTex, ScrollBarLeftActiveTex, ScrollBarRightNormalTex, ScrollBarRightHoverTex, ScrollBarRightActiveTex,
  956. ScrollBarHandleHorzNormalTex, ScrollBarHandleHorzHoverTex, ScrollBarHandleHorzActiveTex, ScrollBarHandleVertNormalTex,
  957. ScrollBarHandleVertHoverTex, ScrollBarHandleVertActiveTex, DropDownBtnNormalTex, DropDownBtnHoverTex,
  958. DropDownBoxBgTex, DropDownBoxEntryNormalTex, DropDownBoxEntryHoverTex, DropDownBoxBtnUpNormalTex,
  959. DropDownBoxBtnUpHoverTex, DropDownBoxBtnDownNormalTex, DropDownBoxBtnDownHoverTex, DropDownBoxEntryExpNormalTex,
  960. DropDownBoxEntryExpHoverTex, DropDownSeparatorTex, DropDownBoxBtnUpArrowTex, DropDownBoxBtnDownArrowTex,
  961. ScrollBarBgTex, MenuBarBgTex, MenuBarBtnNormalTex, MenuBarBtnHoverTex, MenuBarBansheeLogoTex, DockSliderNormalTex,
  962. TreeViewExpandButtonOffNormal, TreeViewExpandButtonOffHover, TreeViewExpandButtonOnNormal, TreeViewExpandButtonOnHover,
  963. TreeViewSelectionBackground, TreeViewEditBox, TreeViewElementHighlight, TreeViewElementSepHighlight, ProgressBarBgTex,
  964. ProgressBarFillTex, ColorPickerSliderHorzHandleTex, ColorPickerSliderVertHandleTex, ColorPickerSlider2DHandleTex };
  965. if (FileSystem::exists(DefaultSkinFolderRaw))
  966. {
  967. FileSystem::remove(DefaultSkinFolder);
  968. for (auto& tex : GUI_TEXTURES)
  969. importGUITexture(tex);
  970. {
  971. Path fontPath = FileSystem::getWorkingDirectoryPath();
  972. fontPath.append(DefaultSkinFolderRaw);
  973. fontPath.append(DefaultFontFilename);
  974. ImportOptionsPtr fontImportOptions = Importer::instance().createImportOptions(fontPath);
  975. if (rtti_is_of_type<FontImportOptions>(fontImportOptions))
  976. {
  977. FontImportOptions* importOptions = static_cast<FontImportOptions*>(fontImportOptions.get());
  978. Vector<UINT32> fontSizes;
  979. fontSizes.push_back(DefaultFontSize);
  980. importOptions->setFontSizes(fontSizes);
  981. importOptions->setAntialiasing(false);
  982. }
  983. HFont font = Importer::instance().import<Font>(fontPath, fontImportOptions);
  984. Path outputPath = FileSystem::getWorkingDirectoryPath();
  985. outputPath.append(DefaultSkinFolder);
  986. outputPath.append(DefaultFontFilename + L".asset");
  987. Resources::instance().save(font, outputPath, true);
  988. // Save font texture pages as well. TODO - Later maybe figure out a more automatic way to do this
  989. const FontData* fontData = font->getFontDataForSize(DefaultFontSize);
  990. Path texPageOutputPath = FileSystem::getWorkingDirectoryPath();
  991. texPageOutputPath.append(DefaultSkinFolder);
  992. UINT32 pageIdx = 0;
  993. for (auto tex : fontData->texturePages)
  994. {
  995. texPageOutputPath.setFilename(DefaultFontFilename + L"_texpage_" + toWString(pageIdx) + L".asset");
  996. Resources::instance().save(tex, texPageOutputPath, true);
  997. }
  998. }
  999. }
  1000. if (FileSystem::exists(DefaultShaderFolderRaw))
  1001. {
  1002. FileSystem::remove(DefaultShaderFolder);
  1003. Vector<Path> directories;
  1004. Vector<Path> files;
  1005. FileSystem::getChildren(DefaultShaderFolderRaw, files, directories);
  1006. // Process includes first since shaders reference them
  1007. for (auto& shaderFile : files)
  1008. {
  1009. if (shaderFile.getExtension() != ".bslinc")
  1010. continue;
  1011. HResource resource = Importer::instance().import(shaderFile);
  1012. if (resource != nullptr)
  1013. {
  1014. if (rtti_is_of_type<ShaderInclude>(resource.getInternalPtr()))
  1015. {
  1016. Path outputLoc = DefaultShaderFolder;
  1017. outputLoc.append(shaderFile.getWFilename() + L".asset");
  1018. Resources::instance().save(resource, outputLoc, true);
  1019. }
  1020. }
  1021. }
  1022. for (auto& shaderFile : files)
  1023. {
  1024. if (shaderFile.getExtension() != ".bsl")
  1025. continue;
  1026. HResource resource = Importer::instance().import(shaderFile);
  1027. if (resource != nullptr)
  1028. {
  1029. if (rtti_is_of_type<Shader>(resource.getInternalPtr()))
  1030. {
  1031. Path outputLoc = DefaultShaderFolder;
  1032. outputLoc.append(shaderFile.getWFilename() + L".asset");
  1033. Resources::instance().save(resource, outputLoc, true);
  1034. }
  1035. }
  1036. }
  1037. }
  1038. Resources::instance().unloadAllUnused();
  1039. }
  1040. void BuiltinEditorResources::importGUITexture(const WString& name)
  1041. {
  1042. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1043. texturePath.append(DefaultSkinFolderRaw);
  1044. texturePath.append(name);
  1045. Path texOutputPath = FileSystem::getWorkingDirectoryPath();
  1046. texOutputPath.append(DefaultSkinFolder);
  1047. Path spriteTexOutputPath = texOutputPath;
  1048. texOutputPath.append(name + L".asset");
  1049. spriteTexOutputPath.append(L"sprite_" + name + L".asset");
  1050. HTexture tex = Importer::instance().import<Texture>(texturePath);
  1051. Resources::instance().save(tex, texOutputPath, true);
  1052. HSpriteTexture spriteTex = SpriteTexture::create(tex);
  1053. Resources::instance().save(spriteTex, spriteTexOutputPath, true);
  1054. }
  1055. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name)
  1056. {
  1057. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1058. texturePath.append(DefaultSkinFolder);
  1059. texturePath.append(L"sprite_" + name + L".asset");
  1060. return Resources::instance().load<SpriteTexture>(texturePath);
  1061. }
  1062. HShader BuiltinEditorResources::getShader(const WString& name)
  1063. {
  1064. Path programPath = DefaultShaderFolder;
  1065. programPath.append(name + L".asset");
  1066. return gResources().load<Shader>(programPath);
  1067. }
  1068. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1069. {
  1070. return Material::create(mShaderDockOverlay);
  1071. }
  1072. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1073. {
  1074. return Material::create(mShaderSceneGrid);
  1075. }
  1076. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1077. {
  1078. UINT32 modeIdx = (UINT32)cullMode;
  1079. return Material::create(mShaderPicking[modeIdx]);
  1080. }
  1081. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1082. {
  1083. UINT32 modeIdx = (UINT32)cullMode;
  1084. return Material::create(mShaderPickingAlpha[modeIdx]);
  1085. }
  1086. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1087. {
  1088. return Material::create(mShaderGizmoWire);
  1089. }
  1090. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1091. {
  1092. return Material::create(mShaderGizmoSolid);
  1093. }
  1094. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1095. {
  1096. return Material::create(mShaderGizmoIcon);
  1097. }
  1098. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1099. {
  1100. return Material::create(mShaderGizmoPicking);
  1101. }
  1102. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1103. {
  1104. return Material::create(mShaderGizmoAlphaPicking);
  1105. }
  1106. HMaterial BuiltinEditorResources::createWireHandleMat() const
  1107. {
  1108. return Material::create(mShaderHandleWire);
  1109. }
  1110. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1111. {
  1112. return Material::create(mShaderHandleSolid);
  1113. }
  1114. HMaterial BuiltinEditorResources::createSelectionMat() const
  1115. {
  1116. return Material::create(mShaderSelection);
  1117. }
  1118. }