add openSupportPopup

This commit is contained in:
HJfod 2024-02-10 21:11:59 +02:00
parent b241c1ccda
commit 438252f946
3 changed files with 13 additions and 1 deletions
loader
include/Geode/ui
src/ui/internal

View file

@ -16,6 +16,10 @@ namespace geode {
* Open the issue report popup for a mod
*/
GEODE_DLL void openIssueReportPopup(Mod* mod);
/**
* Open the support popup for a mod
*/
GEODE_DLL void openSupportPopup(Mod* mod);
/**
* Open the store page for a mod (if it exists)
*/

View file

@ -8,7 +8,7 @@ namespace geode {
* FLAlertLayer with support for Markdown. See MDTextArea
* for details on what features of MD are supported.
*/
class MDPopup :
class GEODE_DLL MDPopup :
public Popup<
std::string const&, std::string const&, char const*, char const*,
utils::MiniFunction<void(bool)>> {

View file

@ -42,6 +42,14 @@ void geode::openIssueReportPopup(Mod* mod) {
}
}
void geode::openSupportPopup(Mod* mod) {
MDPopup::create(
"Support " + mod->getMetadata().getName(),
mod->getMetadata().getSupportInfo().value(),
"OK"
)->show();
}
void geode::openInfoPopup(Mod* mod) {
LocalModInfoPopup::create(mod, nullptr)->show();
}