BsBuiltinEditorResources.cpp 93 KB

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