BsBuiltinEditorResources.cpp 111 KB

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