Merge branch 'main' of https://github.com/geode-sdk/geode into main

This commit is contained in:
HJfod 2024-07-06 00:44:46 +03:00
commit 8dfef9e62a
3 changed files with 14 additions and 2 deletions
loader
include/Geode/ui
src/ui

View file

@ -10,7 +10,12 @@ namespace geode {
/**
* Open the info popup for a mod
*/
[[deprecated("Will be removed, it already doesn't do anything, use openIndexPopup instead")]]
GEODE_DLL void openInfoPopup(Mod* mod);
/**
* Open the info popup for a mod on the changelog page
*/
GEODE_DLL void openChangelogPopup(Mod* mod);
/**
* Open the issue report popup for a mod
*/

View file

@ -74,6 +74,12 @@ void geode::openIndexPopup(Mod* mod) {
ModPopup::create(mod)->show();
}
void geode::openChangelogPopup(Mod* mod) {
auto popup = ModPopup::create(mod);
popup->loadTab(ModPopup::Tab::Changelog);
popup->show();
}
void geode::openSettingsPopup(Mod* mod) {
if (mod->hasSettings()) {
ModSettingsPopup::create(mod)->show();

View file

@ -10,13 +10,14 @@
using namespace geode::prelude;
class ModPopup : public GeodePopup<ModSource&&> {
protected:
public:
enum class Tab {
Details,
Changelog,
Versions,
};
protected:
ModSource m_source;
CCNode* m_stats;
CCNode* m_tags;
@ -51,7 +52,6 @@ protected:
void onLoadTags(typename server::ServerRequest<std::unordered_set<std::string>>::Event* event);
void onCheckUpdates(typename server::ServerRequest<std::optional<server::ServerModUpdate>>::Event* event);
void loadTab(Tab tab);
void onTab(CCObject* sender);
void onEnable(CCObject*);
void onInstall(CCObject*);
@ -63,5 +63,6 @@ protected:
void onSupport(CCObject*);
public:
void loadTab(Tab tab);
static ModPopup* create(ModSource&& src);
};