BsBuiltinEditorResources.cpp 81 KB

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