BsBuiltinEditorResources.cpp 99 KB

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