-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add funraising flags, sort rupee flags into their own menu
- Loading branch information
Showing
11 changed files
with
229 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
file(GLOB_RECURSE srcs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") | ||
file(GLOB_RECURSE asms CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.s") | ||
list(APPEND srcs ${asms}) | ||
get_filename_component(rel_name ${CMAKE_CURRENT_SOURCE_DIR} NAME) | ||
tpgz_add_module(${rel_name} "${srcs}" "${CMAKE_CURRENT_SOURCE_DIR}/include") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
namespace tpgz::modules { | ||
void main(); | ||
void exit(); | ||
} // namespace tpgz::modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
#include "menus/menu.h" | ||
|
||
struct RupeeFlagsData { | ||
u16 l_donationAmount; | ||
u16 l_fundraisingAmount; | ||
bool l_fundraising1; | ||
bool l_fundraising2; | ||
bool l_rupeeFlag; | ||
}; | ||
|
||
enum GeneralFlagsIndex { | ||
DONATION_AMT_INDEX, | ||
FUNDRAISING_AMT_INDEX, | ||
FUNDRAISING_1_INDEX, | ||
FUNDRAISING_2_INDEX, | ||
RUPEE_CS_FLAG_INDEX, | ||
|
||
RUPEE_FLAGS_COUNT | ||
}; | ||
|
||
extern RupeeFlagsData* rupeeFlagsData; | ||
|
||
class RupeeFlagsMenu : public Menu { | ||
public: | ||
RupeeFlagsMenu(Cursor&); | ||
virtual ~RupeeFlagsMenu(); | ||
virtual void draw(); | ||
|
||
private: | ||
Line lines[RUPEE_FLAGS_COUNT]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <main.h> | ||
#include "menus/menu_rupee_flags/include/rupee_flags_menu.h" | ||
#include "events/draw_listener.h" | ||
#include "menus/utils/menu_mgr.h" | ||
#include "utils/draw.h" | ||
|
||
void onCreate(); | ||
void onLoad(); | ||
void onDraw(); | ||
void onUnload(); | ||
void onDelete(); | ||
|
||
RupeeFlagsMenu* l_menu; | ||
|
||
namespace tpgz::modules { | ||
void main() { | ||
g_menuMgr->setCreateHook(onCreate); | ||
g_menuMgr->setLoadHook(onLoad); | ||
g_menuMgr->setUnloadHook(onUnload); | ||
g_menuMgr->setDeleteHook(onDelete); | ||
} | ||
void exit() { | ||
g_menuMgr->setCreateHook(nullptr); | ||
g_menuMgr->setLoadHook(nullptr); | ||
g_menuMgr->setUnloadHook(nullptr); | ||
g_menuMgr->setDeleteHook(nullptr); | ||
} | ||
} // namespace tpgz::modules | ||
|
||
void onCreate() { | ||
g_menuMgr->setPersistentData(new RupeeFlagsData); | ||
if (!g_menuMgr->getPermanentData<Cursor>()) { | ||
g_menuMgr->setPermanentData(new Cursor); | ||
} | ||
} | ||
|
||
void onLoad() { | ||
rupeeFlagsData = g_menuMgr->getPersistentData<RupeeFlagsData>(); | ||
l_menu = new RupeeFlagsMenu(*g_menuMgr->getPermanentData<Cursor>()); | ||
g_drawListener->addListener(onDraw); | ||
} | ||
|
||
void onDraw() { | ||
l_menu->draw(); | ||
} | ||
|
||
void onUnload() { | ||
g_drawListener->removeListener(onDraw); | ||
delete l_menu; | ||
} | ||
|
||
void onDelete() { | ||
auto data = g_menuMgr->getPersistentData<RupeeFlagsData>(); | ||
delete data; | ||
g_menuMgr->setPersistentData<RupeeFlagsData>(nullptr); | ||
} |
Oops, something went wrong.