BsBuiltinEditorResources.cpp 110 KB

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