-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWifiMenuPage.cpp
35 lines (28 loc) · 1.13 KB
/
WifiMenuPage.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <common/Common.hpp>
#include <game/ui/Page.hpp>
#include <game/ui/page/MessagePopupPage.hpp>
#include <wiimmfi/Auth.hpp>
#include <wiimmfi/Status.hpp>
////////////////////////////////
// Wiimmfi Console Assignment //
////////////////////////////////
// WifiMenuPage::beforeCalc() override
// Display the Wiimmfi console assignment message if available
// Credits: Wiimmfi
kmPointerDefCpp(0x808BFF8C, void, Page* self) {
// Check if a message is available, if not bail
if (!Wiimmfi::Auth::sConsoleAssignMessage)
return;
// Get the message popup page, if not available bail
MessagePopupPage* page = MessagePopupPage::getPage();
if (!page) return;
// Inform the server we have seen the message
Wiimmfi::Status::SendMessage("message", "type=server");
// Display the message
MessageInfo msgInfo;
msgInfo.strings[0] = Wiimmfi::Auth::sConsoleAssignMessage;
page->setWindowMessage(6602, &msgInfo);
// Display the page and delete the pointer so this doesn't run again next frame
self->addPage(Page::MESSAGE_POPUP, Page::ANIM_NEXT);
Wiimmfi::Auth::sConsoleAssignMessage = nullptr;
}