BsBuiltinEditorResources.cpp 81 KB

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