BsBuiltinEditorResources.cpp 76 KB

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