mirror of
https://github.com/risingPhil/PokeMe64.git
synced 2026-03-21 18:04:15 -05:00
It doesn't look like much, but it's functional ;-) It can inject distribution pokémon into gen 1 and gen 2 original cartridges and inject the GS ball in Pokémon Crystal. That's it. But that was the minimal feature set I had in mind for the project. In the Readme.md you can find the ideas I have for expanding the project. But the first priority is the UI, because it really looks bad right now. (as I was mostly focused on building blocks and transfer pak functionality. Not on making it looks good)
68 lines
1.8 KiB
C++
Executable File
68 lines
1.8 KiB
C++
Executable File
#ifndef _MAINMENUSCENE_H
|
|
#define _MAINMENUSCENE_H
|
|
|
|
#include "scenes/SceneWithDialogWidget.h"
|
|
#include "widget/VerticalList.h"
|
|
#include "widget/DialogWidget.h"
|
|
#include "widget/CursorWidget.h"
|
|
#include "widget/MenuItemWidget.h"
|
|
#include "widget/ListItemFiller.h"
|
|
#include "widget/IFocusListener.h"
|
|
|
|
typedef struct MenuSceneContext
|
|
{
|
|
MenuItemData* menuEntries;
|
|
uint32_t numMenuEntries;
|
|
} MenuSceneContext;
|
|
|
|
/**
|
|
* @brief A scene showing a menu
|
|
*
|
|
*/
|
|
class MenuScene : public SceneWithDialogWidget, public IFocusListener
|
|
{
|
|
public:
|
|
MenuScene(SceneDependencies& deps, void* context);
|
|
virtual ~MenuScene();
|
|
|
|
void init() override;
|
|
void destroy() override;
|
|
|
|
void render(RDPQGraphics& gfx, const Rectangle& sceneBounds) override;
|
|
|
|
bool handleUserInput(joypad_port_t port, const joypad_inputs_t& inputs) override;
|
|
|
|
virtual void onDialogDone();
|
|
|
|
void focusChanged(const FocusChangeStatus& status) override;
|
|
|
|
SceneDependencies& getDependencies();
|
|
|
|
/**
|
|
* This is a helper function to show a single message to the user.
|
|
* It should only be used for simple situations. (feedback on a function executed directly in the menu for example)
|
|
*/
|
|
void showSingleMessage(const DialogData& messageData);
|
|
protected:
|
|
virtual void setupMenu();
|
|
void setupFonts() override;
|
|
void setupDialog(DialogWidgetStyle& style) override;
|
|
|
|
virtual void showDialog(DialogData* diagData);
|
|
|
|
MenuSceneContext* context_;
|
|
sprite_t* menu9SliceSprite_;
|
|
sprite_t* cursorSprite_;
|
|
VerticalList menuList_;
|
|
CursorWidget cursorWidget_;
|
|
ListItemFiller<VerticalList, MenuItemData, MenuItemWidget, MenuItemStyle> menuListFiller_;
|
|
WidgetFocusChainSegment listFocusChainSegment_;
|
|
uint8_t fontStyleYellowId_;
|
|
bool bButtonPressed_;
|
|
private:
|
|
DialogData singleMessageDialog_;
|
|
};
|
|
|
|
void deleteMenuSceneContext(void* context);
|
|
|
|
#endif |