Skip to content

Commit

Permalink
Merge pull request #60 from vaguerant/patch-1
Browse files Browse the repository at this point in the history
Exit: Home launches Wii U Menu, Minus launches Mii Maker
  • Loading branch information
Maschell authored Feb 2, 2022
2 parents 892c34e + 331f8bf commit ab98b4b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "Application.h"
#include "common/common.h"
#include "dynamic_libs/os_functions.h"
#include "dynamic_libs/sys_functions.h"
#include "gui/FreeTypeGX.h"
#include "gui/DVPadController.h"
#include "gui/DWPadController.h"
Expand Down Expand Up @@ -168,8 +169,13 @@ void Application::executeThread(void)
if(controller[i]->update(video->getTvWidth(), video->getTvHeight()) == false)
continue;

if(controller[i]->data.buttons_d & VPAD_BUTTON_HOME)
if(controller[i]->data.buttons_d & VPAD_BUTTON_MINUS)
exitApplication = true;
else if(controller[i]->data.buttons_d & VPAD_BUTTON_HOME)
{
SYSLaunchMenu();
exitApplication = true;
}

//! update controller states
mainWindow->update(controller[i]);
Expand Down
13 changes: 13 additions & 0 deletions src/menu/HomebrewWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ HomebrewWindow::HomebrewWindow(int w, int h)
, updownButtons(0, 0)
, aButton(0, 0)
, hblVersionText("Homebrew Launcher " HBL_VERSION " by Dimok", 32, glm::vec4(1.0f))
, miiMakerHintText("Press \ue046 to open Mii Maker", 26, glm::vec4(1.0f))
, touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH)
, wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A)
, buttonLTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_L | GuiTrigger::BUTTON_LEFT | GuiTrigger::STICK_L_LEFT, true)
Expand Down Expand Up @@ -172,6 +173,17 @@ HomebrewWindow::HomebrewWindow(int w, int h)
append(&arrowRightButton);
}

void *font = NULL;
uint32_t size = 0;
OSGetSharedData(2, 0, (uint8_t*) &font, &size);

osFontSystem = new FreeTypeGX((uint8_t*) font, size, true);

miiMakerHintText.setFont(osFontSystem);
miiMakerHintText.setAlignment(ALIGN_BOTTOM | ALIGN_LEFT);
miiMakerHintText.setPosition(27, 36);
append(&miiMakerHintText);

hblVersionText.setAlignment(ALIGN_BOTTOM | ALIGN_RIGHT);
hblVersionText.setPosition(-30, 30);
append(&hblVersionText);
Expand Down Expand Up @@ -206,6 +218,7 @@ HomebrewWindow::~HomebrewWindow()
Resources::RemoveImageData(arrowRightImageData);
Resources::RemoveImageData(arrowLeftImageData);
Resources::RemoveImageData(homebrewButtonSelectedImageData);
delete osFontSystem;
}

void HomebrewWindow::OnOpenEffectFinish(GuiElement *element)
Expand Down
2 changes: 2 additions & 0 deletions src/menu/HomebrewWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class HomebrewWindow : public GuiFrame, public sigslot::has_slots<>
GuiButton updownButtons;
GuiButton aButton;
GuiText hblVersionText;
GuiText miiMakerHintText;

typedef struct
{
Expand Down Expand Up @@ -102,6 +103,7 @@ class HomebrewWindow : public GuiFrame, public sigslot::has_slots<>
TcpReceiver tcpReceiver;

bool inputDisabled;
FreeTypeGX * osFontSystem;
};

#endif //_HOMEBREW_WINDOW_H_

0 comments on commit ab98b4b

Please sign in to comment.