BsBuiltinEditorResources.cpp 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772
  1. #include "BsBuiltinEditorResources.h"
  2. #include "BsBuiltinResources.h"
  3. #include "BsGUIElementStyle.h"
  4. #include "BsGUILabel.h"
  5. #include "BsGUITexture.h"
  6. #include "BsGUIButton.h"
  7. #include "BsGUIInputBox.h"
  8. #include "BsGUIToggle.h"
  9. #include "BsGUIColor.h"
  10. #include "BsTextSprite.h"
  11. #include "BsSpriteTexture.h"
  12. #include "BsGUITreeViewEditBox.h"
  13. #include "BsGUIIntField.h"
  14. #include "BsGUIFloatField.h"
  15. #include "BsGUIColorField.h"
  16. #include "BsGUITextField.h"
  17. #include "BsGUIToggleField.h"
  18. #include "BsGUIVector2Field.h"
  19. #include "BsGUIVector3Field.h"
  20. #include "BsGUIVector4Field.h"
  21. #include "BsGUIComponentFoldout.h"
  22. #include "BsGUIFoldout.h"
  23. #include "BsGUIProgressBar.h"
  24. #include "BsGUISlider.h"
  25. #include "BsGUIDropDownContent.h"
  26. #include "BsGUIStatusBar.h"
  27. #include "BsGUIMenuBar.h"
  28. #include "BsFont.h"
  29. #include "BsFontImportOptions.h"
  30. #include "BsImporter.h"
  31. #include "BsGpuProgram.h"
  32. #include "BsShader.h"
  33. #include "BsShaderInclude.h"
  34. #include "BsTechnique.h"
  35. #include "BsPass.h"
  36. #include "BsMaterial.h"
  37. #include "BsBlendState.h"
  38. #include "BsDepthStencilState.h"
  39. #include "BsRasterizerState.h"
  40. #include "BsResources.h"
  41. #include "BsRTTIType.h"
  42. #include "BsFileSystem.h"
  43. #include "BsResourceManifest.h"
  44. namespace BansheeEngine
  45. {
  46. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  47. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  48. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  49. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  50. const String BuiltinEditorResources::TextureFieldStyleName = "GUITextureField";
  51. const String BuiltinEditorResources::TextureFieldLabelStyleName = "TextureFieldLabel";
  52. const String BuiltinEditorResources::TextureFieldDropStyleName = "TextureDrop";
  53. const String BuiltinEditorResources::TextureFieldClearBtnStyleName = "TextureClearButton";
  54. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  55. const UINT32 BuiltinEditorResources::DefaultFontSize = 11;
  56. const Color BuiltinEditorResources::TextNormalColor = Color(0.7f, 0.7f, 0.7f);
  57. const Color BuiltinEditorResources::TextActiveColor = Color(0.0f, 0.0f, 0.0f);
  58. const WString BuiltinEditorResources::GUISkinFile = L"GUISkin";
  59. const Path BuiltinEditorResources::ShaderFolder = L"Shaders\\";
  60. const Path BuiltinEditorResources::SkinFolder = L"Skin\\";
  61. const Path BuiltinEditorResources::IconFolder = L"Skin\\Icons";
  62. const Path BuiltinEditorResources::ShaderIncludeFolder = L"Includes\\";
  63. const Path BuiltinEditorResources::BuiltinRawDataFolder = RUNTIME_DATA_PATH + L"Raw\\Editor\\";
  64. const Path BuiltinEditorResources::EditorRawSkinFolder = BuiltinRawDataFolder + SkinFolder;
  65. const Path BuiltinEditorResources::EditorRawShaderFolder = BuiltinRawDataFolder + ShaderFolder;
  66. const Path BuiltinEditorResources::EditorRawShaderIncludeFolder = BuiltinRawDataFolder + ShaderIncludeFolder;
  67. const Path BuiltinEditorResources::BuiltinDataFolder = RUNTIME_DATA_PATH + L"Editor\\";
  68. const Path BuiltinEditorResources::EditorSkinFolder = BuiltinDataFolder + SkinFolder;
  69. const Path BuiltinEditorResources::EditorIconFolder = BuiltinDataFolder + IconFolder;
  70. const Path BuiltinEditorResources::EditorShaderFolder = BuiltinDataFolder + ShaderFolder;
  71. const Path BuiltinEditorResources::EditorShaderIncludeFolder = BuiltinDataFolder + ShaderIncludeFolder;
  72. const Path BuiltinEditorResources::ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
  73. const Path BuiltinEditorResources::DefaultWidgetLayoutPath = BuiltinDataFolder + "Layout.asset";
  74. const WString BuiltinEditorResources::FolderIconTex = L"FolderIcon.psd";
  75. const WString BuiltinEditorResources::MeshIconTex = L"MeshIcon.psd";
  76. const WString BuiltinEditorResources::TextureIconTex = L"TextureIcon.psd";
  77. const WString BuiltinEditorResources::FontIconTex = L"FontIcon.psd";
  78. const WString BuiltinEditorResources::PlainTextIconTex = L"TextIcon.psd";
  79. const WString BuiltinEditorResources::ScriptCodeIconTex = L"CSharpIcon.psd";
  80. const WString BuiltinEditorResources::ShaderIconTex = L"ShaderIcon.psd";
  81. const WString BuiltinEditorResources::ShaderIncludeIconTex = L"ShaderIncludeIcon.psd";
  82. const WString BuiltinEditorResources::MaterialIconTex = L"MaterialIcon.psd";
  83. const WString BuiltinEditorResources::SpriteTextureIconTex = L"SpriteIcon.psd";
  84. const WString BuiltinEditorResources::PrefabIconTex = L"PrefabIcon.psd";
  85. const WString BuiltinEditorResources::LogInfoIconTex = L"IconInfo.psd";
  86. const WString BuiltinEditorResources::LogWarningIconTex = L"IconWarning.psd";
  87. const WString BuiltinEditorResources::LogErrorIconTex = L"IconError.psd";
  88. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.png";
  89. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.png";
  90. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.png";
  91. const WString BuiltinEditorResources::ButtonLeftNormalTex = L"ButtonLeftNormal.png";
  92. const WString BuiltinEditorResources::ButtonLeftHoverTex = L"ButtonLeftHover.png";
  93. const WString BuiltinEditorResources::ButtonLeftActiveTex = L"ButtonLeftActive.png";
  94. const WString BuiltinEditorResources::ButtonRightNormalTex = L"ButtonRightNormal.png";
  95. const WString BuiltinEditorResources::ButtonRightHoverTex = L"ButtonRightHover.png";
  96. const WString BuiltinEditorResources::ButtonRightActiveTex = L"ButtonRightActive.png";
  97. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.png";
  98. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.png";
  99. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleNormalOn.png";
  100. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleHoverOn.png";
  101. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.png";
  102. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.png";
  103. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxActive.png";
  104. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectDropNormal.png";
  105. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectDropNormalOn.png";
  106. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectDropClearNormal.png";
  107. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectDropClearHover.png";
  108. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectDropClearActive.png";
  109. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownButtonNormal.png";
  110. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownButtonHover.png";
  111. const WString BuiltinEditorResources::DropDownBtnActiveTex = L"DropDownButtonActive.png";
  112. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutOpenNormal.psd";
  113. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutOpenHover.psd";
  114. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutClosedNormal.psd";
  115. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutClosedHover.psd";
  116. const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"CmpFoldoutOpenNormal.psd";
  117. const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"CmpFoldoutOpenHover.psd";
  118. const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"CmpFoldoutOpenActive.psd";
  119. const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"CmpFoldoutClosedNormal.psd";
  120. const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"CmpFoldoutClosedHover.psd";
  121. const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"CmpFoldoutClosedActive.psd";
  122. const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
  123. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.png";
  124. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.png";
  125. const WString BuiltinEditorResources::CloseButtonNormalTex = L"CloseButtonNormal.png";
  126. const WString BuiltinEditorResources::CloseButtonHoverTex = L"CloseButtonHover.png";
  127. const WString BuiltinEditorResources::CloseButtonActiveTex = L"CloseButtonActive.png";
  128. const WString BuiltinEditorResources::MinButtonNormalTex = L"MinimizeButtonNormal.png";
  129. const WString BuiltinEditorResources::MinButtonHoverTex = L"MinimizeButtonHover.png";
  130. const WString BuiltinEditorResources::MinButtonActiveTex = L"MinimizeButtonActive.png";
  131. const WString BuiltinEditorResources::MaxButtonNormalTex = L"MaximizeButtonNormal.png";
  132. const WString BuiltinEditorResources::MaxButtonHoverTex = L"MaximizeButtonHover.png";
  133. const WString BuiltinEditorResources::MaxButtonActiveTex = L"MaximizeButtonActive.png";
  134. const WString BuiltinEditorResources::TabBarBackgroundTex = L"TabBarBackground.png";
  135. const WString BuiltinEditorResources::TitleBarBackgroundTex = L"TitleBarBackground.png";
  136. const WString BuiltinEditorResources::TabButtonNormalTex = L"TabButtonNormal.png";
  137. const WString BuiltinEditorResources::TabButtonFocusedTex = L"TabButtonFocused.png";
  138. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollArrowUpNormal.png";
  139. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollArrowUpHover.png";
  140. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollArrowUpActive.png";
  141. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollArrowDownNormal.png";
  142. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollArrowDownHover.png";
  143. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollArrowDownActive.png";
  144. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollArrowLeftNormal.png";
  145. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollArrowLeftHover.png";
  146. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollArrowLeftActive.png";
  147. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollArrowRightNormal.png";
  148. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollArrowRightHover.png";
  149. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollArrowRightActive.png";
  150. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHHandleNormal.png";
  151. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHHandleHover.png";
  152. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHHandleActive.png";
  153. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVHandleNormal.png";
  154. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVHandleHover.png";
  155. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVHandleActive.png";
  156. const WString BuiltinEditorResources::ScrollBarHBgTex = L"ScrollBarHBackground.png";
  157. const WString BuiltinEditorResources::ScrollBarVBgTex = L"ScrollBarVBackground.png";
  158. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.psd";
  159. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownButtonNormal.psd";
  160. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownButtonHover.psd";
  161. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxBtnUpNormal.psd";
  162. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxBtnUpHover.psd";
  163. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxBtnDownNormal.psd";
  164. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxBtnDownHover.psd";
  165. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownExpNormal.psd";
  166. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownExpHover.psd";
  167. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownSeparator.psd";
  168. const WString BuiltinEditorResources::DropDownBoxBtnUpArrowTex = L"DropDownBoxBtnUpArrow.psd";
  169. const WString BuiltinEditorResources::DropDownBoxBtnDownArrowTex = L"DropDownBoxBtnDownArrow.psd";
  170. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBackground.png";
  171. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarLog.png";
  172. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.png";
  173. const WString BuiltinEditorResources::MenuBarBtnActiveTex = L"MenuBarButtonActive.png";
  174. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.png";
  175. const WString BuiltinEditorResources::MenuBarLineNormalTex = L"MenuBarLineNormal.png";
  176. const WString BuiltinEditorResources::MenuBarLineActiveTex = L"MenuBarLineActive.png";
  177. const WString BuiltinEditorResources::ToolBarBtnNormalTex = L"ToolBarButtonNormal.png";
  178. const WString BuiltinEditorResources::ToolBarBtnHoverTex = L"ToolBarButtonNormal.png";
  179. const WString BuiltinEditorResources::ToolBarBtnActiveTex = L"ToolBarButtonNormal.png";
  180. const WString BuiltinEditorResources::ToolBarSeparatorTex = L"ToolBarSeparator.png";
  181. const WString BuiltinEditorResources::DockSliderNormalTex = L"DockSliderNormal.png";
  182. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"TreeViewExpandButtonOffNormal.psd";
  183. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"TreeViewExpandButtonOffHover.psd";
  184. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"TreeViewExpandButtonOnNormal.psd";
  185. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
  186. const WString BuiltinEditorResources::TreeViewHighlightBackground = L"TreeViewHighlightBackground.psd";
  187. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  188. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  189. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  190. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  191. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  192. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  193. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.psd";
  194. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.psd";
  195. const WString BuiltinEditorResources::SelectionAreaTex = L"SelectionHighlight.psd";
  196. const WString BuiltinEditorResources::SelectionBgTex = L"SelectionBg.psd";
  197. const WString BuiltinEditorResources::TextureDropTex = L"TextureDrop.psd";
  198. const WString BuiltinEditorResources::TextureDropOnTex = L"TextureDropOn.psd";
  199. const WString BuiltinEditorResources::XButtonNormalTex = L"XBtnNormal.psd";
  200. const WString BuiltinEditorResources::XButtonHoverTex = L"XBtnHover.psd";
  201. const WString BuiltinEditorResources::StatusBarBgTex = L"StatusBarBackground.png";
  202. const WString BuiltinEditorResources::ScrollAreaBgTex = L"ScrollAreaBg.png";
  203. /************************************************************************/
  204. /* SHADERS */
  205. /************************************************************************/
  206. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  207. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  208. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  209. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  210. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  211. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  212. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  213. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  214. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  215. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  216. const WString BuiltinEditorResources::ShaderWireHandleFile = L"WireHandle.bsl";
  217. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  218. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  219. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  220. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  221. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  222. BuiltinEditorResources::BuiltinEditorResources()
  223. {
  224. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  225. absoluteDataPath.append(BuiltinDataFolder);
  226. #if BS_DEBUG_MODE
  227. if (BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder, BuiltinDataFolder + L"Timestamp.asset"))
  228. {
  229. mResourceManifest = ResourceManifest::create("BuiltinResources");
  230. gResources().registerResourceManifest(mResourceManifest);
  231. preprocess();
  232. BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
  233. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  234. absoluteDataPath.append(BuiltinDataFolder);
  235. ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
  236. }
  237. #endif
  238. if (mResourceManifest == nullptr)
  239. {
  240. if (FileSystem::exists(ResourceManifestPath))
  241. mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
  242. if (mResourceManifest == nullptr)
  243. mResourceManifest = ResourceManifest::create("BuiltinResources");
  244. gResources().registerResourceManifest(mResourceManifest);
  245. }
  246. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  247. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  248. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  249. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  250. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  251. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  252. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  253. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  254. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  255. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  256. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  257. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  258. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  259. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  260. mShaderHandleWire = getShader(ShaderWireHandleFile);
  261. mShaderSelection = getShader(ShaderSelectionFile);
  262. mSkin = gResources().load<GUISkin>(BuiltinDataFolder + (GUISkinFile + L".asset"));
  263. }
  264. BuiltinEditorResources::~BuiltinEditorResources()
  265. { }
  266. void BuiltinEditorResources::preprocess()
  267. {
  268. FileSystem::remove(EditorShaderIncludeFolder);
  269. FileSystem::remove(EditorShaderFolder);
  270. FileSystem::remove(EditorSkinFolder);
  271. BuiltinResourcesHelper::importAssets(EditorRawShaderIncludeFolder, EditorShaderIncludeFolder, mResourceManifest); // Hidden dependency: Includes must be imported before shaders
  272. BuiltinResourcesHelper::importAssets(EditorRawShaderFolder, EditorShaderFolder, mResourceManifest);
  273. BuiltinResourcesHelper::importAssets(EditorRawSkinFolder, EditorSkinFolder, mResourceManifest);
  274. // Import font
  275. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, BuiltinDataFolder, DefaultFontSize, false, mResourceManifest);
  276. // Generate & save GUI sprite textures
  277. BuiltinResourcesHelper::generateSpriteTextures(EditorSkinFolder, mResourceManifest);
  278. // Generate & save GUI skin
  279. {
  280. HGUISkin skin = generateGUISkin();
  281. Path outputPath = FileSystem::getWorkingDirectoryPath() + BuiltinDataFolder + (GUISkinFile + L".asset");
  282. Resources::instance().save(skin, outputPath, true);
  283. mResourceManifest->registerResource(skin.getUUID(), outputPath);
  284. }
  285. Resources::instance().unloadAllUnused();
  286. }
  287. HGUISkin BuiltinEditorResources::generateGUISkin()
  288. {
  289. HGUISkin skin = GUISkin::create();
  290. Path fontPath = FileSystem::getWorkingDirectoryPath();
  291. fontPath.append(BuiltinDataFolder);
  292. fontPath.append(DefaultFontFilename + L".asset");
  293. HFont font = Resources::instance().load<Font>(fontPath);
  294. // Blank entry
  295. GUIElementStyle blankStyle;
  296. skin->setStyle("Blank", blankStyle);
  297. skin->setStyle(GUITexture::getGUITypeName(), blankStyle);
  298. // Label
  299. GUIElementStyle labelStyle;
  300. labelStyle.font = font;
  301. labelStyle.fontSize = DefaultFontSize;
  302. labelStyle.fixedWidth = false;
  303. labelStyle.fixedHeight = true;
  304. labelStyle.height = 14;
  305. labelStyle.minWidth = 10;
  306. labelStyle.normal.textColor = TextNormalColor;
  307. skin->setStyle(GUILabel::getGUITypeName(), labelStyle);
  308. // Window frame
  309. GUIElementStyle windowFrameStyle;
  310. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  311. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  312. windowFrameStyle.border.left = 1;
  313. windowFrameStyle.border.right = 1;
  314. windowFrameStyle.border.top = 1;
  315. windowFrameStyle.border.bottom = 1;
  316. skin->setStyle("WindowFrame", windowFrameStyle);
  317. // Button
  318. GUIElementStyle buttonStyle;
  319. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  320. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  321. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  322. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  323. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  324. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  325. buttonStyle.normal.textColor = TextNormalColor;
  326. buttonStyle.hover.textColor = TextNormalColor;
  327. buttonStyle.active.textColor = TextActiveColor;
  328. buttonStyle.normalOn.textColor = TextActiveColor;
  329. buttonStyle.hoverOn.textColor = TextActiveColor;
  330. buttonStyle.activeOn.textColor = TextActiveColor;
  331. buttonStyle.border.left = 2;
  332. buttonStyle.border.right = 2;
  333. buttonStyle.border.top = 2;
  334. buttonStyle.border.bottom = 4;
  335. buttonStyle.contentOffset.top = 2;
  336. buttonStyle.contentOffset.left = 3;
  337. buttonStyle.contentOffset.right = 3;
  338. buttonStyle.margins.bottom = 2;
  339. buttonStyle.fixedHeight = true;
  340. buttonStyle.height = 21;
  341. buttonStyle.minWidth = 20;
  342. buttonStyle.font = font;
  343. buttonStyle.fontSize = DefaultFontSize;
  344. buttonStyle.textHorzAlign = THA_Center;
  345. buttonStyle.textVertAlign = TVA_Center;
  346. skin->setStyle(GUIButton::getGUITypeName(), buttonStyle);
  347. // Left edge button
  348. GUIElementStyle leftButtonStyle;
  349. leftButtonStyle.normal.texture = getGUITexture(ButtonLeftNormalTex);
  350. leftButtonStyle.hover.texture = getGUITexture(ButtonLeftHoverTex);
  351. leftButtonStyle.active.texture = getGUITexture(ButtonLeftActiveTex);
  352. leftButtonStyle.normalOn.texture = getGUITexture(ButtonLeftActiveTex);
  353. leftButtonStyle.hoverOn.texture = getGUITexture(ButtonLeftActiveTex);
  354. leftButtonStyle.activeOn.texture = getGUITexture(ButtonLeftActiveTex);
  355. leftButtonStyle.normal.textColor = TextNormalColor;
  356. leftButtonStyle.hover.textColor = TextNormalColor;
  357. leftButtonStyle.active.textColor = TextActiveColor;
  358. leftButtonStyle.normalOn.textColor = TextActiveColor;
  359. leftButtonStyle.hoverOn.textColor = TextActiveColor;
  360. leftButtonStyle.activeOn.textColor = TextActiveColor;
  361. leftButtonStyle.border.left = 7;
  362. leftButtonStyle.border.right = 2;
  363. leftButtonStyle.border.top = 2;
  364. leftButtonStyle.border.bottom = 4;
  365. leftButtonStyle.contentOffset.top = 2;
  366. leftButtonStyle.contentOffset.left = 7;
  367. leftButtonStyle.contentOffset.right = 3;
  368. leftButtonStyle.margins.bottom = 2;
  369. leftButtonStyle.fixedHeight = true;
  370. leftButtonStyle.height = 21;
  371. leftButtonStyle.minWidth = 20;
  372. leftButtonStyle.font = font;
  373. leftButtonStyle.fontSize = DefaultFontSize;
  374. leftButtonStyle.textHorzAlign = THA_Center;
  375. leftButtonStyle.textVertAlign = TVA_Center;
  376. skin->setStyle("ButtonLeft", leftButtonStyle);
  377. // Right edge button
  378. GUIElementStyle rightButtonStyle;
  379. rightButtonStyle.normal.texture = getGUITexture(ButtonRightNormalTex);
  380. rightButtonStyle.hover.texture = getGUITexture(ButtonRightHoverTex);
  381. rightButtonStyle.active.texture = getGUITexture(ButtonRightActiveTex);
  382. rightButtonStyle.normalOn.texture = getGUITexture(ButtonRightActiveTex);
  383. rightButtonStyle.hoverOn.texture = getGUITexture(ButtonRightActiveTex);
  384. rightButtonStyle.activeOn.texture = getGUITexture(ButtonRightActiveTex);
  385. rightButtonStyle.normal.textColor = TextNormalColor;
  386. rightButtonStyle.hover.textColor = TextNormalColor;
  387. rightButtonStyle.active.textColor = TextActiveColor;
  388. rightButtonStyle.normalOn.textColor = TextActiveColor;
  389. rightButtonStyle.hoverOn.textColor = TextActiveColor;
  390. rightButtonStyle.activeOn.textColor = TextActiveColor;
  391. rightButtonStyle.border.left = 2;
  392. rightButtonStyle.border.right = 7;
  393. rightButtonStyle.border.top = 2;
  394. rightButtonStyle.border.bottom = 4;
  395. rightButtonStyle.contentOffset.top = 2;
  396. rightButtonStyle.contentOffset.left = 3;
  397. rightButtonStyle.contentOffset.right = 7;
  398. rightButtonStyle.margins.bottom = 2;
  399. rightButtonStyle.fixedHeight = true;
  400. rightButtonStyle.height = 21;
  401. rightButtonStyle.minWidth = 20;
  402. rightButtonStyle.font = font;
  403. rightButtonStyle.fontSize = DefaultFontSize;
  404. rightButtonStyle.textHorzAlign = THA_Center;
  405. rightButtonStyle.textVertAlign = TVA_Center;
  406. skin->setStyle("ButtonRight", rightButtonStyle);
  407. // Toggle
  408. GUIElementStyle toggleStyle;
  409. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  410. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  411. toggleStyle.active.texture = toggleStyle.hover.texture;
  412. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  413. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  414. toggleStyle.activeOn.texture = toggleStyle.hoverOn.texture;
  415. toggleStyle.fixedHeight = true;
  416. toggleStyle.fixedWidth = true;
  417. toggleStyle.margins.bottom = 2;
  418. toggleStyle.height = 15;
  419. toggleStyle.width = 13;
  420. skin->setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  421. // Color
  422. GUIElementStyle colorStyle;
  423. colorStyle.margins.left = 2;
  424. colorStyle.margins.right = 2;
  425. colorStyle.margins.top = 2;
  426. colorStyle.margins.bottom = 2;
  427. colorStyle.fixedHeight = true;
  428. colorStyle.height = 10;
  429. colorStyle.minWidth = 10;
  430. skin->setStyle(GUIColor::getGUITypeName(), colorStyle);
  431. // Window background texture
  432. GUIElementStyle windowBgStyle;
  433. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTex);
  434. skin->setStyle("WindowBackground", windowBgStyle);
  435. // Window tab bar background
  436. GUIElementStyle tabBarBgStyle;
  437. tabBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
  438. tabBarBgStyle.fixedHeight = true;
  439. tabBarBgStyle.height = 16;
  440. skin->setStyle("TabBarBackground", tabBarBgStyle);
  441. // Tabbed title bar tab button
  442. GUIElementStyle tabbedBarButton;
  443. tabbedBarButton.normal.texture = getGUITexture(TabButtonNormalTex);
  444. tabbedBarButton.hover.texture = tabbedBarButton.normal.texture;
  445. tabbedBarButton.active.texture = getGUITexture(TabButtonFocusedTex);
  446. tabbedBarButton.normalOn.texture = tabbedBarButton.active.texture;
  447. tabbedBarButton.hoverOn.texture = tabbedBarButton.active.texture;
  448. tabbedBarButton.activeOn.texture = tabbedBarButton.active.texture;
  449. tabbedBarButton.normal.textColor = TextNormalColor;
  450. tabbedBarButton.hover.textColor = TextNormalColor;
  451. tabbedBarButton.active.textColor = TextActiveColor;
  452. tabbedBarButton.normalOn.textColor = TextActiveColor;
  453. tabbedBarButton.hoverOn.textColor = TextActiveColor;
  454. tabbedBarButton.activeOn.textColor = TextActiveColor;
  455. tabbedBarButton.border.left = 12;
  456. tabbedBarButton.border.right = 12;
  457. tabbedBarButton.margins.left = 5;
  458. tabbedBarButton.margins.right = 5;
  459. tabbedBarButton.contentOffset.top = 3;
  460. tabbedBarButton.contentOffset.left = 6;
  461. tabbedBarButton.contentOffset.right = 6;
  462. tabbedBarButton.fixedHeight = true;
  463. tabbedBarButton.height = 15;
  464. tabbedBarButton.minWidth = 24;
  465. tabbedBarButton.maxWidth = 110;
  466. tabbedBarButton.font = font;
  467. tabbedBarButton.fontSize = DefaultFontSize;
  468. tabbedBarButton.textHorzAlign = THA_Center;
  469. tabbedBarButton.textVertAlign = TVA_Center;
  470. skin->setStyle("TabbedBarBtn", tabbedBarButton);
  471. // Tabbed title bar drag/drop button
  472. GUIElementStyle tabbedBarDropButton;
  473. tabbedBarDropButton.fixedHeight = true;
  474. tabbedBarDropButton.fixedWidth = true;
  475. tabbedBarDropButton.height = 13;
  476. tabbedBarDropButton.width = 6;
  477. skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
  478. // Window title bar background
  479. GUIElementStyle titleBarBgStyle;
  480. titleBarBgStyle.normal.texture = getGUITexture(TitleBarBackgroundTex);
  481. titleBarBgStyle.fixedHeight = true;
  482. titleBarBgStyle.height = 17;
  483. skin->setStyle("TitleBarBackground", titleBarBgStyle);
  484. // Window minimize button
  485. GUIElementStyle winMinButtonStyle;
  486. winMinButtonStyle.normal.texture = getGUITexture(MinButtonNormalTex);
  487. winMinButtonStyle.hover.texture = getGUITexture(MinButtonHoverTex);
  488. winMinButtonStyle.active.texture = getGUITexture(MinButtonActiveTex);
  489. winMinButtonStyle.fixedHeight = true;
  490. winMinButtonStyle.fixedWidth = true;
  491. winMinButtonStyle.height = 14;
  492. winMinButtonStyle.width = 14;
  493. skin->setStyle("WinMinimizeBtn", winMinButtonStyle);
  494. // Window maximize button
  495. GUIElementStyle winMaxButtonStyle;
  496. winMaxButtonStyle.normal.texture = getGUITexture(MaxButtonNormalTex);
  497. winMaxButtonStyle.hover.texture = getGUITexture(MaxButtonHoverTex);
  498. winMaxButtonStyle.active.texture = getGUITexture(MaxButtonActiveTex);
  499. winMaxButtonStyle.fixedHeight = true;
  500. winMaxButtonStyle.fixedWidth = true;
  501. winMaxButtonStyle.height = 14;
  502. winMaxButtonStyle.width = 14;
  503. skin->setStyle("WinMaximizeBtn", winMaxButtonStyle);
  504. // Window close button
  505. GUIElementStyle winCloseButtonStyle;
  506. winCloseButtonStyle.normal.texture = getGUITexture(CloseButtonNormalTex);
  507. winCloseButtonStyle.hover.texture = getGUITexture(CloseButtonHoverTex);
  508. winCloseButtonStyle.active.texture = getGUITexture(CloseButtonActiveTex);
  509. winCloseButtonStyle.fixedHeight = true;
  510. winCloseButtonStyle.fixedWidth = true;
  511. winCloseButtonStyle.height = 14;
  512. winCloseButtonStyle.width = 14;
  513. skin->setStyle("WinCloseBtn", winCloseButtonStyle);
  514. // Input box
  515. GUIElementStyle inputBoxStyle;
  516. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  517. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  518. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  519. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  520. inputBoxStyle.normal.textColor = TextNormalColor;
  521. inputBoxStyle.hover.textColor = TextNormalColor;
  522. inputBoxStyle.focused.textColor = TextNormalColor;
  523. inputBoxStyle.active.textColor = TextNormalColor;
  524. inputBoxStyle.border.left = 4;
  525. inputBoxStyle.border.right = 4;
  526. inputBoxStyle.border.top = 4;
  527. inputBoxStyle.border.bottom = 6;
  528. inputBoxStyle.contentOffset.left = 4;
  529. inputBoxStyle.contentOffset.right = 4;
  530. inputBoxStyle.contentOffset.top = 4;
  531. inputBoxStyle.contentOffset.bottom = 4;
  532. inputBoxStyle.margins.bottom = 2;
  533. inputBoxStyle.fixedHeight = true;
  534. inputBoxStyle.height = 21;
  535. inputBoxStyle.minWidth = 10;
  536. inputBoxStyle.font = font;
  537. inputBoxStyle.fontSize = DefaultFontSize;
  538. inputBoxStyle.textHorzAlign = THA_Left;
  539. inputBoxStyle.textVertAlign = TVA_Top;
  540. skin->setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  541. /************************************************************************/
  542. /* SCROLL BAR */
  543. /************************************************************************/
  544. // Up button
  545. GUIElementStyle scrollUpBtnStyle;
  546. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  547. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  548. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  549. scrollUpBtnStyle.fixedHeight = true;
  550. scrollUpBtnStyle.fixedWidth = true;
  551. scrollUpBtnStyle.height = 11;
  552. scrollUpBtnStyle.width = 13;
  553. skin->setStyle("ScrollUpBtn", scrollUpBtnStyle);
  554. // Down button
  555. GUIElementStyle scrollDownBtnStyle;
  556. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  557. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  558. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  559. scrollDownBtnStyle.fixedHeight = true;
  560. scrollDownBtnStyle.fixedWidth = true;
  561. scrollDownBtnStyle.height = 11;
  562. scrollDownBtnStyle.width = 13;
  563. skin->setStyle("ScrollDownBtn", scrollDownBtnStyle);
  564. // Left button
  565. GUIElementStyle scrollLeftBtnStyle;
  566. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  567. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  568. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  569. scrollLeftBtnStyle.fixedHeight = true;
  570. scrollLeftBtnStyle.fixedWidth = true;
  571. scrollLeftBtnStyle.height = 13;
  572. scrollLeftBtnStyle.width = 11;
  573. skin->setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  574. // Right button
  575. GUIElementStyle scrollRightBtnStyle;
  576. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  577. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  578. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  579. scrollRightBtnStyle.fixedHeight = true;
  580. scrollRightBtnStyle.fixedWidth = true;
  581. scrollRightBtnStyle.height = 13;
  582. scrollRightBtnStyle.width = 11;
  583. skin->setStyle("ScrollRightBtn", scrollRightBtnStyle);
  584. // Horizontal handle
  585. GUIElementStyle scrollBarHorzBtnStyle;
  586. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  587. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  588. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  589. scrollBarHorzBtnStyle.fixedHeight = true;
  590. scrollBarHorzBtnStyle.fixedWidth = false;
  591. scrollBarHorzBtnStyle.width = 10;
  592. scrollBarHorzBtnStyle.height = 13;
  593. scrollBarHorzBtnStyle.border.left = 4;
  594. scrollBarHorzBtnStyle.border.right = 4;
  595. skin->setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  596. // Vertical handle
  597. GUIElementStyle scrollBarVertBtnStyle;
  598. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  599. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  600. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  601. scrollBarVertBtnStyle.fixedHeight = false;
  602. scrollBarVertBtnStyle.fixedWidth = true;
  603. scrollBarVertBtnStyle.width = 13;
  604. scrollBarVertBtnStyle.height = 10;
  605. scrollBarVertBtnStyle.border.top = 4;
  606. scrollBarVertBtnStyle.border.bottom = 4;
  607. skin->setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  608. // Vertical scroll bar
  609. GUIElementStyle vertScrollBarStyle;
  610. vertScrollBarStyle.normal.texture = getGUITexture(ScrollBarVBgTex);
  611. vertScrollBarStyle.hover.texture = vertScrollBarStyle.normal.texture;
  612. vertScrollBarStyle.active.texture = vertScrollBarStyle.normal.texture;
  613. vertScrollBarStyle.fixedHeight = false;
  614. vertScrollBarStyle.fixedWidth = true;
  615. vertScrollBarStyle.minHeight = 8;
  616. vertScrollBarStyle.width = 16;
  617. skin->setStyle("ScrollBarVert", vertScrollBarStyle);
  618. // Horizontal scroll bar
  619. GUIElementStyle horzScrollBarStyle;
  620. horzScrollBarStyle.normal.texture = getGUITexture(ScrollBarHBgTex);
  621. horzScrollBarStyle.hover.texture = horzScrollBarStyle.normal.texture;
  622. horzScrollBarStyle.active.texture = horzScrollBarStyle.normal.texture;
  623. horzScrollBarStyle.fixedHeight = true;
  624. horzScrollBarStyle.fixedWidth = false;
  625. horzScrollBarStyle.minWidth = 8;
  626. horzScrollBarStyle.height = 16;
  627. skin->setStyle("ScrollBarHorz", horzScrollBarStyle);
  628. /************************************************************************/
  629. /* DROP DOWN BOX */
  630. /************************************************************************/
  631. // ListBox button
  632. GUIElementStyle dropDownListStyle;
  633. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  634. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  635. dropDownListStyle.active.texture = getGUITexture(DropDownBtnActiveTex);
  636. dropDownListStyle.normalOn.texture = dropDownListStyle.active.texture;
  637. dropDownListStyle.hoverOn.texture = dropDownListStyle.active.texture;
  638. dropDownListStyle.activeOn.texture = dropDownListStyle.active.texture;
  639. dropDownListStyle.normal.textColor = TextNormalColor;
  640. dropDownListStyle.hover.textColor = TextNormalColor;
  641. dropDownListStyle.active.textColor = TextNormalColor;
  642. dropDownListStyle.normalOn.textColor = TextNormalColor;
  643. dropDownListStyle.hoverOn.textColor = TextNormalColor;
  644. dropDownListStyle.activeOn.textColor = TextNormalColor;
  645. dropDownListStyle.fixedHeight = true;
  646. dropDownListStyle.fixedWidth = false;
  647. dropDownListStyle.height = 21;
  648. dropDownListStyle.minWidth = 20;
  649. dropDownListStyle.contentOffset.left = 3;
  650. dropDownListStyle.contentOffset.right = 18;
  651. dropDownListStyle.contentOffset.top = 2;
  652. dropDownListStyle.contentOffset.bottom = 2;
  653. dropDownListStyle.border.left = 2;
  654. dropDownListStyle.border.right = 16;
  655. dropDownListStyle.border.top = 2;
  656. dropDownListStyle.border.bottom = 4;
  657. dropDownListStyle.margins.bottom = 2;
  658. dropDownListStyle.font = font;
  659. dropDownListStyle.fontSize = DefaultFontSize;
  660. dropDownListStyle.textHorzAlign = THA_Left;
  661. dropDownListStyle.textVertAlign = TVA_Center;
  662. skin->setStyle("ListBox", dropDownListStyle);
  663. // DropDown scroll up button arrow
  664. HSpriteTexture dropDownBtnScrollUpArrow = getGUITexture(DropDownBoxBtnUpArrowTex);
  665. GUIElementStyle dropDownScrollUpBtnArrowStyle;
  666. dropDownScrollUpBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnUpArrowTex);
  667. dropDownScrollUpBtnArrowStyle.hover.texture = dropDownScrollUpBtnArrowStyle.normal.texture;
  668. dropDownScrollUpBtnArrowStyle.active.texture = dropDownScrollUpBtnArrowStyle.hover.texture;
  669. dropDownScrollUpBtnArrowStyle.fixedHeight = true;
  670. dropDownScrollUpBtnArrowStyle.fixedWidth = false;
  671. dropDownScrollUpBtnArrowStyle.height = 7;
  672. dropDownScrollUpBtnArrowStyle.width = 30;
  673. dropDownScrollUpBtnArrowStyle.border.left = 1;
  674. dropDownScrollUpBtnArrowStyle.border.right = 1;
  675. dropDownScrollUpBtnArrowStyle.border.top = 1;
  676. dropDownScrollUpBtnArrowStyle.border.bottom = 1;
  677. skin->setStyle("ListBoxScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  678. skin->setStyle("MenuBarScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  679. skin->setStyle("ContextMenuScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  680. // DropDown scroll up button
  681. GUIElementStyle dropDownScrollUpBtnStyle;
  682. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  683. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  684. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  685. dropDownScrollUpBtnStyle.fixedHeight = true;
  686. dropDownScrollUpBtnStyle.fixedWidth = false;
  687. dropDownScrollUpBtnStyle.height = 7;
  688. dropDownScrollUpBtnStyle.width = 30;
  689. dropDownScrollUpBtnStyle.border.left = 1;
  690. dropDownScrollUpBtnStyle.border.right = 1;
  691. dropDownScrollUpBtnStyle.border.top = 1;
  692. dropDownScrollUpBtnStyle.border.bottom = 1;
  693. skin->setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  694. skin->setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  695. skin->setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  696. // DropDown scroll down button arrow
  697. GUIElementStyle dropDownScrollDownBtnArrowStyle;
  698. dropDownScrollDownBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnDownArrowTex);
  699. dropDownScrollDownBtnArrowStyle.hover.texture = dropDownScrollDownBtnArrowStyle.normal.texture;
  700. dropDownScrollDownBtnArrowStyle.active.texture = dropDownScrollDownBtnArrowStyle.hover.texture;
  701. dropDownScrollDownBtnArrowStyle.fixedHeight = true;
  702. dropDownScrollDownBtnArrowStyle.fixedWidth = false;
  703. dropDownScrollDownBtnArrowStyle.height = 7;
  704. dropDownScrollDownBtnArrowStyle.width = 30;
  705. dropDownScrollDownBtnArrowStyle.border.left = 1;
  706. dropDownScrollDownBtnArrowStyle.border.right = 1;
  707. dropDownScrollDownBtnArrowStyle.border.top = 1;
  708. dropDownScrollDownBtnArrowStyle.border.bottom = 1;
  709. skin->setStyle("ListBoxScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  710. skin->setStyle("MenuBarScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  711. skin->setStyle("ContextMenuScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  712. // DropDown scroll down button
  713. GUIElementStyle dropDownScrollDownBtnStyle;
  714. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  715. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  716. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  717. dropDownScrollDownBtnStyle.fixedHeight = true;
  718. dropDownScrollDownBtnStyle.fixedWidth = false;
  719. dropDownScrollDownBtnStyle.height = 7;
  720. dropDownScrollDownBtnStyle.width = 30;
  721. dropDownScrollDownBtnStyle.border.left = 1;
  722. dropDownScrollDownBtnStyle.border.right = 1;
  723. dropDownScrollDownBtnStyle.border.top = 1;
  724. dropDownScrollDownBtnStyle.border.bottom = 1;
  725. skin->setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  726. skin->setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  727. skin->setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  728. // DropDown entry button
  729. GUIElementStyle dropDownEntryBtnStyle;
  730. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  731. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  732. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  733. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  734. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  735. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  736. dropDownEntryBtnStyle.normal.textColor = TextNormalColor;
  737. dropDownEntryBtnStyle.hover.textColor = TextNormalColor;
  738. dropDownEntryBtnStyle.active.textColor = TextNormalColor;
  739. dropDownEntryBtnStyle.normalOn.textColor = TextNormalColor;
  740. dropDownEntryBtnStyle.hoverOn.textColor = TextNormalColor;
  741. dropDownEntryBtnStyle.activeOn.textColor = TextNormalColor;
  742. dropDownEntryBtnStyle.fixedHeight = true;
  743. dropDownEntryBtnStyle.fixedWidth = false;
  744. dropDownEntryBtnStyle.height = 14;
  745. dropDownEntryBtnStyle.width = 30;
  746. dropDownEntryBtnStyle.border.left = 1;
  747. dropDownEntryBtnStyle.border.right = 1;
  748. dropDownEntryBtnStyle.border.top = 1;
  749. dropDownEntryBtnStyle.border.bottom = 1;
  750. dropDownEntryBtnStyle.font = font;
  751. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  752. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  753. dropDownEntryBtnStyle.textVertAlign = TVA_Top;
  754. skin->setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  755. // DropDown entry button with expand
  756. GUIElementStyle dropDownEntryExpBtnStyle;
  757. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  758. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  759. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  760. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  761. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  762. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  763. dropDownEntryExpBtnStyle.normal.textColor = TextNormalColor;
  764. dropDownEntryExpBtnStyle.hover.textColor = TextNormalColor;
  765. dropDownEntryExpBtnStyle.active.textColor = TextNormalColor;
  766. dropDownEntryExpBtnStyle.normalOn.textColor = TextNormalColor;
  767. dropDownEntryExpBtnStyle.hoverOn.textColor = TextNormalColor;
  768. dropDownEntryExpBtnStyle.activeOn.textColor = TextNormalColor;
  769. dropDownEntryExpBtnStyle.fixedHeight = true;
  770. dropDownEntryExpBtnStyle.fixedWidth = false;
  771. dropDownEntryExpBtnStyle.height = 14;
  772. dropDownEntryExpBtnStyle.width = 30;
  773. dropDownEntryExpBtnStyle.border.left = 1;
  774. dropDownEntryExpBtnStyle.border.right = 6;
  775. dropDownEntryExpBtnStyle.border.top = 1;
  776. dropDownEntryExpBtnStyle.border.bottom = 1;
  777. dropDownEntryExpBtnStyle.font = font;
  778. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  779. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  780. dropDownEntryExpBtnStyle.textVertAlign = TVA_Top;
  781. skin->setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  782. // Drop down separator
  783. GUIElementStyle dropDownSeparatorStyle;
  784. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  785. dropDownSeparatorStyle.fixedHeight = true;
  786. dropDownSeparatorStyle.fixedWidth = false;
  787. dropDownSeparatorStyle.height = 3;
  788. dropDownSeparatorStyle.width = 30;
  789. dropDownSeparatorStyle.border.left = 1;
  790. dropDownSeparatorStyle.border.right = 1;
  791. dropDownSeparatorStyle.border.top = 1;
  792. dropDownSeparatorStyle.border.bottom = 1;
  793. skin->setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  794. // Drop down content
  795. GUIElementStyle dropDownContentStyle;
  796. dropDownContentStyle.minWidth = 50;
  797. dropDownContentStyle.minHeight = 20;
  798. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  799. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  800. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  801. skin->setStyle("ListBoxContent", dropDownContentStyle);
  802. skin->setStyle("MenuBarContent", dropDownContentStyle);
  803. skin->setStyle("ContextMenuContent", dropDownContentStyle);
  804. // DropDown box frame
  805. GUIElementStyle dropDownBoxStyle;
  806. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  807. dropDownBoxStyle.hover.texture = dropDownEntryBtnStyle.normal.texture;
  808. dropDownBoxStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  809. dropDownBoxStyle.fixedHeight = false;
  810. dropDownBoxStyle.fixedWidth = false;
  811. dropDownBoxStyle.border.left = 1;
  812. dropDownBoxStyle.border.right = 1;
  813. dropDownBoxStyle.border.top = 1;
  814. dropDownBoxStyle.border.bottom = 1;
  815. dropDownBoxStyle.margins.left = 1;
  816. dropDownBoxStyle.margins.right = 1;
  817. dropDownBoxStyle.margins.top = 1;
  818. dropDownBoxStyle.margins.bottom = 1;
  819. skin->setStyle("ListBoxFrame", dropDownBoxStyle);
  820. skin->setStyle("MenuBarFrame", dropDownBoxStyle);
  821. skin->setStyle("ContextMenuFrame", dropDownBoxStyle);
  822. /************************************************************************/
  823. /* MENU BAR */
  824. /************************************************************************/
  825. // MenuBar background
  826. GUIElementStyle menuBarBgStyle;
  827. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  828. menuBarBgStyle.height = 14;
  829. menuBarBgStyle.width = 2;
  830. menuBarBgStyle.border.bottom = 2;
  831. skin->setStyle(GUIMenuBar::getBackgroundStyleType(), menuBarBgStyle);
  832. // MenuBar separator line
  833. GUIElementStyle menuBarLineStyle;
  834. menuBarLineStyle.normal.texture = getGUITexture(MenuBarLineNormalTex);
  835. menuBarLineStyle.normalOn.texture = getGUITexture(MenuBarLineActiveTex);
  836. menuBarLineStyle.fixedHeight = true;
  837. menuBarLineStyle.height = 1;
  838. skin->setStyle(GUIMenuBar::getLineStyleType(), menuBarLineStyle);
  839. // MenuBar Banshee logo
  840. GUIElementStyle menuBarBansheeLogoStyle;
  841. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  842. menuBarBansheeLogoStyle.fixedHeight = true;
  843. menuBarBansheeLogoStyle.fixedWidth = true;
  844. menuBarBansheeLogoStyle.height = 46;
  845. menuBarBansheeLogoStyle.width = 46;
  846. skin->setStyle(GUIMenuBar::getLogoStyleType(), menuBarBansheeLogoStyle);
  847. // MenuBar button
  848. GUIElementStyle menuBarBtnStyle;
  849. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  850. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  851. menuBarBtnStyle.active.texture = getGUITexture(MenuBarBtnActiveTex);
  852. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.active.texture;
  853. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.active.texture;
  854. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.active.texture;
  855. menuBarBtnStyle.normal.textColor = TextNormalColor;
  856. menuBarBtnStyle.hover.textColor = TextNormalColor;
  857. menuBarBtnStyle.active.textColor = TextActiveColor;
  858. menuBarBtnStyle.normalOn.textColor = TextActiveColor;
  859. menuBarBtnStyle.hoverOn.textColor = TextActiveColor;
  860. menuBarBtnStyle.activeOn.textColor = TextActiveColor;
  861. menuBarBtnStyle.fixedHeight = true;
  862. menuBarBtnStyle.fixedWidth = false;
  863. menuBarBtnStyle.height = 14;
  864. menuBarBtnStyle.width = 4;
  865. menuBarBtnStyle.margins.left = 2;
  866. menuBarBtnStyle.margins.right = 2;
  867. menuBarBtnStyle.margins.top = 2;
  868. menuBarBtnStyle.margins.bottom = 2;
  869. menuBarBtnStyle.font = font;
  870. menuBarBtnStyle.fontSize = DefaultFontSize;
  871. menuBarBtnStyle.textHorzAlign = THA_Left;
  872. menuBarBtnStyle.textVertAlign = TVA_Top;
  873. skin->setStyle(GUIMenuBar::getMenuItemButtonStyleType(), menuBarBtnStyle);
  874. // ToolBar separator
  875. GUIElementStyle toolBarSeparator;
  876. toolBarSeparator.normal.texture = getGUITexture(ToolBarSeparatorTex);
  877. toolBarSeparator.fixedWidth = true;
  878. toolBarSeparator.width = 3;
  879. toolBarSeparator.height = 30;
  880. skin->setStyle(GUIMenuBar::getToolBarSeparatorStyleType(), toolBarSeparator);
  881. // ToolBar button
  882. GUIElementStyle toolBarBtnStyle;
  883. toolBarBtnStyle.normal.texture = getGUITexture(ToolBarBtnNormalTex);
  884. toolBarBtnStyle.hover.texture = getGUITexture(ToolBarBtnHoverTex);
  885. toolBarBtnStyle.active.texture = getGUITexture(ToolBarBtnActiveTex);
  886. toolBarBtnStyle.normal.textColor = TextNormalColor;
  887. toolBarBtnStyle.hover.textColor = TextNormalColor;
  888. toolBarBtnStyle.active.textColor = TextActiveColor;
  889. toolBarBtnStyle.fixedHeight = true;
  890. toolBarBtnStyle.fixedWidth = true;
  891. toolBarBtnStyle.height = 30;
  892. toolBarBtnStyle.width = 30;
  893. skin->setStyle(GUIMenuBar::getToolBarButtonStyleType(), toolBarBtnStyle);
  894. /************************************************************************/
  895. /* DOCK SLIDER */
  896. /************************************************************************/
  897. GUIElementStyle dockSliderBtnStyle;
  898. dockSliderBtnStyle.normal.texture = getGUITexture(DockSliderNormalTex);
  899. dockSliderBtnStyle.hover.texture = dockSliderBtnStyle.normal.texture;
  900. dockSliderBtnStyle.active.texture = dockSliderBtnStyle.normal.texture;
  901. dockSliderBtnStyle.fixedHeight = false;
  902. dockSliderBtnStyle.fixedWidth = false;
  903. dockSliderBtnStyle.height = 2;
  904. dockSliderBtnStyle.width = 2;
  905. skin->setStyle("DockSliderBtn", dockSliderBtnStyle);
  906. /************************************************************************/
  907. /* TREE VIEW */
  908. /************************************************************************/
  909. // Expand button
  910. GUIElementStyle treeViewExpandButtonStyle;
  911. treeViewExpandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  912. treeViewExpandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  913. treeViewExpandButtonStyle.active.texture = treeViewExpandButtonStyle.hover.texture;
  914. treeViewExpandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  915. treeViewExpandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  916. treeViewExpandButtonStyle.activeOn.texture = treeViewExpandButtonStyle.hoverOn.texture;
  917. treeViewExpandButtonStyle.margins.left = 4;
  918. treeViewExpandButtonStyle.margins.right = 4;
  919. treeViewExpandButtonStyle.margins.top = 5;
  920. treeViewExpandButtonStyle.margins.bottom = 4;
  921. treeViewExpandButtonStyle.fixedHeight = true;
  922. treeViewExpandButtonStyle.fixedWidth = true;
  923. treeViewExpandButtonStyle.height = 16;
  924. treeViewExpandButtonStyle.width = 16;
  925. skin->setStyle("TreeViewFoldoutBtn", treeViewExpandButtonStyle);
  926. // Entry
  927. GUIElementStyle treeViewEntryStyle;
  928. treeViewEntryStyle.font = font;
  929. treeViewEntryStyle.fontSize = DefaultFontSize;
  930. treeViewEntryStyle.fixedWidth = false;
  931. treeViewEntryStyle.fixedHeight = true;
  932. treeViewEntryStyle.height = 16;
  933. treeViewEntryStyle.minWidth = 10;
  934. treeViewEntryStyle.normal.textColor = TextNormalColor;
  935. skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
  936. // Selection background
  937. GUIElementStyle treeViewSelBackgroundStyle;
  938. treeViewSelBackgroundStyle.normal.texture = getGUITexture(SelectionBgTex);
  939. treeViewSelBackgroundStyle.fixedHeight = false;
  940. treeViewSelBackgroundStyle.fixedWidth = false;
  941. treeViewSelBackgroundStyle.height = 2;
  942. treeViewSelBackgroundStyle.width = 2;
  943. skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  944. // Highlight background
  945. GUIElementStyle treeViewHLBackgroundStyle;
  946. treeViewHLBackgroundStyle.normal.texture = getGUITexture(TreeViewHighlightBackground);
  947. treeViewHLBackgroundStyle.fixedHeight = false;
  948. treeViewHLBackgroundStyle.fixedWidth = false;
  949. treeViewHLBackgroundStyle.height = 2;
  950. treeViewHLBackgroundStyle.width = 2;
  951. skin->setStyle("TreeViewHighlightBackground", treeViewHLBackgroundStyle);
  952. // Edit box
  953. GUIElementStyle treeViewEditBox;
  954. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  955. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  956. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  957. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  958. treeViewEditBox.normal.textColor = TextNormalColor;
  959. treeViewEditBox.hover.textColor = TextNormalColor;
  960. treeViewEditBox.focused.textColor = TextNormalColor;
  961. treeViewEditBox.active.textColor = TextNormalColor;
  962. treeViewEditBox.border.left = 1;
  963. treeViewEditBox.border.right = 1;
  964. treeViewEditBox.border.top = 1;
  965. treeViewEditBox.border.bottom = 1;
  966. treeViewEditBox.margins.left = 1;
  967. treeViewEditBox.margins.right = 1;
  968. treeViewEditBox.margins.top = 1;
  969. treeViewEditBox.margins.bottom = 1;
  970. treeViewEditBox.fixedHeight = true;
  971. treeViewEditBox.height = 13;
  972. treeViewEditBox.minWidth = 10;
  973. treeViewEditBox.font = font;
  974. treeViewEditBox.fontSize = DefaultFontSize;
  975. treeViewEditBox.textHorzAlign = THA_Left;
  976. treeViewEditBox.textVertAlign = TVA_Top;
  977. skin->setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  978. // Element highlight
  979. GUIElementStyle treeViewElementHighlight;
  980. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  981. treeViewElementHighlight.border.left = 1;
  982. treeViewElementHighlight.border.right = 1;
  983. treeViewElementHighlight.border.top = 1;
  984. treeViewElementHighlight.border.bottom = 1;
  985. skin->setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  986. // Element separator highlight
  987. GUIElementStyle treeViewElementSepHighlight;
  988. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  989. treeViewElementSepHighlight.border.left = 1;
  990. treeViewElementSepHighlight.border.right = 1;
  991. treeViewElementSepHighlight.border.top = 1;
  992. treeViewElementSepHighlight.border.bottom = 1;
  993. skin->setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  994. /************************************************************************/
  995. /* OBJECT DROP FIELD */
  996. /************************************************************************/
  997. GUIElementStyle objectDropStyle;
  998. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  999. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  1000. objectDropStyle.normal.textColor = TextNormalColor;
  1001. objectDropStyle.hover.textColor = TextNormalColor;
  1002. objectDropStyle.active.textColor = TextNormalColor;
  1003. objectDropStyle.normalOn.textColor = TextNormalColor;
  1004. objectDropStyle.hoverOn.textColor = TextNormalColor;
  1005. objectDropStyle.activeOn.textColor = TextNormalColor;
  1006. objectDropStyle.border.left = 2;
  1007. objectDropStyle.border.top = 2;
  1008. objectDropStyle.border.bottom = 4;
  1009. objectDropStyle.contentOffset.left = 3;
  1010. objectDropStyle.contentOffset.right = 1;
  1011. objectDropStyle.margins.bottom = 2;
  1012. objectDropStyle.fixedHeight = true;
  1013. objectDropStyle.height = 21;
  1014. objectDropStyle.minWidth = 20;
  1015. objectDropStyle.font = font;
  1016. objectDropStyle.fontSize = DefaultFontSize;
  1017. objectDropStyle.textHorzAlign = THA_Center;
  1018. objectDropStyle.textVertAlign = TVA_Center;
  1019. skin->setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  1020. GUIElementStyle objectClearBtnStyle;
  1021. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  1022. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  1023. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  1024. objectClearBtnStyle.fixedHeight = true;
  1025. objectClearBtnStyle.fixedWidth = true;
  1026. objectClearBtnStyle.height = 21;
  1027. objectClearBtnStyle.width = 16;
  1028. objectClearBtnStyle.margins.bottom = 2;
  1029. skin->setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  1030. GUIElementStyle editorObjectFieldStyle;
  1031. editorObjectFieldStyle.fixedHeight = true;
  1032. editorObjectFieldStyle.height = 15;
  1033. editorObjectFieldStyle.minWidth = 30;
  1034. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1035. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  1036. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  1037. skin->setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  1038. /************************************************************************/
  1039. /* TEXTURE DROP FIELD */
  1040. /************************************************************************/
  1041. GUIElementStyle textureFieldStyle;
  1042. textureFieldStyle.minHeight = 15;
  1043. textureFieldStyle.minWidth = 15;
  1044. textureFieldStyle.subStyles[TextureFieldDropStyleName] = TextureFieldDropStyleName;
  1045. textureFieldStyle.subStyles[TextureFieldClearBtnStyleName] = TextureFieldClearBtnStyleName;
  1046. textureFieldStyle.subStyles[TextureFieldLabelStyleName] = GUITextField::getLabelStyleType();
  1047. skin->setStyle(TextureFieldStyleName, textureFieldStyle);
  1048. GUIElementStyle textureDropStyle;
  1049. textureDropStyle.font = font;
  1050. textureDropStyle.fontSize = DefaultFontSize;
  1051. textureDropStyle.textHorzAlign = THA_Center;
  1052. textureDropStyle.textVertAlign = TVA_Center;
  1053. textureDropStyle.normal.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1054. textureDropStyle.normal.texture = getGUITexture(TextureDropTex);
  1055. textureDropStyle.hover.textColor = textureDropStyle.normal.textColor;
  1056. textureDropStyle.hover.texture = textureDropStyle.normal.texture;
  1057. textureDropStyle.active.textColor = textureDropStyle.normal.textColor;
  1058. textureDropStyle.active.texture = textureDropStyle.normal.texture;
  1059. textureDropStyle.normalOn.textColor = Color(95 / 255.0f, 95 / 255.0f, 95 / 255.0f, 1.0f);
  1060. textureDropStyle.normalOn.texture = getGUITexture(TextureDropOnTex);
  1061. textureDropStyle.hoverOn.textColor = textureDropStyle.normalOn.textColor;
  1062. textureDropStyle.hoverOn.texture = textureDropStyle.normalOn.texture;
  1063. textureDropStyle.activeOn.textColor = textureDropStyle.normalOn.textColor;
  1064. textureDropStyle.activeOn.texture = textureDropStyle.normalOn.texture;
  1065. textureDropStyle.height = 82;
  1066. textureDropStyle.width = 82;
  1067. textureDropStyle.fixedHeight = true;
  1068. textureDropStyle.fixedWidth = true;
  1069. textureDropStyle.border.left = 2;
  1070. textureDropStyle.border.right = 2;
  1071. textureDropStyle.border.top = 2;
  1072. textureDropStyle.border.bottom = 2;
  1073. skin->setStyle(TextureFieldDropStyleName, textureDropStyle);
  1074. GUIElementStyle textureDropClearStyle;
  1075. textureDropClearStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1076. textureDropClearStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1077. textureDropClearStyle.active.texture = textureDropStyle.hover.texture;
  1078. textureDropClearStyle.fixedWidth = true;
  1079. textureDropClearStyle.fixedHeight = true;
  1080. textureDropClearStyle.height = 11;
  1081. textureDropClearStyle.width = 11;
  1082. skin->setStyle(TextureFieldClearBtnStyleName, textureDropClearStyle);
  1083. /************************************************************************/
  1084. /* EDITOR FIELDS */
  1085. /************************************************************************/
  1086. GUIElementStyle editorFieldLabelStyle;
  1087. editorFieldLabelStyle.font = font;
  1088. editorFieldLabelStyle.fontSize = DefaultFontSize;
  1089. editorFieldLabelStyle.fixedWidth = false;
  1090. editorFieldLabelStyle.fixedHeight = true;
  1091. editorFieldLabelStyle.height = 11;
  1092. editorFieldLabelStyle.minWidth = 10;
  1093. editorFieldLabelStyle.textHorzAlign = THA_Left;
  1094. skin->setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  1095. GUIElementStyle editorIntFieldStyle;
  1096. editorIntFieldStyle.fixedHeight = true;
  1097. editorIntFieldStyle.height = 21;
  1098. editorIntFieldStyle.minWidth = 30;
  1099. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1100. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1101. skin->setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  1102. GUIElementStyle editorFloatFieldStyle;
  1103. editorFloatFieldStyle.fixedHeight = true;
  1104. editorFloatFieldStyle.height = 21;
  1105. editorFloatFieldStyle.minWidth = 30;
  1106. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1107. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1108. skin->setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  1109. GUIElementStyle editorTextFieldStyle;
  1110. editorTextFieldStyle.fixedHeight = true;
  1111. editorTextFieldStyle.height = 21;
  1112. editorTextFieldStyle.minWidth = 30;
  1113. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1114. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  1115. skin->setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  1116. GUIElementStyle editorColorFieldStyle;
  1117. editorColorFieldStyle.fixedHeight = true;
  1118. editorColorFieldStyle.height = 15;
  1119. editorColorFieldStyle.minWidth = 30;
  1120. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1121. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  1122. skin->setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  1123. GUIElementStyle editorToggleFieldStyle;
  1124. editorToggleFieldStyle.fixedHeight = true;
  1125. editorToggleFieldStyle.height = 15;
  1126. editorToggleFieldStyle.minWidth = 30;
  1127. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1128. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  1129. skin->setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  1130. GUIElementStyle editorVector2FieldStyle;
  1131. editorVector2FieldStyle.fixedHeight = true;
  1132. editorVector2FieldStyle.height = 30;
  1133. editorVector2FieldStyle.minWidth = 30;
  1134. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1135. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1136. skin->setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  1137. GUIElementStyle editorVector3FieldStyle;
  1138. editorVector3FieldStyle.fixedHeight = true;
  1139. editorVector3FieldStyle.height = 30;
  1140. editorVector3FieldStyle.minWidth = 30;
  1141. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1142. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1143. skin->setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  1144. GUIElementStyle editorVector4FieldStyle;
  1145. editorVector4FieldStyle.fixedHeight = true;
  1146. editorVector4FieldStyle.height = 30;
  1147. editorVector4FieldStyle.minWidth = 30;
  1148. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  1149. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  1150. skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  1151. /************************************************************************/
  1152. /* COMPONENT FOLDOUT */
  1153. /************************************************************************/
  1154. GUIElementStyle cmpFoldoutBtnStyle;
  1155. cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
  1156. cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
  1157. cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1158. cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
  1159. cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
  1160. cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  1161. cmpFoldoutBtnStyle.normal.textColor = TextNormalColor;
  1162. cmpFoldoutBtnStyle.hover.textColor = TextNormalColor;
  1163. cmpFoldoutBtnStyle.active.textColor = TextNormalColor;
  1164. cmpFoldoutBtnStyle.normalOn.textColor = TextNormalColor;
  1165. cmpFoldoutBtnStyle.hoverOn.textColor = TextNormalColor;
  1166. cmpFoldoutBtnStyle.activeOn.textColor = TextNormalColor;
  1167. cmpFoldoutBtnStyle.fixedHeight = true;
  1168. cmpFoldoutBtnStyle.fixedWidth = false;
  1169. cmpFoldoutBtnStyle.height = 10;
  1170. cmpFoldoutBtnStyle.minWidth = 10;
  1171. cmpFoldoutBtnStyle.font = font;
  1172. cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
  1173. cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
  1174. cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
  1175. cmpFoldoutBtnStyle.contentOffset = RectOffset(12, 0, 0, 0);
  1176. cmpFoldoutBtnStyle.border.left = 8;
  1177. skin->setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
  1178. GUIElementStyle cmpFoldoutRemoveBtnStyle;
  1179. cmpFoldoutRemoveBtnStyle.normal.texture = getGUITexture(XButtonNormalTex);
  1180. cmpFoldoutRemoveBtnStyle.hover.texture = getGUITexture(XButtonHoverTex);
  1181. cmpFoldoutRemoveBtnStyle.active.texture = cmpFoldoutRemoveBtnStyle.hover.texture;
  1182. cmpFoldoutRemoveBtnStyle.fixedHeight = true;
  1183. cmpFoldoutRemoveBtnStyle.fixedWidth = true;
  1184. cmpFoldoutRemoveBtnStyle.height = 11;
  1185. cmpFoldoutRemoveBtnStyle.width = 11;
  1186. skin->setStyle(GUIComponentFoldout::getFoldoutRemoveButtonStyleType(), cmpFoldoutRemoveBtnStyle);
  1187. GUIElementStyle cmpFoldoutStyle;
  1188. cmpFoldoutStyle.fixedHeight = true;
  1189. cmpFoldoutStyle.height = 12;
  1190. cmpFoldoutStyle.minWidth = 30;
  1191. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
  1192. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutRemoveButtonStyleType()] = GUIComponentFoldout::getFoldoutRemoveButtonStyleType();
  1193. skin->setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
  1194. /************************************************************************/
  1195. /* FOLDOUT */
  1196. /************************************************************************/
  1197. GUIElementStyle foldoutBtnStyle;
  1198. foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  1199. foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  1200. foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
  1201. foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  1202. foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  1203. foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
  1204. foldoutBtnStyle.fixedHeight = true;
  1205. foldoutBtnStyle.fixedWidth = true;
  1206. foldoutBtnStyle.height = 10;
  1207. foldoutBtnStyle.width = 8;
  1208. skin->setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
  1209. GUIElementStyle foldoutStyle;
  1210. foldoutStyle.fixedHeight = true;
  1211. foldoutStyle.height = 12;
  1212. foldoutStyle.minWidth = 30;
  1213. foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
  1214. foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
  1215. skin->setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
  1216. /************************************************************************/
  1217. /* PROGRESS BAR */
  1218. /************************************************************************/
  1219. GUIElementStyle progressBarBgStyle;
  1220. progressBarBgStyle.fixedHeight = true;
  1221. progressBarBgStyle.height = 18;
  1222. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  1223. skin->setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  1224. GUIElementStyle progressBarFillStyle;
  1225. progressBarFillStyle.fixedHeight = true;
  1226. progressBarFillStyle.height = 12;
  1227. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  1228. skin->setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  1229. GUIElementStyle progressBarStyle;
  1230. progressBarStyle.fixedHeight = true;
  1231. progressBarStyle.height = 18;
  1232. progressBarStyle.minWidth = 100;
  1233. progressBarStyle.margins.top = 3;
  1234. progressBarStyle.margins.bottom = 3;
  1235. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  1236. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  1237. skin->setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  1238. /************************************************************************/
  1239. /* COLOR PICKER SLIDER */
  1240. /************************************************************************/
  1241. GUIElementStyle colorPickerSliderHorzHandleStyle;
  1242. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1243. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  1244. colorPickerSliderHorzHandleStyle.height = 20;
  1245. colorPickerSliderHorzHandleStyle.width = 7;
  1246. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  1247. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1248. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  1249. skin->setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  1250. GUIElementStyle colorPickerSliderHorzStyle;
  1251. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  1252. colorPickerSliderHorzHandleStyle.height = 32;
  1253. colorPickerSliderHorzHandleStyle.minWidth = 20;
  1254. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  1255. skin->setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  1256. GUIElementStyle colorPickerSliderVertHandleStyle;
  1257. colorPickerSliderVertHandleStyle.fixedHeight = true;
  1258. colorPickerSliderVertHandleStyle.fixedWidth = true;
  1259. colorPickerSliderVertHandleStyle.height = 7;
  1260. colorPickerSliderVertHandleStyle.width = 45;
  1261. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  1262. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1263. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  1264. skin->setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  1265. GUIElementStyle colorPickerSliderVertStyle;
  1266. colorPickerSliderVertStyle.fixedWidth = true;
  1267. colorPickerSliderVertStyle.width = 30;
  1268. colorPickerSliderVertStyle.minHeight = 20;
  1269. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  1270. skin->setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  1271. GUIElementStyle colorPickerSlider2DHandleStyle;
  1272. colorPickerSlider2DHandleStyle.fixedHeight = true;
  1273. colorPickerSlider2DHandleStyle.fixedWidth = true;
  1274. colorPickerSlider2DHandleStyle.height = 8;
  1275. colorPickerSlider2DHandleStyle.width = 8;
  1276. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  1277. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1278. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1279. skin->setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  1280. /************************************************************************/
  1281. /* STATUS BAR */
  1282. /************************************************************************/
  1283. GUIElementStyle statusBarBgStyle;
  1284. statusBarBgStyle.height = 16;
  1285. statusBarBgStyle.border.top = 2;
  1286. statusBarBgStyle.normal.texture = getGUITexture(StatusBarBgTex);
  1287. skin->setStyle(GUIStatusBar::getGUIBackgroundTypeName(), statusBarBgStyle);
  1288. GUIElementStyle statusBarMessageBtnStyle;
  1289. statusBarMessageBtnStyle.font = font;
  1290. statusBarMessageBtnStyle.fontSize = DefaultFontSize;
  1291. statusBarMessageBtnStyle.fixedHeight = true;
  1292. statusBarMessageBtnStyle.height = 16;
  1293. statusBarMessageBtnStyle.minWidth = 10;
  1294. statusBarMessageBtnStyle.textHorzAlign = THA_Left;
  1295. statusBarMessageBtnStyle.textVertAlign = TVA_Center;
  1296. statusBarMessageBtnStyle.imagePosition = GUIImagePosition::Left;
  1297. skin->setStyle(GUIStatusBar::getGUIMessageTypeName(), statusBarMessageBtnStyle);
  1298. GUIElementStyle statusBarStyle;
  1299. statusBarStyle.height = 16;
  1300. statusBarStyle.subStyles[GUIStatusBar::getGUIBackgroundTypeName()] = GUIStatusBar::getGUIBackgroundTypeName();
  1301. statusBarStyle.subStyles[GUIStatusBar::getGUIMessageTypeName()] = GUIStatusBar::getGUIMessageTypeName();
  1302. skin->setStyle(GUIStatusBar::getGUITypeName(), statusBarStyle);
  1303. /************************************************************************/
  1304. /* OTHER */
  1305. /************************************************************************/
  1306. // Right-aligned label
  1307. GUIElementStyle rightAlignedLabelStyle;
  1308. rightAlignedLabelStyle.font = font;
  1309. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  1310. rightAlignedLabelStyle.fixedWidth = false;
  1311. rightAlignedLabelStyle.fixedHeight = true;
  1312. rightAlignedLabelStyle.height = 11;
  1313. rightAlignedLabelStyle.minWidth = 10;
  1314. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  1315. rightAlignedLabelStyle.normal.textColor = TextNormalColor;
  1316. skin->setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  1317. // Multi-line label
  1318. GUIElementStyle multiLinelabelStyle;
  1319. multiLinelabelStyle.font = font;
  1320. multiLinelabelStyle.fontSize = DefaultFontSize;
  1321. multiLinelabelStyle.fixedWidth = false;
  1322. multiLinelabelStyle.fixedHeight = true;
  1323. multiLinelabelStyle.height = 11;
  1324. multiLinelabelStyle.minWidth = 10;
  1325. multiLinelabelStyle.wordWrap = true;
  1326. multiLinelabelStyle.normal.textColor = TextNormalColor;
  1327. skin->setStyle("MultiLineLabel", multiLinelabelStyle);
  1328. // Multi-line centered label
  1329. GUIElementStyle multiLineCenteredLabelStyle;
  1330. multiLineCenteredLabelStyle.font = font;
  1331. multiLineCenteredLabelStyle.fontSize = DefaultFontSize;
  1332. multiLineCenteredLabelStyle.fixedWidth = false;
  1333. multiLineCenteredLabelStyle.fixedHeight = true;
  1334. multiLineCenteredLabelStyle.height = 11;
  1335. multiLineCenteredLabelStyle.minWidth = 10;
  1336. multiLineCenteredLabelStyle.wordWrap = true;
  1337. multiLineCenteredLabelStyle.textHorzAlign = THA_Center;
  1338. multiLineCenteredLabelStyle.normal.textColor = TextNormalColor;
  1339. skin->setStyle("MultiLineLabelCentered", multiLineCenteredLabelStyle);
  1340. // Selection area
  1341. GUIElementStyle selectionAreaStyle;
  1342. selectionAreaStyle.normal.texture = getGUITexture(SelectionAreaTex);
  1343. selectionAreaStyle.border.left = 1;
  1344. selectionAreaStyle.border.right = 1;
  1345. selectionAreaStyle.border.top = 1;
  1346. selectionAreaStyle.border.bottom = 1;
  1347. skin->setStyle("SelectionArea", selectionAreaStyle);
  1348. // Selectable label
  1349. GUIElementStyle selectableLabelStyle;
  1350. selectableLabelStyle.normalOn.texture = getGUITexture(SelectionBgTex);
  1351. selectableLabelStyle.hoverOn.texture = selectableLabelStyle.normalOn.texture;
  1352. selectableLabelStyle.activeOn.texture = selectableLabelStyle.normalOn.texture;
  1353. selectableLabelStyle.fixedHeight = true;
  1354. selectableLabelStyle.height = 11;
  1355. selectableLabelStyle.minWidth = 10;
  1356. selectableLabelStyle.font = font;
  1357. selectableLabelStyle.fontSize = DefaultFontSize;
  1358. selectableLabelStyle.textHorzAlign = THA_Left;
  1359. selectableLabelStyle.normal.textColor = TextNormalColor;
  1360. skin->setStyle("SelectableLabel", selectableLabelStyle);
  1361. // Scroll area background
  1362. GUIElementStyle scrollAreaBg;
  1363. scrollAreaBg.normal.texture = getGUITexture(ScrollAreaBgTex);
  1364. scrollAreaBg.minHeight = 6;
  1365. scrollAreaBg.minWidth = 4;
  1366. scrollAreaBg.border.left = 2;
  1367. scrollAreaBg.border.right = 2;
  1368. scrollAreaBg.border.top = 2;
  1369. scrollAreaBg.border.bottom = 4;
  1370. skin->setStyle("ScrollAreaBg", scrollAreaBg);
  1371. return skin;
  1372. }
  1373. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name)
  1374. {
  1375. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1376. texturePath.append(EditorSkinFolder);
  1377. texturePath.append(L"sprite_" + name + L".asset");
  1378. return Resources::instance().load<SpriteTexture>(texturePath);
  1379. }
  1380. HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name)
  1381. {
  1382. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1383. texturePath.append(EditorIconFolder);
  1384. texturePath.append(L"sprite_" + name + L".asset");
  1385. return Resources::instance().load<SpriteTexture>(texturePath);
  1386. }
  1387. HShader BuiltinEditorResources::getShader(const WString& name)
  1388. {
  1389. Path programPath = EditorShaderFolder;
  1390. programPath.append(name + L".asset");
  1391. return gResources().load<Shader>(programPath);
  1392. }
  1393. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1394. {
  1395. return Material::create(mShaderDockOverlay);
  1396. }
  1397. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1398. {
  1399. return Material::create(mShaderSceneGrid);
  1400. }
  1401. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1402. {
  1403. UINT32 modeIdx = (UINT32)cullMode;
  1404. return Material::create(mShaderPicking[modeIdx]);
  1405. }
  1406. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1407. {
  1408. UINT32 modeIdx = (UINT32)cullMode;
  1409. return Material::create(mShaderPickingAlpha[modeIdx]);
  1410. }
  1411. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1412. {
  1413. return Material::create(mShaderGizmoWire);
  1414. }
  1415. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1416. {
  1417. return Material::create(mShaderGizmoSolid);
  1418. }
  1419. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1420. {
  1421. return Material::create(mShaderGizmoIcon);
  1422. }
  1423. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1424. {
  1425. return Material::create(mShaderGizmoPicking);
  1426. }
  1427. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1428. {
  1429. return Material::create(mShaderGizmoAlphaPicking);
  1430. }
  1431. HMaterial BuiltinEditorResources::createWireHandleMat() const
  1432. {
  1433. return Material::create(mShaderHandleWire);
  1434. }
  1435. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1436. {
  1437. return Material::create(mShaderHandleSolid);
  1438. }
  1439. HMaterial BuiltinEditorResources::createSelectionMat() const
  1440. {
  1441. return Material::create(mShaderSelection);
  1442. }
  1443. HSpriteTexture BuiltinEditorResources::getLibraryIcon(ProjectIcon icon) const
  1444. {
  1445. switch (icon)
  1446. {
  1447. case ProjectIcon::Folder:
  1448. return getGUIIcon(FolderIconTex);
  1449. case ProjectIcon::Font:
  1450. return getGUIIcon(FontIconTex);
  1451. case ProjectIcon::Mesh:
  1452. return getGUIIcon(MeshIconTex);
  1453. case ProjectIcon::Texture:
  1454. return getGUIIcon(TextureIconTex);
  1455. case ProjectIcon::PlainText:
  1456. return getGUIIcon(PlainTextIconTex);
  1457. case ProjectIcon::ScriptCode:
  1458. return getGUIIcon(ScriptCodeIconTex);
  1459. case ProjectIcon::Shader:
  1460. return getGUIIcon(ShaderIconTex);
  1461. case ProjectIcon::ShaderInclude:
  1462. return getGUIIcon(ShaderIncludeIconTex);
  1463. case ProjectIcon::Material:
  1464. return getGUIIcon(MaterialIconTex);
  1465. case ProjectIcon::SpriteTexture:
  1466. return getGUIIcon(SpriteTextureIconTex);
  1467. case ProjectIcon::Prefab:
  1468. return getGUIIcon(PrefabIconTex);
  1469. }
  1470. return HSpriteTexture();
  1471. }
  1472. HSpriteTexture BuiltinEditorResources::getLogMessageIcon(LogMessageIcon icon) const
  1473. {
  1474. switch (icon)
  1475. {
  1476. case LogMessageIcon::Info:
  1477. return getGUIIcon(LogInfoIconTex);
  1478. case LogMessageIcon::Warning:
  1479. return getGUIIcon(LogWarningIconTex);
  1480. case LogMessageIcon::Error:
  1481. return getGUIIcon(LogErrorIconTex);
  1482. }
  1483. return HSpriteTexture();
  1484. }
  1485. }