BsBuiltinEditorResources.cpp 60 KB

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