Skip to content

Commit

Permalink
UIKit/UIKit.h
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowCat98 committed May 12, 2024
1 parent 2a34242 commit 83f2b76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/iGeodeLib.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include <functional>
#include <UIKit/UIKit.h>

void showAlert(const char *title, const char *message, const char *Btn);
NSString *iOSVersion();
Expand Down
8 changes: 6 additions & 2 deletions src/iGeodeLib.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ void showAlert(const char *title, const char *message, const char *Btn) {
CShowAlert("Title", "Message", "go away", MyCoolFunction());
- this function allows you to add 2 buttons!!!
usage: (again)
CShowAlert("Title", "Message", "go away", nullptr, "go away again");
CShowAlert("Title", "Message", "go away", nullptr, "go away again", nullptr);
this should give you an alert with 2 buttons and no callback at al!!!!;
*/
or alternatively
CShowAlert("Title", "Message", "go away", nullptr, nullptr, nullptr);
this should give you one button, with NO callback...
you should probably use showAlert() instead for that.
*/

void CShowAlert(const char *title, const char *message, const char *Btn, std::function<void()> callback = nullptr, const char *Btn2 = nullptr, std::function<void()> callback2 = nullptr) {
NSString *titleString = [NSString stringWithUTF8String:title];
Expand Down
2 changes: 1 addition & 1 deletion src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ using namespace geode::prelude;

class $modify(MenuLayer) {
void onMoreGames(CCObject*) {
CShowAlert("Hello", "hi", "go away", nullptr, "hi");
CShowAlert("Hello", "hi", "go away", nullptr, "hi", nullptr);
}
};

0 comments on commit 83f2b76

Please sign in to comment.