BsBuiltinEditorResources.cpp 109 KB

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