BsBuiltinEditorResources.cpp 59 KB

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