Skip to content

Commit

Permalink
v3-rc3 (final)
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Dec 11, 2024
1 parent aeb8894 commit 7eea198
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/mods.list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v3.0.0-list2",
"version": "3.0.0 final. list1",
"list": [

"https://github.com/Alphalaneous/HappyTextures/releases/latest/download/alphalaneous.happy_textures.geode",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified resources/sounds/menuLoops/menuLoop_rand Puhf - Forlorn.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified resources/sounds/menuLoops/menuLoop_rand(asd1).mp3
Binary file not shown.
Binary file not shown.
Binary file modified resources/sounds/menuLoops/menuLoop_rand(nfs-mw-shop).mp3
Binary file not shown.
Binary file modified resources/sounds/menuLoops/menuLoop_rand(plenka-closed).mp3
Binary file not shown.
Binary file modified resources/sounds/shop.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/_ImGui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static CCPoint toCocos(const ImVec2& pos) {

#include <imgui-cocos.hpp>
#include <Geode/modify/CCDirector.hpp>
class $modify(ImGuiCocosSetup, CCDirector) {
class $modify(ImGuiInit, CCDirector) {
$override void runWithScene(CCScene * pScene) {
CCDirector::runWithScene(pScene);
ImGuiCocos::get().setup([] {}).draw([] {});
Expand Down
2 changes: 0 additions & 2 deletions src/_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class $modify(FLAlertLayerShowupStartPointExt, CCNode) {
}
};
};
#ifdef GEODE_IS_WINDOWS
if (auto casted = typeinfo_cast<MenuGameLayer*>(this)) {
if (casted->getContentSize().equals(CCDirector::get()->getWinSize())) {
casted->setAnchorPoint(toCocos(ImGui::GetMousePos()) / casted->getContentSize());
Expand All @@ -35,7 +34,6 @@ class $modify(FLAlertLayerShowupStartPointExt, CCNode) {
}
};
}
#endif
};

#ifdef GEODE_IS_WINDOWS
Expand Down
25 changes: 20 additions & 5 deletions src/download_mods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ inline auto mods_list_version = std::string();
inline auto mods_list_ver_file = dirs::getModsDir() / ".list_version";

inline Ref<Slider> loadingBar = nullptr;
inline Ref<SimpleTextArea> statusLabel = nullptr;

inline void downloadModsFromList(int id = 0, int attempts = 0, bool failed = 0) {
log::debug("{}(id {})", __func__, id);
log::debug("{}(id {}, attempts {}, failed {})", __func__, id, attempts, failed);
auto url = mods_list[id];
auto filename = fs::path(url).filename();
statusLabel->setText(fmt::format(
"{}\nurl: {}\nid: {}, attempts: {}, was failed: {}", filename, url, id, attempts, failed
).c_str());
auto req = web::WebRequest();
auto listener = new EventListener<web::WebTask>;
listener->bind(
Expand All @@ -22,7 +26,7 @@ inline void downloadModsFromList(int id = 0, int attempts = 0, bool failed = 0)
if (retry and attempts <= 6) nextid = id;
else if (retry) isfailed = true;
if (mods_list.contains(nextid)) {
downloadModsFromList(nextid, attempts + 1, isfailed);
downloadModsFromList(nextid, not isfailed ? 0 : attempts + 1, isfailed);
}
else if (!isfailed) {
std::ofstream(mods_list_ver_file) << mods_list_version;
Expand All @@ -49,6 +53,7 @@ inline void downloadModsFromList(int id = 0, int attempts = 0, bool failed = 0)
"", msg.data(), "miniSkull_001.png", 1);
AchievementNotifier::sharedState()->showNextAchievement();
log::error("{}", string::replace(msg, "\n", ""));
statusLabel->setText(fmt::format("{}", string::replace(msg, "\n", "")).c_str());
return gonext(true);
}
}
Expand Down Expand Up @@ -97,14 +102,24 @@ inline void getListAndStartDownloadingMods() {
auto popup = createQuickPopup(
"Downloading mods...",
"\n"
"<cr>DON'T CLOSE THE GAME</c>""\n"
"game will be restarted after finish",
"a", "a", [](auto, auto) {}, false
"<cr>DON'T CLOSE THE GAME!</c>""\n"
"<co>Game will be restarted after finish.</c>",
"e", "w", [](auto, auto) {}, false
);

popup->m_button1->setVisible(0);
popup->m_button2->setVisible(0);

loadingBar = Slider::create(popup, nullptr);
popup->m_buttonMenu->addChild(loadingBar);

statusLabel = SimpleTextArea::create(
"loading..?", "chatFont.fnt", 0.7f, popup->getContentWidth() - 120.f
);
statusLabel->setAnchorPoint({ 0.5f, 1.0f });
statusLabel->setPositionY(-40.f);
popup->m_buttonMenu->addChild(statusLabel);

popup->setContentSize(CCSize(1, 1) * 2222);
SceneManager::get()->keepAcrossScenes(popup);
downloadModsFromList();
Expand Down

0 comments on commit 7eea198

Please sign in to comment.