BsBuiltinEditorResources.cpp 57 KB

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