Skip to content

Commit 66285ae

Browse files
committed
fix setting crash on slider control disable + expose some internal ui
stuff for mods to use + update changelog
1 parent 1b90149 commit 66285ae

File tree

5 files changed

+75
-7
lines changed

5 files changed

+75
-7
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Geode Changelog
2+
3+
## v0.4.3
4+
5+
- Simplified the minimum and maximum loader versions, loader will now load any mod whose target version major and minor match. In practice, this means that for example mods whose target version is v0.4.8 can be loaded by loader of version v0.4.6.
6+
- Add `Geode/ui/GeodeUI.hpp` header for exposing some access to internal Geode UI like opening a mod's settings popup
7+
- Fix crash with settings that could have a slider control
8+
9+
## v0.4.2
10+
11+
- Moved SDK version to its own file so CLI can query it
12+
- md4c is now linked statically on MacOS
13+
- Fix log filenames
14+
115
## v0.4.1
216

317
- Initial dev release of Geode.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
3+
#include "../loader/Mod.hpp"
4+
5+
namespace geode {
6+
/**
7+
* Open the Geode mods list
8+
*/
9+
GEODE_DLL void openModsList();
10+
/**
11+
* Open the info popup for a mod
12+
*/
13+
GEODE_DLL void openInfoPopup(Mod* mod);
14+
/**
15+
* Open the store page for a mod (if it exists)
16+
*/
17+
GEODE_DLL void openIndexPopup(Mod* mod);
18+
/**
19+
* Open the settings popup for a mod (if it has any settings)
20+
*/
21+
GEODE_DLL void openSettingsPopup(Mod* mod);
22+
}
23+

loader/src/ui/internal/GeodeUI.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <Geode/ui/GeodeUI.hpp>
2+
#include "list/ModListLayer.hpp"
3+
#include "info/ModInfoLayer.hpp"
4+
#include "settings/ModSettingsPopup.hpp"
5+
#include "../index/Index.hpp"
6+
7+
void geode::openModsList() {
8+
ModListLayer::scene();
9+
}
10+
11+
void geode::openInfoPopup(Mod* mod) {
12+
ModInfoLayer::create(mod, nullptr)->show();
13+
}
14+
15+
void geode::openIndexPopup(Mod* mod) {
16+
if (Index::get()->isKnownItem(mod->getID())) {
17+
ModInfoLayer::create(
18+
new ModObject(Index::get()->getKnownItem(mod->getID())),
19+
nullptr
20+
)->show();
21+
}
22+
}
23+
24+
void geode::openSettingsPopup(Mod* mod) {
25+
if (mod->hasSettings()) {
26+
ModSettingsPopup::create(mod)->show();
27+
}
28+
}
29+

loader/src/ui/internal/info/ModInfoLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ void ModInfoLayer::FLAlert_Clicked(FLAlertLayer* layer, bool btn2) {
576576
)->show();
577577
}
578578
}
579-
m_list->refreshList();
579+
if (m_list) m_list->refreshList();
580580
this->onClose(nullptr);
581581
} break;
582582
}
@@ -631,7 +631,7 @@ void ModInfoLayer::modInstallProgress(
631631

632632
m_ticket = nullptr;
633633

634-
m_list->refreshList();
634+
if (m_list) m_list->refreshList();
635635
this->onClose(nullptr);
636636
} break;
637637

loader/src/ui/internal/settings/GeodeSettingNode.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,13 @@ namespace {
423423
}
424424

425425
void updateSlider() {
426-
auto setting = std::static_pointer_cast<T>(self()->m_setting);
427-
m_slider->setValue(
428-
valueToSlider(setting, self()->m_uncommittedValue)
429-
);
430-
m_slider->updateBar();
426+
if (m_slider) {
427+
auto setting = std::static_pointer_cast<T>(self()->m_setting);
428+
m_slider->setValue(
429+
valueToSlider(setting, self()->m_uncommittedValue)
430+
);
431+
m_slider->updateBar();
432+
}
431433
}
432434

433435
void onSlider(CCObject* slider) {

0 commit comments

Comments
 (0)