BsBuiltinEditorResources.cpp 95 KB

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