diff --git a/src/moon/mod-engine/engine.cpp b/src/moon/mod-engine/engine.cpp index 1ceb3735..802f8df8 100644 --- a/src/moon/mod-engine/engine.cpp +++ b/src/moon/mod-engine/engine.cpp @@ -236,10 +236,10 @@ using namespace std::chrono; void Moon_InitModEngine( char *exePath, char *gamedir ){ milliseconds start_ms = duration_cast< milliseconds >( system_clock::now().time_since_epoch() ); - // Moon_LoadAddon("/home/alex/Music/Moon64-Packs/converted/beta-hud.bit"); - // Moon_LoadAddon("/home/alex/disks/uwu/Projects/UnderVolt/Moon64-Packs/converted/owo.bit"); - // Moon_LoadAddon("/home/alex/Music/Moon64-Packs/converted/minecraft.bit"); - // Moon_BakeTextureCache({1, 0, 2, 3}); + Moon_ScanAddonsDirectory( exePath, gamedir ); + vector order; + for(int i = 0; i < addons.size(); i++) order.push_back(i); + Moon_BakeTextureCache(order); milliseconds end_ms = duration_cast< milliseconds >( system_clock::now().time_since_epoch() ); std::cout << "Finised loading in " << ((end_ms.count() - start_ms.count()) / 1000) << " seconds" << std::endl; diff --git a/src/moon/ui/screens/options/categories/mcategory.h b/src/moon/ui/screens/options/categories/mcategory.h index ef9c0df5..4fa09bc2 100644 --- a/src/moon/ui/screens/options/categories/mcategory.h +++ b/src/moon/ui/screens/options/categories/mcategory.h @@ -11,7 +11,9 @@ class MoonCategory { public: MoonCategory(string categoryName){ this->categoryName = categoryName; + this->titleKey = true; }; + bool titleKey = false; string categoryName; std::vector catOptions; }; diff --git a/src/moon/ui/screens/options/categories/mtextures.cpp b/src/moon/ui/screens/options/categories/mtextures.cpp index 4c1fc929..936b345c 100644 --- a/src/moon/ui/screens/options/categories/mtextures.cpp +++ b/src/moon/ui/screens/options/categories/mtextures.cpp @@ -12,29 +12,18 @@ extern "C" { #include "pc/configfile.h" } -std::vector order = {1, 0, 2, 3}; +std::vector order; MWValue *tmpButton; -MTexturesCategory::MTexturesCategory() : MoonCategory("TEXT_OPT_AUDIO"){ - int idx = 0; - // for(auto &addon : addons){ - // this->catOptions.push_back(new MWValue(22, 57 + (17 * idx), addon->name, {.bvar = &addon->enabled}, false)); - // idx++; - // } +MTexturesCategory::MTexturesCategory() : MoonCategory("Textures"){ + this->titleKey = false; + for(int i = 0; i < addons.size(); i++) order.push_back(i); + this->catOptions.push_back(tmpButton = new MWValue(22, 57, "Randomize packs", {.btn = [](){ tmpButton->title = "Randomize on progress"; std::random_shuffle ( order.begin(), order.end() ); Moon_TestRebuildOrder(order); tmpButton->title = "Randomize packs"; }}, false)); - // this->catOptions.push_back(new MWValue(22, 57 + (17 * 1), "Load minecraft pack", {.btn = [](){ - // Moon_TextFlyLoad(1); - // }}, false)); - // this->catOptions.push_back(new MWValue(22, 57 + (17 * 2), "Load owo pack", {.btn = [](){ - // Moon_TextFlyLoad(2); - // }}, false)); - // this->catOptions.push_back(new MWValue(22, 57 + (17 * 3), "Load Render96 pack", {.btn = [](){ - // Moon_TextFlyLoad(2); - // }}, false)); } \ No newline at end of file diff --git a/src/moon/ui/screens/options/main-view.cpp b/src/moon/ui/screens/options/main-view.cpp index 145dcc69..b6d00828 100644 --- a/src/moon/ui/screens/options/main-view.cpp +++ b/src/moon/ui/screens/options/main-view.cpp @@ -83,7 +83,7 @@ void MoonOptMain::Update(){ } void MoonOptMain::Draw(){ - string curTitle = Moon_GetKey(categories[categoryIndex]->categoryName); + string curTitle = categories[categoryIndex]->titleKey ? Moon_GetKey(categories[categoryIndex]->categoryName) : categories[categoryIndex]->categoryName; float txtWidth = MoonGetTextWidth(curTitle, 1.0, true); MoonDrawRectangle(0, 0, GetScreenWidth(false), GetScreenHeight(), {0, 0, 0, 100}, false);