BsBuiltinEditorResources.cpp 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365
  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 "BsGUIComponentFoldout.h"
  22. #include "BsGUIFoldout.h"
  23. #include "BsGUIProgressBar.h"
  24. #include "BsGUISlider.h"
  25. #include "BsGUIDropDownContent.h"
  26. #include "BsFont.h"
  27. #include "BsFontImportOptions.h"
  28. #include "BsImporter.h"
  29. #include "BsGpuProgram.h"
  30. #include "BsShader.h"
  31. #include "BsShaderInclude.h"
  32. #include "BsTechnique.h"
  33. #include "BsPass.h"
  34. #include "BsMaterial.h"
  35. #include "BsBlendState.h"
  36. #include "BsDepthStencilState.h"
  37. #include "BsRasterizerState.h"
  38. #include "BsResources.h"
  39. #include "BsRTTIType.h"
  40. #include "BsFileSystem.h"
  41. #include "BsResourceManifest.h"
  42. namespace BansheeEngine
  43. {
  44. const String BuiltinEditorResources::ObjectFieldStyleName = "GUIObjectField";
  45. const String BuiltinEditorResources::ObjectFieldLabelStyleName = "EditorFieldLabel";
  46. const String BuiltinEditorResources::ObjectFieldDropBtnStyleName = "DropButton";
  47. const String BuiltinEditorResources::ObjectFieldClearBtnStyleName = "ObjectClearButton";
  48. const WString BuiltinEditorResources::DefaultFontFilename = L"arial.ttf";
  49. const UINT32 BuiltinEditorResources::DefaultFontSize = 10;
  50. const WString BuiltinEditorResources::GUISkinFile = L"GUISkin";
  51. const Path BuiltinEditorResources::ShaderFolder = L"Shaders\\";
  52. const Path BuiltinEditorResources::SkinFolder = L"Skin\\";
  53. const Path BuiltinEditorResources::IconFolder = L"Skin\\Icons";
  54. const Path BuiltinEditorResources::ShaderIncludeFolder = L"Includes\\";
  55. const Path BuiltinEditorResources::BuiltinRawDataFolder = L"..\\..\\..\\..\\Data\\Raw\\Editor\\";
  56. const Path BuiltinEditorResources::EditorRawSkinFolder = BuiltinRawDataFolder + SkinFolder;
  57. const Path BuiltinEditorResources::EditorRawShaderFolder = BuiltinRawDataFolder + ShaderFolder;
  58. const Path BuiltinEditorResources::EditorRawShaderIncludeFolder = BuiltinRawDataFolder + ShaderIncludeFolder;
  59. const Path BuiltinEditorResources::BuiltinDataFolder = L"..\\..\\..\\..\\Data\\Editor\\";
  60. const Path BuiltinEditorResources::EditorSkinFolder = BuiltinDataFolder + SkinFolder;
  61. const Path BuiltinEditorResources::EditorIconFolder = BuiltinDataFolder + IconFolder;
  62. const Path BuiltinEditorResources::EditorShaderFolder = BuiltinDataFolder + ShaderFolder;
  63. const Path BuiltinEditorResources::EditorShaderIncludeFolder = BuiltinDataFolder + ShaderIncludeFolder;
  64. const Path BuiltinEditorResources::ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
  65. const WString BuiltinEditorResources::FolderIconTex = L"FolderIcon.psd";
  66. const WString BuiltinEditorResources::MeshIconTex = L"MeshIcon.psd";
  67. const WString BuiltinEditorResources::TextureIconTex = L"TextureIcon.psd";
  68. const WString BuiltinEditorResources::FontIconTex = L"FontIcon.psd";
  69. const WString BuiltinEditorResources::PlainTextIconTex = L"TextIcon.psd";
  70. const WString BuiltinEditorResources::ScriptCodeIconTex = L"CSharpIcon.psd";
  71. const WString BuiltinEditorResources::ShaderIconTex = L"ShaderIcon.psd";
  72. const WString BuiltinEditorResources::ShaderIncludeIconTex = L"ShaderIncludeIcon.psd";
  73. const WString BuiltinEditorResources::MaterialIconTex = L"MaterialIcon.psd";
  74. const WString BuiltinEditorResources::SpriteTextureIconTex = L"SpriteIcon.psd";
  75. const WString BuiltinEditorResources::WindowBackgroundTexture = L"WindowBgTile.psd";
  76. const WString BuiltinEditorResources::ButtonNormalTex = L"ButtonNormal.psd";
  77. const WString BuiltinEditorResources::ButtonHoverTex = L"ButtonHover.psd";
  78. const WString BuiltinEditorResources::ButtonActiveTex = L"ButtonActive.psd";
  79. const WString BuiltinEditorResources::ToggleNormalTex = L"ToggleNormal.psd";
  80. const WString BuiltinEditorResources::ToggleHoverTex = L"ToggleHover.psd";
  81. const WString BuiltinEditorResources::ToggleActiveTex = L"ToggleActive.psd";
  82. const WString BuiltinEditorResources::ToggleNormalOnTex = L"ToggleOnNormal.psd";
  83. const WString BuiltinEditorResources::ToggleHoverOnTex = L"ToggleOnHover.psd";
  84. const WString BuiltinEditorResources::ToggleActiveOnTex = L"ToggleOnActive.psd";
  85. const WString BuiltinEditorResources::ObjectDropBtnNormalTex = L"ObjectFieldDropNormal.psd";
  86. const WString BuiltinEditorResources::ObjectDropBtnNormalOnTex = L"ObjectFieldDropOnNormal.psd";
  87. const WString BuiltinEditorResources::ObjectClearBtnNormalTex = L"ObjectFieldBtnNormal.psd";
  88. const WString BuiltinEditorResources::ObjectClearBtnHoverTex = L"ObjectFieldBtnHover.psd";
  89. const WString BuiltinEditorResources::ObjectClearBtnActiveTex = L"ObjectFieldBtnActive.psd";
  90. const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutOpenNormal.psd";
  91. const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutOpenHover.psd";
  92. const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutClosedNormal.psd";
  93. const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutClosedHover.psd";
  94. const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"CmpFoldoutOpenNormal.psd";
  95. const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"CmpFoldoutOpenHover.psd";
  96. const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"CmpFoldoutOpenActive.psd";
  97. const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"CmpFoldoutClosedNormal.psd";
  98. const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"CmpFoldoutClosedHover.psd";
  99. const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"CmpFoldoutClosedActive.psd";
  100. const WString BuiltinEditorResources::WindowFrameNormal = L"WindowFrameNormal.psd";
  101. const WString BuiltinEditorResources::WindowFrameFocused = L"WindowFrameFocused.psd";
  102. const WString BuiltinEditorResources::WindowTitleBarBg = L"WindowTitleBarBg.psd";
  103. const WString BuiltinEditorResources::WindowCloseButtonNormal = L"WindowCloseBtnNormal.psd";
  104. const WString BuiltinEditorResources::WindowCloseButtonHover = L"WindowCloseBtnHover.psd";
  105. const WString BuiltinEditorResources::WindowMinButtonNormal = L"WindowMinBtnNormal.psd";
  106. const WString BuiltinEditorResources::WindowMinButtonHover = L"WindowMinBtnHover.psd";
  107. const WString BuiltinEditorResources::WindowMaxButtonNormal = L"WindowMaxBtnNormal.psd";
  108. const WString BuiltinEditorResources::WindowMaxButtonHover = L"WindowMaxBtnHover.psd";
  109. const WString BuiltinEditorResources::TabbedBarBtnNormal = L"TabbedButtonNormal.psd";
  110. const WString BuiltinEditorResources::TabbedBarBtnActive = L"TabbedButtonActive.psd";
  111. const WString BuiltinEditorResources::InputBoxNormalTex = L"InputBoxNormal.psd";
  112. const WString BuiltinEditorResources::InputBoxHoverTex = L"InputBoxHover.psd";
  113. const WString BuiltinEditorResources::InputBoxFocusedTex = L"InputBoxFocused.psd";
  114. const WString BuiltinEditorResources::ScrollBarUpNormalTex = L"ScrollBarUpNormal.psd";
  115. const WString BuiltinEditorResources::ScrollBarUpHoverTex = L"ScrollBarUpHover.psd";
  116. const WString BuiltinEditorResources::ScrollBarUpActiveTex = L"ScrollBarUpActive.psd";
  117. const WString BuiltinEditorResources::ScrollBarDownNormalTex = L"ScrollBarDownNormal.psd";
  118. const WString BuiltinEditorResources::ScrollBarDownHoverTex = L"ScrollBarDownHover.psd";
  119. const WString BuiltinEditorResources::ScrollBarDownActiveTex = L"ScrollBarDownActive.psd";
  120. const WString BuiltinEditorResources::ScrollBarLeftNormalTex = L"ScrollBarLeftNormal.psd";
  121. const WString BuiltinEditorResources::ScrollBarLeftHoverTex = L"ScrollBarLeftHover.psd";
  122. const WString BuiltinEditorResources::ScrollBarLeftActiveTex = L"ScrollBarLeftActive.psd";
  123. const WString BuiltinEditorResources::ScrollBarRightNormalTex = L"ScrollBarRightNormal.psd";
  124. const WString BuiltinEditorResources::ScrollBarRightHoverTex = L"ScrollBarRightHover.psd";
  125. const WString BuiltinEditorResources::ScrollBarRightActiveTex = L"ScrollBarRightActive.psd";
  126. const WString BuiltinEditorResources::ScrollBarHandleHorzNormalTex = L"ScrollBarHorzHandleNormal.psd";
  127. const WString BuiltinEditorResources::ScrollBarHandleHorzHoverTex = L"ScrollBarHorzHandleHover.psd";
  128. const WString BuiltinEditorResources::ScrollBarHandleHorzActiveTex = L"ScrollBarHorzHandleActive.psd";
  129. const WString BuiltinEditorResources::ScrollBarHandleVertNormalTex = L"ScrollBarVertHandleNormal.psd";
  130. const WString BuiltinEditorResources::ScrollBarHandleVertHoverTex = L"ScrollBarVertHandleHover.psd";
  131. const WString BuiltinEditorResources::ScrollBarHandleVertActiveTex = L"ScrollBarVertHandleActive.psd";
  132. const WString BuiltinEditorResources::DropDownBtnNormalTex = L"DropDownNormal.psd";
  133. const WString BuiltinEditorResources::DropDownBtnHoverTex = L"DropDownHover.psd";
  134. const WString BuiltinEditorResources::DropDownBoxBgTex = L"DropDownBoxBg.psd";
  135. const WString BuiltinEditorResources::DropDownBoxEntryNormalTex = L"DropDownButtonNormal.psd";
  136. const WString BuiltinEditorResources::DropDownBoxEntryHoverTex = L"DropDownButtonHover.psd";
  137. const WString BuiltinEditorResources::DropDownBoxBtnUpNormalTex = L"DropDownBoxBtnUpNormal.psd";
  138. const WString BuiltinEditorResources::DropDownBoxBtnUpHoverTex = L"DropDownBoxBtnUpHover.psd";
  139. const WString BuiltinEditorResources::DropDownBoxBtnDownNormalTex = L"DropDownBoxBtnDownNormal.psd";
  140. const WString BuiltinEditorResources::DropDownBoxBtnDownHoverTex = L"DropDownBoxBtnDownHover.psd";
  141. const WString BuiltinEditorResources::DropDownBoxEntryExpNormalTex = L"DropDownExpNormal.psd";
  142. const WString BuiltinEditorResources::DropDownBoxEntryExpHoverTex = L"DropDownExpHover.psd";
  143. const WString BuiltinEditorResources::DropDownSeparatorTex = L"DropDownSeparator.psd";
  144. const WString BuiltinEditorResources::DropDownBoxBtnUpArrowTex = L"DropDownBoxBtnUpArrow.psd";
  145. const WString BuiltinEditorResources::DropDownBoxBtnDownArrowTex = L"DropDownBoxBtnDownArrow.psd";
  146. const WString BuiltinEditorResources::ScrollBarBgTex = L"ScrollBarBg.psd";
  147. const WString BuiltinEditorResources::MenuBarBgTex = L"MenuBarBg.psd";
  148. const WString BuiltinEditorResources::MenuBarBtnNormalTex = L"MenuBarButtonNormal.psd";
  149. const WString BuiltinEditorResources::MenuBarBtnHoverTex = L"MenuBarButtonHover.psd";
  150. const WString BuiltinEditorResources::MenuBarBansheeLogoTex = L"MenuBarBansheeLogo.psd";
  151. const WString BuiltinEditorResources::DockSliderNormalTex = L"DockSliderBtn.psd";
  152. const WString BuiltinEditorResources::TreeViewExpandButtonOffNormal = L"TreeViewExpandButtonOffNormal.psd";
  153. const WString BuiltinEditorResources::TreeViewExpandButtonOffHover = L"TreeViewExpandButtonOffHover.psd";
  154. const WString BuiltinEditorResources::TreeViewExpandButtonOnNormal = L"TreeViewExpandButtonOnNormal.psd";
  155. const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
  156. const WString BuiltinEditorResources::TreeViewSelectionBackground = L"TreeViewSelectionBackground.psd";
  157. const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
  158. const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
  159. const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
  160. const WString BuiltinEditorResources::ColorPickerSliderHorzHandleTex = L"ColorPickerSliderHorzHandle.psd";
  161. const WString BuiltinEditorResources::ColorPickerSliderVertHandleTex = L"ColorPickerSliderVertHandle.psd";
  162. const WString BuiltinEditorResources::ColorPickerSlider2DHandleTex = L"ColorPicker2DHandle.psd";
  163. const WString BuiltinEditorResources::ProgressBarFillTex = L"ProgressBarFill.psd";
  164. const WString BuiltinEditorResources::ProgressBarBgTex = L"ProgressBarBg.psd";
  165. /************************************************************************/
  166. /* SHADERS */
  167. /************************************************************************/
  168. const WString BuiltinEditorResources::ShaderDockOverlayFile = L"DockDropOverlay.bsl";
  169. const WString BuiltinEditorResources::ShaderSceneGridFile = L"SceneGrid.bsl";
  170. const WString BuiltinEditorResources::ShaderPickingCullNoneFile = L"PickingCullNone.bsl";
  171. const WString BuiltinEditorResources::ShaderPickingCullCWFile = L"PickingCullCW.bsl";
  172. const WString BuiltinEditorResources::ShaderPickingCullCCWFile = L"PickingCullCCW.bsl";
  173. const WString BuiltinEditorResources::ShaderPickingAlphaCullNoneFile = L"PickingAlphaCullNone.bsl";
  174. const WString BuiltinEditorResources::ShaderPickingAlphaCullCWFile = L"PickingAlphaCullCW.bsl";
  175. const WString BuiltinEditorResources::ShaderPickingAlphaCullCCWFile = L"PickingAlphaCullCCW.bsl";
  176. const WString BuiltinEditorResources::ShaderWireGizmoFile = L"WireGizmo.bsl";
  177. const WString BuiltinEditorResources::ShaderSolidGizmoFile = L"SolidGizmo.bsl";
  178. const WString BuiltinEditorResources::ShaderWireHandleFile = L"WireHandle.bsl";
  179. const WString BuiltinEditorResources::ShaderSolidHandleFile = L"SolidHandle.bsl";
  180. const WString BuiltinEditorResources::ShaderIconGizmoFile = L"IconGizmo.bsl";
  181. const WString BuiltinEditorResources::ShaderGizmoPickingFile = L"GizmoPicking.bsl";
  182. const WString BuiltinEditorResources::ShaderGizmoPickingAlphaFile = L"GizmoPickingAlpha.bsl";
  183. const WString BuiltinEditorResources::ShaderSelectionFile = L"Selection.bsl";
  184. BuiltinEditorResources::BuiltinEditorResources()
  185. {
  186. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  187. absoluteDataPath.append(BuiltinDataFolder);
  188. #if BS_DEBUG_MODE
  189. if (BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder, BuiltinDataFolder + L"Timestamp.asset"))
  190. {
  191. mResourceManifest = ResourceManifest::create("BuiltinResources");
  192. gResources().registerResourceManifest(mResourceManifest);
  193. preprocess();
  194. BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
  195. Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
  196. absoluteDataPath.append(BuiltinDataFolder);
  197. ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
  198. }
  199. #endif
  200. if (mResourceManifest == nullptr)
  201. {
  202. if (FileSystem::exists(ResourceManifestPath))
  203. mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
  204. if (mResourceManifest == nullptr)
  205. mResourceManifest = ResourceManifest::create("BuiltinResources");
  206. gResources().registerResourceManifest(mResourceManifest);
  207. }
  208. mShaderDockOverlay = getShader(ShaderDockOverlayFile);
  209. mShaderSceneGrid = getShader(ShaderSceneGridFile);
  210. mShaderPicking[(int)CULL_NONE] = getShader(ShaderPickingCullNoneFile);
  211. mShaderPicking[(int)CULL_CLOCKWISE] = getShader(ShaderPickingCullCWFile);
  212. mShaderPicking[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingCullCCWFile);
  213. mShaderPickingAlpha[(int)CULL_NONE] = getShader(ShaderPickingAlphaCullNoneFile);
  214. mShaderPickingAlpha[(int)CULL_CLOCKWISE] = getShader(ShaderPickingAlphaCullCWFile);
  215. mShaderPickingAlpha[(int)CULL_COUNTERCLOCKWISE] = getShader(ShaderPickingAlphaCullCCWFile);
  216. mShaderGizmoSolid = getShader(ShaderSolidGizmoFile);
  217. mShaderGizmoWire = getShader(ShaderWireGizmoFile);
  218. mShaderGizmoIcon = getShader(ShaderIconGizmoFile);
  219. mShaderGizmoPicking = getShader(ShaderGizmoPickingFile);
  220. mShaderGizmoAlphaPicking = getShader(ShaderGizmoPickingAlphaFile);
  221. mShaderHandleSolid = getShader(ShaderSolidHandleFile);
  222. mShaderHandleWire = getShader(ShaderWireHandleFile);
  223. mShaderSelection = getShader(ShaderSelectionFile);
  224. mSkin = gResources().load<GUISkin>(BuiltinDataFolder + (GUISkinFile + L".asset"));
  225. }
  226. BuiltinEditorResources::~BuiltinEditorResources()
  227. { }
  228. void BuiltinEditorResources::preprocess()
  229. {
  230. FileSystem::remove(EditorShaderIncludeFolder);
  231. FileSystem::remove(EditorShaderFolder);
  232. FileSystem::remove(EditorSkinFolder);
  233. BuiltinResourcesHelper::importAssets(EditorRawShaderIncludeFolder, EditorShaderIncludeFolder, mResourceManifest); // Hidden dependency: Includes must be imported before shaders
  234. BuiltinResourcesHelper::importAssets(EditorRawShaderFolder, EditorShaderFolder, mResourceManifest);
  235. BuiltinResourcesHelper::importAssets(EditorRawSkinFolder, EditorSkinFolder, mResourceManifest);
  236. // Import font
  237. BuiltinResourcesHelper::importFont(BuiltinRawDataFolder + DefaultFontFilename, BuiltinDataFolder, DefaultFontSize, false, mResourceManifest);
  238. // Generate & save GUI sprite textures
  239. BuiltinResourcesHelper::generateSpriteTextures(EditorSkinFolder, mResourceManifest);
  240. // Generate & save GUI skin
  241. {
  242. HGUISkin skin = generateGUISkin();
  243. Path outputPath = FileSystem::getWorkingDirectoryPath() + BuiltinDataFolder + (GUISkinFile + L".asset");
  244. Resources::instance().save(skin, outputPath, true);
  245. mResourceManifest->registerResource(skin.getUUID(), outputPath);
  246. }
  247. Resources::instance().unloadAllUnused();
  248. }
  249. HGUISkin BuiltinEditorResources::generateGUISkin()
  250. {
  251. HGUISkin skin = GUISkin::create();
  252. Path fontPath = FileSystem::getWorkingDirectoryPath();
  253. fontPath.append(BuiltinDataFolder);
  254. fontPath.append(DefaultFontFilename + L".asset");
  255. HFont font = Resources::instance().load<Font>(fontPath);
  256. // Blank entry
  257. GUIElementStyle blankStyle;
  258. skin->setStyle("Blank", blankStyle);
  259. skin->setStyle(GUITexture::getGUITypeName(), blankStyle);
  260. // Label
  261. GUIElementStyle labelStyle;
  262. labelStyle.font = font;
  263. labelStyle.fontSize = DefaultFontSize;
  264. labelStyle.fixedWidth = false;
  265. labelStyle.fixedHeight = true;
  266. labelStyle.height = 11;
  267. labelStyle.minWidth = 10;
  268. skin->setStyle(GUILabel::getGUITypeName(), labelStyle);
  269. // Multi-line label
  270. GUIElementStyle multiLinelabelStyle;
  271. multiLinelabelStyle.font = font;
  272. multiLinelabelStyle.fontSize = DefaultFontSize;
  273. multiLinelabelStyle.fixedWidth = false;
  274. multiLinelabelStyle.fixedHeight = true;
  275. multiLinelabelStyle.height = 11;
  276. multiLinelabelStyle.minWidth = 10;
  277. multiLinelabelStyle.wordWrap = true;
  278. skin->setStyle("MultiLineLabel", multiLinelabelStyle);
  279. // Window frame
  280. GUIElementStyle windowFrameStyle;
  281. windowFrameStyle.normal.texture = getGUITexture(WindowFrameNormal);
  282. windowFrameStyle.focused.texture = getGUITexture(WindowFrameFocused);
  283. windowFrameStyle.border.left = 1;
  284. windowFrameStyle.border.right = 1;
  285. windowFrameStyle.border.top = 1;
  286. windowFrameStyle.border.bottom = 1;
  287. skin->setStyle("WindowFrame", windowFrameStyle);
  288. // Button
  289. GUIElementStyle buttonStyle;
  290. buttonStyle.normal.texture = getGUITexture(ButtonNormalTex);
  291. buttonStyle.hover.texture = getGUITexture(ButtonHoverTex);
  292. buttonStyle.active.texture = getGUITexture(ButtonActiveTex);
  293. buttonStyle.normalOn.texture = getGUITexture(ButtonActiveTex);
  294. buttonStyle.hoverOn.texture = getGUITexture(ButtonActiveTex);
  295. buttonStyle.activeOn.texture = getGUITexture(ButtonActiveTex);
  296. buttonStyle.border.left = 6;
  297. buttonStyle.border.right = 6;
  298. buttonStyle.border.top = 6;
  299. buttonStyle.border.bottom = 6;
  300. buttonStyle.contentOffset.left = 3;
  301. buttonStyle.contentOffset.right = 3;
  302. buttonStyle.fixedHeight = true;
  303. buttonStyle.height = 15;
  304. buttonStyle.minWidth = 50;
  305. buttonStyle.font = font;
  306. buttonStyle.fontSize = DefaultFontSize;
  307. buttonStyle.textHorzAlign = THA_Center;
  308. buttonStyle.textVertAlign = TVA_Center;
  309. skin->setStyle(GUIButton::getGUITypeName(), buttonStyle);
  310. // Toggle
  311. GUIElementStyle toggleStyle;
  312. toggleStyle.normal.texture = getGUITexture(ToggleNormalTex);
  313. toggleStyle.hover.texture = getGUITexture(ToggleHoverTex);
  314. toggleStyle.active.texture = getGUITexture(ToggleActiveTex);
  315. toggleStyle.normalOn.texture = getGUITexture(ToggleNormalOnTex);
  316. toggleStyle.hoverOn.texture = getGUITexture(ToggleHoverOnTex);
  317. toggleStyle.activeOn.texture = getGUITexture(ToggleActiveOnTex);
  318. toggleStyle.fixedHeight = true;
  319. toggleStyle.fixedWidth = true;
  320. toggleStyle.height = 15;
  321. toggleStyle.width = 15;
  322. skin->setStyle(GUIToggle::getGUITypeName(), toggleStyle);
  323. // Color
  324. GUIElementStyle colorStyle;
  325. colorStyle.margins.left = 2;
  326. colorStyle.margins.right = 2;
  327. colorStyle.margins.top = 2;
  328. colorStyle.margins.bottom = 2;
  329. colorStyle.fixedHeight = true;
  330. colorStyle.height = 10;
  331. colorStyle.minWidth = 10;
  332. skin->setStyle(GUIColor::getGUITypeName(), colorStyle);
  333. // Window background texture
  334. GUIElementStyle windowBgStyle;
  335. windowBgStyle.normal.texture = getGUITexture(WindowBackgroundTexture);
  336. skin->setStyle("WindowBackground", windowBgStyle);
  337. // Window title bar background
  338. GUIElementStyle titleBarBgStyle;
  339. titleBarBgStyle.normal.texture = getGUITexture(WindowTitleBarBg);
  340. titleBarBgStyle.fixedHeight = true;
  341. titleBarBgStyle.height = 13;
  342. skin->setStyle("TitleBarBackground", titleBarBgStyle);
  343. // Tabbed title bar tab button
  344. GUIElementStyle tabbedBarButton;
  345. tabbedBarButton.normal.texture = getGUITexture(TabbedBarBtnNormal);
  346. tabbedBarButton.hover.texture = getGUITexture(TabbedBarBtnActive);
  347. tabbedBarButton.active.texture = tabbedBarButton.hover.texture;
  348. tabbedBarButton.normalOn.texture = tabbedBarButton.hover.texture;
  349. tabbedBarButton.hoverOn.texture = tabbedBarButton.hover.texture;
  350. tabbedBarButton.activeOn.texture = tabbedBarButton.hover.texture;
  351. tabbedBarButton.fixedHeight = true;
  352. tabbedBarButton.height = 13;
  353. tabbedBarButton.minWidth = 10;
  354. tabbedBarButton.maxWidth = 110;
  355. tabbedBarButton.font = font;
  356. tabbedBarButton.fontSize = DefaultFontSize;
  357. tabbedBarButton.textHorzAlign = THA_Center;
  358. tabbedBarButton.textVertAlign = TVA_Center;
  359. skin->setStyle("TabbedBarBtn", tabbedBarButton);
  360. // Tabbed title bar drag/drop button
  361. GUIElementStyle tabbedBarDropButton;
  362. tabbedBarDropButton.fixedHeight = true;
  363. tabbedBarDropButton.fixedWidth = true;
  364. tabbedBarDropButton.height = 13;
  365. tabbedBarDropButton.width = 6;
  366. skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
  367. // Window minimize button
  368. GUIElementStyle winMinButtonStyle;
  369. winMinButtonStyle.normal.texture = getGUITexture(WindowMinButtonNormal);
  370. winMinButtonStyle.hover.texture = getGUITexture(WindowMinButtonHover);
  371. winMinButtonStyle.active.texture = winMinButtonStyle.hover.texture;
  372. winMinButtonStyle.fixedHeight = true;
  373. winMinButtonStyle.fixedWidth = true;
  374. winMinButtonStyle.height = 7;
  375. winMinButtonStyle.width = 8;
  376. skin->setStyle("WinMinimizeBtn", winMinButtonStyle);
  377. // Window maximize button
  378. GUIElementStyle winMaxButtonStyle;
  379. winMaxButtonStyle.normal.texture = getGUITexture(WindowMaxButtonNormal);
  380. winMaxButtonStyle.hover.texture = getGUITexture(WindowMaxButtonHover);
  381. winMaxButtonStyle.active.texture = winMaxButtonStyle.hover.texture;
  382. winMaxButtonStyle.fixedHeight = true;
  383. winMaxButtonStyle.fixedWidth = true;
  384. winMaxButtonStyle.height = 8;
  385. winMaxButtonStyle.width = 8;
  386. skin->setStyle("WinMaximizeBtn", winMaxButtonStyle);
  387. // Window close button
  388. GUIElementStyle winCloseButtonStyle;
  389. winCloseButtonStyle.normal.texture = getGUITexture(WindowCloseButtonNormal);
  390. winCloseButtonStyle.hover.texture = getGUITexture(WindowCloseButtonHover);
  391. winCloseButtonStyle.active.texture = winCloseButtonStyle.hover.texture;
  392. winCloseButtonStyle.fixedHeight = true;
  393. winCloseButtonStyle.fixedWidth = true;
  394. winCloseButtonStyle.height = 7;
  395. winCloseButtonStyle.width = 8;
  396. skin->setStyle("WinCloseBtn", winCloseButtonStyle);
  397. // Input box
  398. GUIElementStyle inputBoxStyle;
  399. inputBoxStyle.normal.texture = getGUITexture(InputBoxNormalTex);
  400. inputBoxStyle.hover.texture = getGUITexture(InputBoxHoverTex);
  401. inputBoxStyle.focused.texture = getGUITexture(InputBoxFocusedTex);
  402. inputBoxStyle.active.texture = inputBoxStyle.normal.texture;
  403. inputBoxStyle.border.left = 1;
  404. inputBoxStyle.border.right = 1;
  405. inputBoxStyle.border.top = 1;
  406. inputBoxStyle.border.bottom = 1;
  407. inputBoxStyle.contentOffset.left = 3;
  408. inputBoxStyle.contentOffset.right = 3;
  409. inputBoxStyle.contentOffset.top = 2;
  410. inputBoxStyle.contentOffset.bottom = 2;
  411. inputBoxStyle.fixedHeight = true;
  412. inputBoxStyle.height = 15;
  413. inputBoxStyle.minWidth = 10;
  414. inputBoxStyle.font = font;
  415. inputBoxStyle.fontSize = DefaultFontSize;
  416. inputBoxStyle.textHorzAlign = THA_Left;
  417. inputBoxStyle.textVertAlign = TVA_Top;
  418. skin->setStyle(GUIInputBox::getGUITypeName(), inputBoxStyle);
  419. /************************************************************************/
  420. /* SCROLL BAR */
  421. /************************************************************************/
  422. // Up button
  423. GUIElementStyle scrollUpBtnStyle;
  424. scrollUpBtnStyle.normal.texture = getGUITexture(ScrollBarUpNormalTex);
  425. scrollUpBtnStyle.hover.texture = getGUITexture(ScrollBarUpHoverTex);
  426. scrollUpBtnStyle.active.texture = getGUITexture(ScrollBarUpActiveTex);
  427. scrollUpBtnStyle.fixedHeight = true;
  428. scrollUpBtnStyle.fixedWidth = true;
  429. scrollUpBtnStyle.height = 4;
  430. scrollUpBtnStyle.width = 8;
  431. skin->setStyle("ScrollUpBtn", scrollUpBtnStyle);
  432. // Down button
  433. GUIElementStyle scrollDownBtnStyle;
  434. scrollDownBtnStyle.normal.texture = getGUITexture(ScrollBarDownNormalTex);
  435. scrollDownBtnStyle.hover.texture = getGUITexture(ScrollBarDownHoverTex);
  436. scrollDownBtnStyle.active.texture = getGUITexture(ScrollBarDownActiveTex);
  437. scrollDownBtnStyle.fixedHeight = true;
  438. scrollDownBtnStyle.fixedWidth = true;
  439. scrollDownBtnStyle.height = 4;
  440. scrollDownBtnStyle.width = 8;
  441. skin->setStyle("ScrollDownBtn", scrollDownBtnStyle);
  442. // Left button
  443. GUIElementStyle scrollLeftBtnStyle;
  444. scrollLeftBtnStyle.normal.texture = getGUITexture(ScrollBarLeftNormalTex);
  445. scrollLeftBtnStyle.hover.texture = getGUITexture(ScrollBarLeftHoverTex);
  446. scrollLeftBtnStyle.active.texture = getGUITexture(ScrollBarLeftActiveTex);
  447. scrollLeftBtnStyle.fixedHeight = true;
  448. scrollLeftBtnStyle.fixedWidth = true;
  449. scrollLeftBtnStyle.height = 8;
  450. scrollLeftBtnStyle.width = 4;
  451. skin->setStyle("ScrollLeftBtn", scrollLeftBtnStyle);
  452. // Right button
  453. GUIElementStyle scrollRightBtnStyle;
  454. scrollRightBtnStyle.normal.texture = getGUITexture(ScrollBarRightNormalTex);
  455. scrollRightBtnStyle.hover.texture = getGUITexture(ScrollBarRightHoverTex);
  456. scrollRightBtnStyle.active.texture = getGUITexture(ScrollBarRightActiveTex);
  457. scrollRightBtnStyle.fixedHeight = true;
  458. scrollRightBtnStyle.fixedWidth = true;
  459. scrollRightBtnStyle.height = 8;
  460. scrollRightBtnStyle.width = 4;
  461. skin->setStyle("ScrollRightBtn", scrollRightBtnStyle);
  462. // Horizontal handle
  463. GUIElementStyle scrollBarHorzBtnStyle;
  464. scrollBarHorzBtnStyle.normal.texture = getGUITexture(ScrollBarHandleHorzNormalTex);
  465. scrollBarHorzBtnStyle.hover.texture = getGUITexture(ScrollBarHandleHorzHoverTex);
  466. scrollBarHorzBtnStyle.active.texture = getGUITexture(ScrollBarHandleHorzActiveTex);
  467. scrollBarHorzBtnStyle.fixedHeight = true;
  468. scrollBarHorzBtnStyle.fixedWidth = true;
  469. scrollBarHorzBtnStyle.height = 6;
  470. scrollBarHorzBtnStyle.width = 4;
  471. skin->setStyle("ScrollBarHorzBtn", scrollBarHorzBtnStyle);
  472. // Vertical handle
  473. GUIElementStyle scrollBarVertBtnStyle;
  474. scrollBarVertBtnStyle.normal.texture = getGUITexture(ScrollBarHandleVertNormalTex);
  475. scrollBarVertBtnStyle.hover.texture = getGUITexture(ScrollBarHandleVertHoverTex);
  476. scrollBarVertBtnStyle.active.texture = getGUITexture(ScrollBarHandleVertActiveTex);
  477. scrollBarVertBtnStyle.fixedHeight = true;
  478. scrollBarVertBtnStyle.fixedWidth = true;
  479. scrollBarVertBtnStyle.height = 4;
  480. scrollBarVertBtnStyle.width = 6;
  481. skin->setStyle("ScrollBarVertBtn", scrollBarVertBtnStyle);
  482. HSpriteTexture scrollBarBgPtr = getGUITexture(ScrollBarBgTex);
  483. // Vertical scroll bar
  484. GUIElementStyle vertScrollBarStyle;
  485. vertScrollBarStyle.normal.texture = scrollBarBgPtr;
  486. vertScrollBarStyle.hover.texture = scrollBarBgPtr;
  487. vertScrollBarStyle.active.texture = scrollBarBgPtr;
  488. vertScrollBarStyle.fixedHeight = false;
  489. vertScrollBarStyle.fixedWidth = true;
  490. vertScrollBarStyle.minHeight = 16;
  491. vertScrollBarStyle.width = 8;
  492. skin->setStyle("ScrollBarVert", vertScrollBarStyle);
  493. // Horizontal scroll bar
  494. GUIElementStyle horzScrollBarStyle;
  495. horzScrollBarStyle.normal.texture = scrollBarBgPtr;
  496. horzScrollBarStyle.hover.texture = scrollBarBgPtr;
  497. horzScrollBarStyle.active.texture = scrollBarBgPtr;
  498. horzScrollBarStyle.fixedHeight = true;
  499. horzScrollBarStyle.fixedWidth = false;
  500. horzScrollBarStyle.minWidth = 16;
  501. horzScrollBarStyle.height = 8;
  502. skin->setStyle("ScrollBarHorz", horzScrollBarStyle);
  503. /************************************************************************/
  504. /* DROP DOWN BOX */
  505. /************************************************************************/
  506. // ListBox button
  507. GUIElementStyle dropDownListStyle;
  508. dropDownListStyle.normal.texture = getGUITexture(DropDownBtnNormalTex);
  509. dropDownListStyle.hover.texture = getGUITexture(DropDownBtnHoverTex);
  510. dropDownListStyle.active.texture = dropDownListStyle.hover.texture;
  511. dropDownListStyle.normalOn.texture = dropDownListStyle.hover.texture;
  512. dropDownListStyle.hoverOn.texture = dropDownListStyle.hover.texture;
  513. dropDownListStyle.activeOn.texture = dropDownListStyle.hover.texture;
  514. dropDownListStyle.fixedHeight = true;
  515. dropDownListStyle.fixedWidth = false;
  516. dropDownListStyle.height = 13;
  517. dropDownListStyle.width = 30;
  518. dropDownListStyle.contentOffset.left = 3;
  519. dropDownListStyle.contentOffset.right = 11;
  520. dropDownListStyle.contentOffset.top = 1;
  521. dropDownListStyle.contentOffset.bottom = 1;
  522. dropDownListStyle.border.left = 1;
  523. dropDownListStyle.border.right = 10;
  524. dropDownListStyle.border.top = 1;
  525. dropDownListStyle.border.bottom = 1;
  526. dropDownListStyle.font = font;
  527. dropDownListStyle.fontSize = DefaultFontSize;
  528. dropDownListStyle.textHorzAlign = THA_Left;
  529. dropDownListStyle.textVertAlign = TVA_Top;
  530. skin->setStyle("ListBox", dropDownListStyle);
  531. // DropDown scroll up button arrow
  532. HSpriteTexture dropDownBtnScrollUpArrow = getGUITexture(DropDownBoxBtnUpArrowTex);
  533. GUIElementStyle dropDownScrollUpBtnArrowStyle;
  534. dropDownScrollUpBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnUpArrowTex);
  535. dropDownScrollUpBtnArrowStyle.hover.texture = dropDownScrollUpBtnArrowStyle.normal.texture;
  536. dropDownScrollUpBtnArrowStyle.active.texture = dropDownScrollUpBtnArrowStyle.hover.texture;
  537. dropDownScrollUpBtnArrowStyle.fixedHeight = true;
  538. dropDownScrollUpBtnArrowStyle.fixedWidth = false;
  539. dropDownScrollUpBtnArrowStyle.height = 7;
  540. dropDownScrollUpBtnArrowStyle.width = 30;
  541. dropDownScrollUpBtnArrowStyle.border.left = 1;
  542. dropDownScrollUpBtnArrowStyle.border.right = 1;
  543. dropDownScrollUpBtnArrowStyle.border.top = 1;
  544. dropDownScrollUpBtnArrowStyle.border.bottom = 1;
  545. skin->setStyle("ListBoxScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  546. skin->setStyle("MenuBarScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  547. skin->setStyle("ContextMenuScrollUpBtnArrow", dropDownScrollUpBtnArrowStyle);
  548. // DropDown scroll up button
  549. GUIElementStyle dropDownScrollUpBtnStyle;
  550. dropDownScrollUpBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnUpNormalTex);
  551. dropDownScrollUpBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnUpHoverTex);
  552. dropDownScrollUpBtnStyle.active.texture = dropDownScrollUpBtnStyle.hover.texture;
  553. dropDownScrollUpBtnStyle.fixedHeight = true;
  554. dropDownScrollUpBtnStyle.fixedWidth = false;
  555. dropDownScrollUpBtnStyle.height = 7;
  556. dropDownScrollUpBtnStyle.width = 30;
  557. dropDownScrollUpBtnStyle.border.left = 1;
  558. dropDownScrollUpBtnStyle.border.right = 1;
  559. dropDownScrollUpBtnStyle.border.top = 1;
  560. dropDownScrollUpBtnStyle.border.bottom = 1;
  561. skin->setStyle("ListBoxScrollUpBtn", dropDownScrollUpBtnStyle);
  562. skin->setStyle("MenuBarScrollUpBtn", dropDownScrollUpBtnStyle);
  563. skin->setStyle("ContextMenuScrollUpBtn", dropDownScrollUpBtnStyle);
  564. // DropDown scroll down button arrow
  565. GUIElementStyle dropDownScrollDownBtnArrowStyle;
  566. dropDownScrollDownBtnArrowStyle.normal.texture = getGUITexture(DropDownBoxBtnDownArrowTex);
  567. dropDownScrollDownBtnArrowStyle.hover.texture = dropDownScrollDownBtnArrowStyle.normal.texture;
  568. dropDownScrollDownBtnArrowStyle.active.texture = dropDownScrollDownBtnArrowStyle.hover.texture;
  569. dropDownScrollDownBtnArrowStyle.fixedHeight = true;
  570. dropDownScrollDownBtnArrowStyle.fixedWidth = false;
  571. dropDownScrollDownBtnArrowStyle.height = 7;
  572. dropDownScrollDownBtnArrowStyle.width = 30;
  573. dropDownScrollDownBtnArrowStyle.border.left = 1;
  574. dropDownScrollDownBtnArrowStyle.border.right = 1;
  575. dropDownScrollDownBtnArrowStyle.border.top = 1;
  576. dropDownScrollDownBtnArrowStyle.border.bottom = 1;
  577. skin->setStyle("ListBoxScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  578. skin->setStyle("MenuBarScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  579. skin->setStyle("ContextMenuScrollDownBtnArrow", dropDownScrollDownBtnArrowStyle);
  580. // DropDown scroll down button
  581. GUIElementStyle dropDownScrollDownBtnStyle;
  582. dropDownScrollDownBtnStyle.normal.texture = getGUITexture(DropDownBoxBtnDownNormalTex);
  583. dropDownScrollDownBtnStyle.hover.texture = getGUITexture(DropDownBoxBtnDownHoverTex);
  584. dropDownScrollDownBtnStyle.active.texture = dropDownScrollDownBtnStyle.hover.texture;
  585. dropDownScrollDownBtnStyle.fixedHeight = true;
  586. dropDownScrollDownBtnStyle.fixedWidth = false;
  587. dropDownScrollDownBtnStyle.height = 7;
  588. dropDownScrollDownBtnStyle.width = 30;
  589. dropDownScrollDownBtnStyle.border.left = 1;
  590. dropDownScrollDownBtnStyle.border.right = 1;
  591. dropDownScrollDownBtnStyle.border.top = 1;
  592. dropDownScrollDownBtnStyle.border.bottom = 1;
  593. skin->setStyle("ListBoxScrollDownBtn", dropDownScrollDownBtnStyle);
  594. skin->setStyle("MenuBarScrollDownBtn", dropDownScrollDownBtnStyle);
  595. skin->setStyle("ContextMenuScrollDownBtn", dropDownScrollDownBtnStyle);
  596. // DropDown entry button
  597. GUIElementStyle dropDownEntryBtnStyle;
  598. dropDownEntryBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryNormalTex);
  599. dropDownEntryBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryHoverTex);
  600. dropDownEntryBtnStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  601. dropDownEntryBtnStyle.normalOn.texture = dropDownEntryBtnStyle.hover.texture;
  602. dropDownEntryBtnStyle.hoverOn.texture = dropDownEntryBtnStyle.hover.texture;
  603. dropDownEntryBtnStyle.activeOn.texture = dropDownEntryBtnStyle.hover.texture;
  604. dropDownEntryBtnStyle.fixedHeight = true;
  605. dropDownEntryBtnStyle.fixedWidth = false;
  606. dropDownEntryBtnStyle.height = 14;
  607. dropDownEntryBtnStyle.width = 30;
  608. dropDownEntryBtnStyle.border.left = 1;
  609. dropDownEntryBtnStyle.border.right = 1;
  610. dropDownEntryBtnStyle.border.top = 1;
  611. dropDownEntryBtnStyle.border.bottom = 1;
  612. dropDownEntryBtnStyle.font = font;
  613. dropDownEntryBtnStyle.fontSize = DefaultFontSize;
  614. dropDownEntryBtnStyle.textHorzAlign = THA_Left;
  615. dropDownEntryBtnStyle.textVertAlign = TVA_Top;
  616. skin->setStyle(GUIDropDownContent::ENTRY_STYLE_TYPE, dropDownEntryBtnStyle);
  617. // DropDown entry button with expand
  618. GUIElementStyle dropDownEntryExpBtnStyle;
  619. dropDownEntryExpBtnStyle.normal.texture = getGUITexture(DropDownBoxEntryExpNormalTex);
  620. dropDownEntryExpBtnStyle.hover.texture = getGUITexture(DropDownBoxEntryExpHoverTex);
  621. dropDownEntryExpBtnStyle.active.texture = dropDownEntryExpBtnStyle.hover.texture;
  622. dropDownEntryExpBtnStyle.normalOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  623. dropDownEntryExpBtnStyle.hoverOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  624. dropDownEntryExpBtnStyle.activeOn.texture = dropDownEntryExpBtnStyle.hover.texture;
  625. dropDownEntryExpBtnStyle.fixedHeight = true;
  626. dropDownEntryExpBtnStyle.fixedWidth = false;
  627. dropDownEntryExpBtnStyle.height = 14;
  628. dropDownEntryExpBtnStyle.width = 30;
  629. dropDownEntryExpBtnStyle.border.left = 1;
  630. dropDownEntryExpBtnStyle.border.right = 6;
  631. dropDownEntryExpBtnStyle.border.top = 1;
  632. dropDownEntryExpBtnStyle.border.bottom = 1;
  633. dropDownEntryExpBtnStyle.font = font;
  634. dropDownEntryExpBtnStyle.fontSize = DefaultFontSize;
  635. dropDownEntryExpBtnStyle.textHorzAlign = THA_Left;
  636. dropDownEntryExpBtnStyle.textVertAlign = TVA_Top;
  637. skin->setStyle(GUIDropDownContent::ENTRY_EXP_STYLE_TYPE, dropDownEntryExpBtnStyle);
  638. // Drop down separator
  639. GUIElementStyle dropDownSeparatorStyle;
  640. dropDownSeparatorStyle.normal.texture = getGUITexture(DropDownSeparatorTex);
  641. dropDownSeparatorStyle.fixedHeight = true;
  642. dropDownSeparatorStyle.fixedWidth = false;
  643. dropDownSeparatorStyle.height = 3;
  644. dropDownSeparatorStyle.width = 30;
  645. dropDownSeparatorStyle.border.left = 1;
  646. dropDownSeparatorStyle.border.right = 1;
  647. dropDownSeparatorStyle.border.top = 1;
  648. dropDownSeparatorStyle.border.bottom = 1;
  649. skin->setStyle(GUIDropDownContent::SEPARATOR_STYLE_TYPE, dropDownSeparatorStyle);
  650. // Drop down content
  651. GUIElementStyle dropDownContentStyle;
  652. dropDownContentStyle.minWidth = 50;
  653. dropDownContentStyle.minHeight = 20;
  654. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_STYLE_TYPE] = GUIDropDownContent::ENTRY_STYLE_TYPE;
  655. dropDownContentStyle.subStyles[GUIDropDownContent::ENTRY_EXP_STYLE_TYPE] = GUIDropDownContent::ENTRY_EXP_STYLE_TYPE;
  656. dropDownContentStyle.subStyles[GUIDropDownContent::SEPARATOR_STYLE_TYPE] = GUIDropDownContent::SEPARATOR_STYLE_TYPE;
  657. skin->setStyle("ListBoxContent", dropDownContentStyle);
  658. skin->setStyle("MenuBarContent", dropDownContentStyle);
  659. skin->setStyle("ContextMenuContent", dropDownContentStyle);
  660. // DropDown box frame
  661. GUIElementStyle dropDownBoxStyle;
  662. dropDownBoxStyle.normal.texture = getGUITexture(DropDownBoxBgTex);
  663. dropDownBoxStyle.hover.texture = dropDownEntryBtnStyle.normal.texture;
  664. dropDownBoxStyle.active.texture = dropDownEntryBtnStyle.hover.texture;
  665. dropDownBoxStyle.fixedHeight = false;
  666. dropDownBoxStyle.fixedWidth = false;
  667. dropDownBoxStyle.border.left = 1;
  668. dropDownBoxStyle.border.right = 1;
  669. dropDownBoxStyle.border.top = 1;
  670. dropDownBoxStyle.border.bottom = 1;
  671. dropDownBoxStyle.margins.left = 1;
  672. dropDownBoxStyle.margins.right = 1;
  673. dropDownBoxStyle.margins.top = 1;
  674. dropDownBoxStyle.margins.bottom = 1;
  675. skin->setStyle("ListBoxFrame", dropDownBoxStyle);
  676. skin->setStyle("MenuBarFrame", dropDownBoxStyle);
  677. skin->setStyle("ContextMenuFrame", dropDownBoxStyle);
  678. /************************************************************************/
  679. /* MENU BAR */
  680. /************************************************************************/
  681. // MenuBar background
  682. GUIElementStyle menuBarBgStyle;
  683. menuBarBgStyle.normal.texture = getGUITexture(MenuBarBgTex);
  684. menuBarBgStyle.fixedHeight = false;
  685. menuBarBgStyle.fixedWidth = false;
  686. menuBarBgStyle.height = 4;
  687. menuBarBgStyle.width = 4;
  688. skin->setStyle("MenuBarBg", menuBarBgStyle);
  689. // MenuBar Banshee logo
  690. GUIElementStyle menuBarBansheeLogoStyle;
  691. menuBarBansheeLogoStyle.normal.texture = getGUITexture(MenuBarBansheeLogoTex);
  692. menuBarBansheeLogoStyle.fixedHeight = true;
  693. menuBarBansheeLogoStyle.fixedWidth = true;
  694. menuBarBansheeLogoStyle.height = 7;
  695. menuBarBansheeLogoStyle.width = 51;
  696. skin->setStyle("MenuBarBansheeLogo", menuBarBansheeLogoStyle);
  697. // MenuBar button
  698. GUIElementStyle menuBarBtnStyle;
  699. menuBarBtnStyle.normal.texture = getGUITexture(MenuBarBtnNormalTex);
  700. menuBarBtnStyle.hover.texture = getGUITexture(MenuBarBtnHoverTex);
  701. menuBarBtnStyle.active.texture = menuBarBtnStyle.hover.texture;
  702. menuBarBtnStyle.normalOn.texture = menuBarBtnStyle.hover.texture;
  703. menuBarBtnStyle.hoverOn.texture = menuBarBtnStyle.hover.texture;
  704. menuBarBtnStyle.activeOn.texture = menuBarBtnStyle.hover.texture;
  705. menuBarBtnStyle.fixedHeight = true;
  706. menuBarBtnStyle.fixedWidth = false;
  707. menuBarBtnStyle.height = 15;
  708. menuBarBtnStyle.width = 4;
  709. menuBarBtnStyle.margins.left = 2;
  710. menuBarBtnStyle.margins.right = 2;
  711. menuBarBtnStyle.margins.top = 2;
  712. menuBarBtnStyle.margins.bottom = 2;
  713. menuBarBtnStyle.font = font;
  714. menuBarBtnStyle.fontSize = DefaultFontSize;
  715. menuBarBtnStyle.textHorzAlign = THA_Left;
  716. menuBarBtnStyle.textVertAlign = TVA_Top;
  717. skin->setStyle("MenuBarBtn", menuBarBtnStyle);
  718. /************************************************************************/
  719. /* DOCK SLIDER */
  720. /************************************************************************/
  721. GUIElementStyle dockSliderBtnStyle;
  722. dockSliderBtnStyle.normal.texture = getGUITexture(DockSliderNormalTex);
  723. dockSliderBtnStyle.fixedHeight = false;
  724. dockSliderBtnStyle.fixedWidth = false;
  725. dockSliderBtnStyle.height = 2;
  726. dockSliderBtnStyle.width = 2;
  727. skin->setStyle("DockSliderBtn", dockSliderBtnStyle);
  728. /************************************************************************/
  729. /* TREE VIEW */
  730. /************************************************************************/
  731. // Expand button
  732. GUIElementStyle treeViewExpandButtonStyle;
  733. treeViewExpandButtonStyle.normal.texture = getGUITexture(TreeViewExpandButtonOffNormal);
  734. treeViewExpandButtonStyle.hover.texture = getGUITexture(TreeViewExpandButtonOffHover);
  735. treeViewExpandButtonStyle.active.texture = treeViewExpandButtonStyle.hover.texture;
  736. treeViewExpandButtonStyle.normalOn.texture = getGUITexture(TreeViewExpandButtonOnNormal);
  737. treeViewExpandButtonStyle.hoverOn.texture = getGUITexture(TreeViewExpandButtonOnHover);
  738. treeViewExpandButtonStyle.activeOn.texture = treeViewExpandButtonStyle.hoverOn.texture;
  739. treeViewExpandButtonStyle.margins.left = 4;
  740. treeViewExpandButtonStyle.margins.right = 4;
  741. treeViewExpandButtonStyle.margins.top = 5;
  742. treeViewExpandButtonStyle.margins.bottom = 4;
  743. treeViewExpandButtonStyle.fixedHeight = true;
  744. treeViewExpandButtonStyle.fixedWidth = true;
  745. treeViewExpandButtonStyle.height = 16;
  746. treeViewExpandButtonStyle.width = 16;
  747. skin->setStyle("TreeViewFoldoutBtn", treeViewExpandButtonStyle);
  748. // Entry
  749. GUIElementStyle treeViewEntryStyle;
  750. treeViewEntryStyle.font = font;
  751. treeViewEntryStyle.fontSize = DefaultFontSize;
  752. treeViewEntryStyle.fixedWidth = false;
  753. treeViewEntryStyle.fixedHeight = true;
  754. treeViewEntryStyle.height = 16;
  755. treeViewEntryStyle.minWidth = 10;
  756. skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
  757. // Selection background
  758. GUIElementStyle treeViewSelBackgroundStyle;
  759. treeViewSelBackgroundStyle.normal.texture = getGUITexture(TreeViewSelectionBackground);
  760. treeViewSelBackgroundStyle.fixedHeight = false;
  761. treeViewSelBackgroundStyle.fixedWidth = false;
  762. treeViewSelBackgroundStyle.height = 2;
  763. treeViewSelBackgroundStyle.width = 2;
  764. skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
  765. // Edit box
  766. GUIElementStyle treeViewEditBox;
  767. treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
  768. treeViewEditBox.hover.texture = treeViewEditBox.normal.texture;
  769. treeViewEditBox.focused.texture = treeViewEditBox.normal.texture;
  770. treeViewEditBox.active.texture = treeViewEditBox.normal.texture;
  771. treeViewEditBox.border.left = 1;
  772. treeViewEditBox.border.right = 1;
  773. treeViewEditBox.border.top = 1;
  774. treeViewEditBox.border.bottom = 1;
  775. treeViewEditBox.margins.left = 1;
  776. treeViewEditBox.margins.right = 1;
  777. treeViewEditBox.margins.top = 1;
  778. treeViewEditBox.margins.bottom = 1;
  779. treeViewEditBox.fixedHeight = true;
  780. treeViewEditBox.height = 13;
  781. treeViewEditBox.minWidth = 10;
  782. treeViewEditBox.font = font;
  783. treeViewEditBox.fontSize = DefaultFontSize;
  784. treeViewEditBox.textHorzAlign = THA_Left;
  785. treeViewEditBox.textVertAlign = TVA_Top;
  786. skin->setStyle(GUITreeViewEditBox::getGUITypeName(), treeViewEditBox);
  787. // Element highlight
  788. GUIElementStyle treeViewElementHighlight;
  789. treeViewElementHighlight.normal.texture = getGUITexture(TreeViewElementHighlight);
  790. treeViewElementHighlight.border.left = 1;
  791. treeViewElementHighlight.border.right = 1;
  792. treeViewElementHighlight.border.top = 1;
  793. treeViewElementHighlight.border.bottom = 1;
  794. skin->setStyle("TreeViewElementHighlight", treeViewElementHighlight);
  795. // Element separator highlight
  796. GUIElementStyle treeViewElementSepHighlight;
  797. treeViewElementSepHighlight.normal.texture = getGUITexture(TreeViewElementSepHighlight);
  798. treeViewElementSepHighlight.border.left = 1;
  799. treeViewElementSepHighlight.border.right = 1;
  800. treeViewElementSepHighlight.border.top = 1;
  801. treeViewElementSepHighlight.border.bottom = 1;
  802. skin->setStyle("TreeViewElementSepHighlight", treeViewElementSepHighlight);
  803. /************************************************************************/
  804. /* OBJECT DROP FIELD */
  805. /************************************************************************/
  806. GUIElementStyle objectDropStyle;
  807. objectDropStyle.normal.texture = getGUITexture(ObjectDropBtnNormalTex);
  808. objectDropStyle.normalOn.texture = getGUITexture(ObjectDropBtnNormalOnTex);
  809. objectDropStyle.fixedHeight = true;
  810. objectDropStyle.height = 15;
  811. objectDropStyle.minWidth = 50;
  812. objectDropStyle.font = font;
  813. objectDropStyle.fontSize = DefaultFontSize;
  814. objectDropStyle.textHorzAlign = THA_Center;
  815. objectDropStyle.textVertAlign = TVA_Center;
  816. skin->setStyle(ObjectFieldDropBtnStyleName, objectDropStyle);
  817. GUIElementStyle objectClearBtnStyle;
  818. objectClearBtnStyle.normal.texture = getGUITexture(ObjectClearBtnNormalTex);
  819. objectClearBtnStyle.hover.texture = getGUITexture(ObjectClearBtnHoverTex);
  820. objectClearBtnStyle.active.texture = getGUITexture(ObjectClearBtnActiveTex);
  821. objectClearBtnStyle.fixedHeight = true;
  822. objectClearBtnStyle.fixedWidth = true;
  823. objectClearBtnStyle.height = 15;
  824. objectClearBtnStyle.width = 13;
  825. skin->setStyle(ObjectFieldClearBtnStyleName, objectClearBtnStyle);
  826. GUIElementStyle editorObjectFieldStyle;
  827. editorObjectFieldStyle.fixedHeight = true;
  828. editorObjectFieldStyle.height = 15;
  829. editorObjectFieldStyle.minWidth = 30;
  830. editorObjectFieldStyle.subStyles[ObjectFieldLabelStyleName] = GUITextField::getLabelStyleType();
  831. editorObjectFieldStyle.subStyles[ObjectFieldDropBtnStyleName] = ObjectFieldDropBtnStyleName;
  832. editorObjectFieldStyle.subStyles[ObjectFieldClearBtnStyleName] = ObjectFieldClearBtnStyleName;
  833. skin->setStyle(ObjectFieldStyleName, editorObjectFieldStyle);
  834. /************************************************************************/
  835. /* EDITOR FIELDS */
  836. /************************************************************************/
  837. GUIElementStyle editorFieldLabelStyle;
  838. editorFieldLabelStyle.font = font;
  839. editorFieldLabelStyle.fontSize = DefaultFontSize;
  840. editorFieldLabelStyle.fixedWidth = false;
  841. editorFieldLabelStyle.fixedHeight = true;
  842. editorFieldLabelStyle.height = 11;
  843. editorFieldLabelStyle.minWidth = 10;
  844. editorFieldLabelStyle.textHorzAlign = THA_Left;
  845. skin->setStyle(GUITextField::getLabelStyleType(), editorFieldLabelStyle);
  846. GUIElementStyle editorIntFieldStyle;
  847. editorIntFieldStyle.fixedHeight = true;
  848. editorIntFieldStyle.height = 15;
  849. editorIntFieldStyle.minWidth = 30;
  850. editorIntFieldStyle.subStyles[GUIIntField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  851. editorIntFieldStyle.subStyles[GUIIntField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  852. skin->setStyle(GUIIntField::getGUITypeName(), editorIntFieldStyle);
  853. GUIElementStyle editorFloatFieldStyle;
  854. editorFloatFieldStyle.fixedHeight = true;
  855. editorFloatFieldStyle.height = 15;
  856. editorFloatFieldStyle.minWidth = 30;
  857. editorFloatFieldStyle.subStyles[GUIFloatField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  858. editorFloatFieldStyle.subStyles[GUIFloatField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  859. skin->setStyle(GUIFloatField::getGUITypeName(), editorFloatFieldStyle);
  860. GUIElementStyle editorTextFieldStyle;
  861. editorTextFieldStyle.fixedHeight = true;
  862. editorTextFieldStyle.height = 15;
  863. editorTextFieldStyle.minWidth = 30;
  864. editorTextFieldStyle.subStyles[GUITextField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  865. editorTextFieldStyle.subStyles[GUITextField::getInputStyleType()] = GUIInputBox::getGUITypeName();
  866. skin->setStyle(GUITextField::getGUITypeName(), editorTextFieldStyle);
  867. GUIElementStyle editorColorFieldStyle;
  868. editorColorFieldStyle.fixedHeight = true;
  869. editorColorFieldStyle.height = 15;
  870. editorColorFieldStyle.minWidth = 30;
  871. editorColorFieldStyle.subStyles[GUIColorField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  872. editorColorFieldStyle.subStyles[GUIColorField::getColorInputStyleType()] = GUIColor::getGUITypeName();
  873. skin->setStyle(GUIColorField::getGUITypeName(), editorColorFieldStyle);
  874. GUIElementStyle editorToggleFieldStyle;
  875. editorToggleFieldStyle.fixedHeight = true;
  876. editorToggleFieldStyle.height = 15;
  877. editorToggleFieldStyle.minWidth = 30;
  878. editorToggleFieldStyle.subStyles[GUIToggleField::getLabelStyleType()] = GUITextField::getLabelStyleType();
  879. editorToggleFieldStyle.subStyles[GUIToggleField::getToggleStyleType()] = GUIToggle::getGUITypeName();
  880. skin->setStyle(GUIToggleField::getGUITypeName(), editorToggleFieldStyle);
  881. GUIElementStyle editorVector2FieldStyle;
  882. editorVector2FieldStyle.fixedHeight = true;
  883. editorVector2FieldStyle.height = 30;
  884. editorVector2FieldStyle.minWidth = 30;
  885. editorVector2FieldStyle.subStyles[GUIVector2Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  886. editorVector2FieldStyle.subStyles[GUIVector2Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  887. skin->setStyle(GUIVector2Field::getGUITypeName(), editorVector2FieldStyle);
  888. GUIElementStyle editorVector3FieldStyle;
  889. editorVector3FieldStyle.fixedHeight = true;
  890. editorVector3FieldStyle.height = 30;
  891. editorVector3FieldStyle.minWidth = 30;
  892. editorVector3FieldStyle.subStyles[GUIVector3Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  893. editorVector3FieldStyle.subStyles[GUIVector3Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  894. skin->setStyle(GUIVector3Field::getGUITypeName(), editorVector3FieldStyle);
  895. GUIElementStyle editorVector4FieldStyle;
  896. editorVector4FieldStyle.fixedHeight = true;
  897. editorVector4FieldStyle.height = 30;
  898. editorVector4FieldStyle.minWidth = 30;
  899. editorVector4FieldStyle.subStyles[GUIVector4Field::getLabelStyleType()] = GUITextField::getLabelStyleType();
  900. editorVector4FieldStyle.subStyles[GUIVector4Field::getFloatFieldStyleType()] = GUIFloatField::getGUITypeName();
  901. skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
  902. /************************************************************************/
  903. /* COMPONENT FOLDOUT */
  904. /************************************************************************/
  905. GUIElementStyle cmpFoldoutBtnStyle;
  906. cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
  907. cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
  908. cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  909. cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
  910. cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
  911. cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
  912. cmpFoldoutBtnStyle.fixedHeight = true;
  913. cmpFoldoutBtnStyle.fixedWidth = false;
  914. cmpFoldoutBtnStyle.height = 10;
  915. cmpFoldoutBtnStyle.minWidth = 10;
  916. cmpFoldoutBtnStyle.font = font;
  917. cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
  918. cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
  919. cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
  920. cmpFoldoutBtnStyle.contentOffset = RectOffset(12, 0, 0, 0);
  921. cmpFoldoutBtnStyle.border.left = 8;
  922. skin->setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
  923. GUIElementStyle cmpFoldoutStyle;
  924. cmpFoldoutStyle.fixedHeight = true;
  925. cmpFoldoutStyle.height = 12;
  926. cmpFoldoutStyle.minWidth = 30;
  927. cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
  928. skin->setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
  929. /************************************************************************/
  930. /* FOLDOUT */
  931. /************************************************************************/
  932. GUIElementStyle foldoutBtnStyle;
  933. foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
  934. foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
  935. foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
  936. foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
  937. foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
  938. foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
  939. foldoutBtnStyle.fixedHeight = true;
  940. foldoutBtnStyle.fixedWidth = true;
  941. foldoutBtnStyle.height = 10;
  942. foldoutBtnStyle.width = 8;
  943. skin->setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
  944. GUIElementStyle foldoutStyle;
  945. foldoutStyle.fixedHeight = true;
  946. foldoutStyle.height = 12;
  947. foldoutStyle.minWidth = 30;
  948. foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
  949. foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
  950. skin->setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
  951. /************************************************************************/
  952. /* PROGRESS BAR */
  953. /************************************************************************/
  954. GUIElementStyle progressBarBgStyle;
  955. progressBarBgStyle.fixedHeight = true;
  956. progressBarBgStyle.height = 18;
  957. progressBarBgStyle.normal.texture = getGUITexture(ProgressBarBgTex);
  958. skin->setStyle(GUIProgressBar::getBackgroundStyleType(), progressBarBgStyle);
  959. GUIElementStyle progressBarFillStyle;
  960. progressBarFillStyle.fixedHeight = true;
  961. progressBarFillStyle.height = 12;
  962. progressBarFillStyle.normal.texture = getGUITexture(ProgressBarFillTex);
  963. skin->setStyle(GUIProgressBar::getBarStyleType(), progressBarFillStyle);
  964. GUIElementStyle progressBarStyle;
  965. progressBarStyle.fixedHeight = true;
  966. progressBarStyle.height = 18;
  967. progressBarStyle.minWidth = 100;
  968. progressBarStyle.margins.top = 3;
  969. progressBarStyle.margins.bottom = 3;
  970. progressBarStyle.subStyles[GUIProgressBar::getBarStyleType()] = GUIProgressBar::getBarStyleType();
  971. progressBarStyle.subStyles[GUIProgressBar::getBackgroundStyleType()] = GUIProgressBar::getBackgroundStyleType();
  972. skin->setStyle(GUIProgressBar::getGUITypeName(), progressBarStyle);
  973. /************************************************************************/
  974. /* COLOR PICKER SLIDER */
  975. /************************************************************************/
  976. GUIElementStyle colorPickerSliderHorzHandleStyle;
  977. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  978. colorPickerSliderHorzHandleStyle.fixedWidth = true;
  979. colorPickerSliderHorzHandleStyle.height = 20;
  980. colorPickerSliderHorzHandleStyle.width = 7;
  981. colorPickerSliderHorzHandleStyle.normal.texture = getGUITexture(ColorPickerSliderHorzHandleTex);
  982. colorPickerSliderHorzHandleStyle.hover.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  983. colorPickerSliderHorzHandleStyle.active.texture = colorPickerSliderHorzHandleStyle.normal.texture;
  984. skin->setStyle("ColorSliderHorzHandle", colorPickerSliderHorzHandleStyle);
  985. GUIElementStyle colorPickerSliderHorzStyle;
  986. colorPickerSliderHorzHandleStyle.fixedHeight = true;
  987. colorPickerSliderHorzHandleStyle.height = 32;
  988. colorPickerSliderHorzHandleStyle.minWidth = 20;
  989. colorPickerSliderHorzStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderHorzHandle";
  990. skin->setStyle("ColorSliderHorz", colorPickerSliderHorzStyle);
  991. GUIElementStyle colorPickerSliderVertHandleStyle;
  992. colorPickerSliderVertHandleStyle.fixedHeight = true;
  993. colorPickerSliderVertHandleStyle.fixedWidth = true;
  994. colorPickerSliderVertHandleStyle.height = 7;
  995. colorPickerSliderVertHandleStyle.width = 45;
  996. colorPickerSliderVertHandleStyle.normal.texture = getGUITexture(ColorPickerSliderVertHandleTex);
  997. colorPickerSliderVertHandleStyle.hover.texture = colorPickerSliderVertHandleStyle.normal.texture;
  998. colorPickerSliderVertHandleStyle.active.texture = colorPickerSliderVertHandleStyle.normal.texture;
  999. skin->setStyle("ColorSliderVertHandle", colorPickerSliderVertHandleStyle);
  1000. GUIElementStyle colorPickerSliderVertStyle;
  1001. colorPickerSliderVertStyle.fixedWidth = true;
  1002. colorPickerSliderVertStyle.width = 30;
  1003. colorPickerSliderVertStyle.minHeight = 20;
  1004. colorPickerSliderVertStyle.subStyles[GUISlider::getHandleStyleType()] = "ColorSliderVertHandle";
  1005. skin->setStyle("ColorSliderVert", colorPickerSliderVertStyle);
  1006. GUIElementStyle colorPickerSlider2DHandleStyle;
  1007. colorPickerSlider2DHandleStyle.fixedHeight = true;
  1008. colorPickerSlider2DHandleStyle.fixedWidth = true;
  1009. colorPickerSlider2DHandleStyle.height = 8;
  1010. colorPickerSlider2DHandleStyle.width = 8;
  1011. colorPickerSlider2DHandleStyle.normal.texture = getGUITexture(ColorPickerSlider2DHandleTex);
  1012. colorPickerSlider2DHandleStyle.hover.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1013. colorPickerSlider2DHandleStyle.active.texture = colorPickerSlider2DHandleStyle.normal.texture;
  1014. skin->setStyle("ColorSlider2DHandle", colorPickerSlider2DHandleStyle);
  1015. /************************************************************************/
  1016. /* OTHER */
  1017. /************************************************************************/
  1018. // Right-aligned label
  1019. GUIElementStyle rightAlignedLabelStyle;
  1020. rightAlignedLabelStyle.font = font;
  1021. rightAlignedLabelStyle.fontSize = DefaultFontSize;
  1022. rightAlignedLabelStyle.fixedWidth = false;
  1023. rightAlignedLabelStyle.fixedHeight = true;
  1024. rightAlignedLabelStyle.height = 11;
  1025. rightAlignedLabelStyle.minWidth = 10;
  1026. rightAlignedLabelStyle.textHorzAlign = THA_Right;
  1027. skin->setStyle("RightAlignedLabel", rightAlignedLabelStyle);
  1028. return skin;
  1029. }
  1030. HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name)
  1031. {
  1032. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1033. texturePath.append(EditorSkinFolder);
  1034. texturePath.append(L"sprite_" + name + L".asset");
  1035. return Resources::instance().load<SpriteTexture>(texturePath);
  1036. }
  1037. HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name)
  1038. {
  1039. Path texturePath = FileSystem::getWorkingDirectoryPath();
  1040. texturePath.append(EditorIconFolder);
  1041. texturePath.append(L"sprite_" + name + L".asset");
  1042. return Resources::instance().load<SpriteTexture>(texturePath);
  1043. }
  1044. HShader BuiltinEditorResources::getShader(const WString& name)
  1045. {
  1046. Path programPath = EditorShaderFolder;
  1047. programPath.append(name + L".asset");
  1048. return gResources().load<Shader>(programPath);
  1049. }
  1050. HMaterial BuiltinEditorResources::createDockDropOverlayMaterial() const
  1051. {
  1052. return Material::create(mShaderDockOverlay);
  1053. }
  1054. HMaterial BuiltinEditorResources::createSceneGridMaterial() const
  1055. {
  1056. return Material::create(mShaderSceneGrid);
  1057. }
  1058. HMaterial BuiltinEditorResources::createPicking(CullingMode cullMode) const
  1059. {
  1060. UINT32 modeIdx = (UINT32)cullMode;
  1061. return Material::create(mShaderPicking[modeIdx]);
  1062. }
  1063. HMaterial BuiltinEditorResources::createPickingAlpha(CullingMode cullMode) const
  1064. {
  1065. UINT32 modeIdx = (UINT32)cullMode;
  1066. return Material::create(mShaderPickingAlpha[modeIdx]);
  1067. }
  1068. HMaterial BuiltinEditorResources::createWireGizmoMat() const
  1069. {
  1070. return Material::create(mShaderGizmoWire);
  1071. }
  1072. HMaterial BuiltinEditorResources::createSolidGizmoMat() const
  1073. {
  1074. return Material::create(mShaderGizmoSolid);
  1075. }
  1076. HMaterial BuiltinEditorResources::createIconGizmoMat() const
  1077. {
  1078. return Material::create(mShaderGizmoIcon);
  1079. }
  1080. HMaterial BuiltinEditorResources::createGizmoPickingMat() const
  1081. {
  1082. return Material::create(mShaderGizmoPicking);
  1083. }
  1084. HMaterial BuiltinEditorResources::createAlphaGizmoPickingMat() const
  1085. {
  1086. return Material::create(mShaderGizmoAlphaPicking);
  1087. }
  1088. HMaterial BuiltinEditorResources::createWireHandleMat() const
  1089. {
  1090. return Material::create(mShaderHandleWire);
  1091. }
  1092. HMaterial BuiltinEditorResources::createSolidHandleMat() const
  1093. {
  1094. return Material::create(mShaderHandleSolid);
  1095. }
  1096. HMaterial BuiltinEditorResources::createSelectionMat() const
  1097. {
  1098. return Material::create(mShaderSelection);
  1099. }
  1100. HSpriteTexture BuiltinEditorResources::getLibraryIcon(ProjectIcon icon) const
  1101. {
  1102. switch (icon)
  1103. {
  1104. case ProjectIcon::Folder:
  1105. return getGUIIcon(FolderIconTex);
  1106. case ProjectIcon::Font:
  1107. return getGUIIcon(FontIconTex);
  1108. case ProjectIcon::Mesh:
  1109. return getGUIIcon(MeshIconTex);
  1110. case ProjectIcon::Texture:
  1111. return getGUIIcon(TextureIconTex);
  1112. case ProjectIcon::PlainText:
  1113. return getGUIIcon(PlainTextIconTex);
  1114. case ProjectIcon::ScriptCode:
  1115. return getGUIIcon(ScriptCodeIconTex);
  1116. case ProjectIcon::Shader:
  1117. return getGUIIcon(ShaderIconTex);
  1118. case ProjectIcon::ShaderInclude:
  1119. return getGUIIcon(ShaderIncludeIconTex);
  1120. case ProjectIcon::Material:
  1121. return getGUIIcon(MaterialIconTex);
  1122. case ProjectIcon::SpriteTexture:
  1123. return getGUIIcon(SpriteTextureIconTex);
  1124. }
  1125. return HSpriteTexture();
  1126. }
  1127. }