BsBuiltinEditorResources.cpp 98 KB

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