BsBuiltinEditorResources.cpp 59 KB

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