mirror of
https://github.com/Maschell/hid_to_vpad.git
synced 2025-02-17 13:36:25 +01:00
Code cleanup and bug fixed + more
- Fixed the intial value of the GuiToogle - updated the filelist and added a icon for a settings menu
This commit is contained in:
parent
fbb584be6a
commit
20a5838c57
BIN
data/images/settingsbtn.png
Normal file
BIN
data/images/settingsbtn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
@ -26,5 +26,7 @@
|
|||||||
#include "GuiSound.h"
|
#include "GuiSound.h"
|
||||||
#include "GuiButton.h"
|
#include "GuiButton.h"
|
||||||
#include "GuiTrigger.h"
|
#include "GuiTrigger.h"
|
||||||
|
#include "GuiSelectBox.h"
|
||||||
|
#include "GuiSwitch.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,7 +23,7 @@ GuiToggle::GuiToggle(bool checked,f32 width,f32 height)
|
|||||||
: GuiButton(width,height)
|
: GuiButton(width,height)
|
||||||
{
|
{
|
||||||
bChanged = false;
|
bChanged = false;
|
||||||
selected = false;
|
selected = checked;
|
||||||
clicked.connect(this,&GuiToggle::OnToggleClick);
|
clicked.connect(this,&GuiToggle::OnToggleClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
src/main.cpp
34
src/main.cpp
@ -1,32 +1,36 @@
|
|||||||
#include "Application.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include "controller_patcher/ControllerPatcher.hpp"
|
||||||
|
|
||||||
#include "dynamic_libs/os_functions.h"
|
#include "dynamic_libs/os_functions.h"
|
||||||
#include "dynamic_libs/gx2_functions.h"
|
#include "dynamic_libs/gx2_functions.h"
|
||||||
#include "dynamic_libs/syshid_functions.h"
|
#include "dynamic_libs/syshid_functions.h"
|
||||||
#include "dynamic_libs/vpad_functions.h"
|
#include "dynamic_libs/vpad_functions.h"
|
||||||
#include "dynamic_libs/socket_functions.h"
|
#include "dynamic_libs/socket_functions.h"
|
||||||
#include "dynamic_libs/sys_functions.h"
|
#include "dynamic_libs/sys_functions.h"
|
||||||
#include "fs/fs_utils.h"
|
|
||||||
#include "fs/sd_fat_devoptab.h"
|
|
||||||
#include "system/memory.h"
|
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "common/common.h"
|
#include "utils/function_patcher.h"
|
||||||
|
|
||||||
#include "main.h"
|
#include "patcher/hid_controller_function_patcher.hpp"
|
||||||
#include "version.h"
|
|
||||||
|
#include "fs/fs_utils.h"
|
||||||
|
#include "fs/sd_fat_devoptab.h"
|
||||||
|
|
||||||
|
#include "system/memory.h"
|
||||||
|
#include "kernel/kernel_functions.h"
|
||||||
#include "common/common.h"
|
#include "common/common.h"
|
||||||
|
|
||||||
#include "language/gettext.h"
|
#include "language/gettext.h"
|
||||||
|
|
||||||
#include "controller_patcher/ControllerPatcher.hpp"
|
|
||||||
#include "utils/function_patcher.h"
|
|
||||||
#include "patcher/hid_controller_function_patcher.hpp"
|
|
||||||
#include "kernel/kernel_functions.h"
|
|
||||||
#include "video/CursorDrawer.h"
|
#include "video/CursorDrawer.h"
|
||||||
#include "utils/logger.h"
|
|
||||||
#include "utils/StringTools.h"
|
|
||||||
|
|
||||||
#include "system/memory.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
#include "utils/StringTools.h"
|
||||||
|
|
||||||
/* Entry point */
|
/* Entry point */
|
||||||
extern "C" s32 Menu_Main(void){
|
extern "C" s32 Menu_Main(void){
|
||||||
@ -85,12 +89,10 @@ extern "C" s32 Menu_Main(void){
|
|||||||
//!*******************************************************************
|
//!*******************************************************************
|
||||||
log_printf("Menu_Main (line %d): Initialize memory management\n",__LINE__);
|
log_printf("Menu_Main (line %d): Initialize memory management\n",__LINE__);
|
||||||
memoryInitialize();
|
memoryInitialize();
|
||||||
|
|
||||||
log_printf("Menu_Main (line %d): Mount SD partition\n",__LINE__);
|
log_printf("Menu_Main (line %d): Mount SD partition\n",__LINE__);
|
||||||
mount_sd_fat("sd");
|
mount_sd_fat("sd");
|
||||||
log_printf("Menu_Main (line %d): Start main application\n",__LINE__);
|
log_printf("Menu_Main (line %d): Start main application\n",__LINE__);
|
||||||
result = Application::instance()->exec();
|
result = Application::instance()->exec();
|
||||||
|
|
||||||
log_printf("Menu_Main (line %d): Main application stopped result: %d\n",__LINE__,result);
|
log_printf("Menu_Main (line %d): Main application stopped result: %d\n",__LINE__,result);
|
||||||
Application::destroyInstance();
|
Application::destroyInstance();
|
||||||
log_printf("Menu_Main (line %d): Unmount SD\n",__LINE__);
|
log_printf("Menu_Main (line %d): Unmount SD\n",__LINE__);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#ifndef _MAIN_H_
|
#ifndef _MAIN_H_
|
||||||
#define _MAIN_H_
|
#define _MAIN_H_
|
||||||
|
|
||||||
#include "common/types.h"
|
#include <gctypes.h>
|
||||||
#include "dynamic_libs/os_functions.h"
|
|
||||||
|
|
||||||
/* Main */
|
/* Main */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -165,7 +165,6 @@ private:
|
|||||||
void OnCloseEffectFinish(GuiElement *element);
|
void OnCloseEffectFinish(GuiElement *element);
|
||||||
bool checkForRealProController();
|
bool checkForRealProController();
|
||||||
|
|
||||||
|
|
||||||
void OnInputGetterMenuFinish(GuiElement *element, bool result,UController_Type controller_type);
|
void OnInputGetterMenuFinish(GuiElement *element, bool result,UController_Type controller_type);
|
||||||
|
|
||||||
void clickListEntryByController(UController_Type controller_type);
|
void clickListEntryByController(UController_Type controller_type);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#define _CONTENT_HOME_H
|
#define _CONTENT_HOME_H
|
||||||
|
|
||||||
#include "gui/Gui.h"
|
#include "gui/Gui.h"
|
||||||
#include "ContentHome.h"
|
|
||||||
#include "ContentTemplate.h"
|
#include "ContentTemplate.h"
|
||||||
#include "language/gettext.h"
|
#include "language/gettext.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Loadiine resource files.
|
* Loadiine resource files.
|
||||||
* This file is generated automatically.
|
* This file is generated automatically.
|
||||||
* Includes 95 files.
|
* Includes 109 files.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
* Any manual modification of this file will be overwriten by the generation.
|
* Any manual modification of this file will be overwriten by the generation.
|
||||||
@ -194,6 +194,15 @@ extern const u32 buttons_pro_zr_png_size;
|
|||||||
extern const u8 button_click_mp3[];
|
extern const u8 button_click_mp3[];
|
||||||
extern const u32 button_click_mp3_size;
|
extern const u32 button_click_mp3_size;
|
||||||
|
|
||||||
|
extern const u8 checkbox_png[];
|
||||||
|
extern const u32 checkbox_png_size;
|
||||||
|
|
||||||
|
extern const u8 checkbox_highlighted_png[];
|
||||||
|
extern const u32 checkbox_highlighted_png_size;
|
||||||
|
|
||||||
|
extern const u8 checkbox_selected_png[];
|
||||||
|
extern const u32 checkbox_selected_png_size;
|
||||||
|
|
||||||
extern const u8 font_ttf[];
|
extern const u8 font_ttf[];
|
||||||
extern const u32 font_ttf_size;
|
extern const u32 font_ttf_size;
|
||||||
|
|
||||||
@ -209,6 +218,21 @@ extern const u32 gamepadBig_png_size;
|
|||||||
extern const u8 gamepadIcon_png[];
|
extern const u8 gamepadIcon_png[];
|
||||||
extern const u32 gamepadIcon_png_size;
|
extern const u32 gamepadIcon_png_size;
|
||||||
|
|
||||||
|
extern const u8 gameSettingsButton_png[];
|
||||||
|
extern const u32 gameSettingsButton_png_size;
|
||||||
|
|
||||||
|
extern const u8 gameSettingsButtonEx_png[];
|
||||||
|
extern const u32 gameSettingsButtonEx_png_size;
|
||||||
|
|
||||||
|
extern const u8 gameSettingsButtonExHighlighted_png[];
|
||||||
|
extern const u32 gameSettingsButtonExHighlighted_png_size;
|
||||||
|
|
||||||
|
extern const u8 gameSettingsButtonExSelected_png[];
|
||||||
|
extern const u32 gameSettingsButtonExSelected_png_size;
|
||||||
|
|
||||||
|
extern const u8 gameSettingsButtonSelected_png[];
|
||||||
|
extern const u32 gameSettingsButtonSelected_png_size;
|
||||||
|
|
||||||
extern const u8 GithubIcon_png[];
|
extern const u8 GithubIcon_png[];
|
||||||
extern const u32 GithubIcon_png_size;
|
extern const u32 GithubIcon_png_size;
|
||||||
|
|
||||||
@ -293,6 +317,24 @@ extern const u32 selectorSmall_png_size;
|
|||||||
extern const u8 seperator_png[];
|
extern const u8 seperator_png[];
|
||||||
extern const u32 seperator_png_size;
|
extern const u32 seperator_png_size;
|
||||||
|
|
||||||
|
extern const u8 settingsbtn_png[];
|
||||||
|
extern const u32 settingsbtn_png_size;
|
||||||
|
|
||||||
|
extern const u8 settings_click_2_mp3[];
|
||||||
|
extern const u32 settings_click_2_mp3_size;
|
||||||
|
|
||||||
|
extern const u8 switchIconBase_png[];
|
||||||
|
extern const u32 switchIconBase_png_size;
|
||||||
|
|
||||||
|
extern const u8 switchIconBaseHighlighted_png[];
|
||||||
|
extern const u32 switchIconBaseHighlighted_png_size;
|
||||||
|
|
||||||
|
extern const u8 switchIconOff_png[];
|
||||||
|
extern const u32 switchIconOff_png_size;
|
||||||
|
|
||||||
|
extern const u8 switchIconOn_png[];
|
||||||
|
extern const u32 switchIconOn_png_size;
|
||||||
|
|
||||||
extern const u8 TVElementControllerBG_png[];
|
extern const u8 TVElementControllerBG_png[];
|
||||||
extern const u32 TVElementControllerBG_png_size;
|
extern const u32 TVElementControllerBG_png_size;
|
||||||
|
|
||||||
@ -365,11 +407,19 @@ static RecourceFile RecourceList[] =
|
|||||||
{"buttons_pro_zl.png", buttons_pro_zl_png, buttons_pro_zl_png_size, NULL, 0},
|
{"buttons_pro_zl.png", buttons_pro_zl_png, buttons_pro_zl_png_size, NULL, 0},
|
||||||
{"buttons_pro_zr.png", buttons_pro_zr_png, buttons_pro_zr_png_size, NULL, 0},
|
{"buttons_pro_zr.png", buttons_pro_zr_png, buttons_pro_zr_png_size, NULL, 0},
|
||||||
{"button_click.mp3", button_click_mp3, button_click_mp3_size, NULL, 0},
|
{"button_click.mp3", button_click_mp3, button_click_mp3_size, NULL, 0},
|
||||||
|
{"checkbox.png", checkbox_png, checkbox_png_size, NULL, 0},
|
||||||
|
{"checkbox_highlighted.png", checkbox_highlighted_png, checkbox_highlighted_png_size, NULL, 0},
|
||||||
|
{"checkbox_selected.png", checkbox_selected_png, checkbox_selected_png_size, NULL, 0},
|
||||||
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
|
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
|
||||||
{"footer.png", footer_png, footer_png_size, NULL, 0},
|
{"footer.png", footer_png, footer_png_size, NULL, 0},
|
||||||
{"gamepad.png", gamepad_png, gamepad_png_size, NULL, 0},
|
{"gamepad.png", gamepad_png, gamepad_png_size, NULL, 0},
|
||||||
{"gamepadBig.png", gamepadBig_png, gamepadBig_png_size, NULL, 0},
|
{"gamepadBig.png", gamepadBig_png, gamepadBig_png_size, NULL, 0},
|
||||||
{"gamepadIcon.png", gamepadIcon_png, gamepadIcon_png_size, NULL, 0},
|
{"gamepadIcon.png", gamepadIcon_png, gamepadIcon_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButton.png", gameSettingsButton_png, gameSettingsButton_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonEx.png", gameSettingsButtonEx_png, gameSettingsButtonEx_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonExHighlighted.png", gameSettingsButtonExHighlighted_png, gameSettingsButtonExHighlighted_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonExSelected.png", gameSettingsButtonExSelected_png, gameSettingsButtonExSelected_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonSelected.png", gameSettingsButtonSelected_png, gameSettingsButtonSelected_png_size, NULL, 0},
|
||||||
{"GithubIcon.png", GithubIcon_png, GithubIcon_png_size, NULL, 0},
|
{"GithubIcon.png", GithubIcon_png, GithubIcon_png_size, NULL, 0},
|
||||||
{"helpIcon.png", helpIcon_png, helpIcon_png_size, NULL, 0},
|
{"helpIcon.png", helpIcon_png, helpIcon_png_size, NULL, 0},
|
||||||
{"home.png", home_png, home_png_size, NULL, 0},
|
{"home.png", home_png, home_png_size, NULL, 0},
|
||||||
@ -398,6 +448,12 @@ static RecourceFile RecourceList[] =
|
|||||||
{"selectorBig.png", selectorBig_png, selectorBig_png_size, NULL, 0},
|
{"selectorBig.png", selectorBig_png, selectorBig_png_size, NULL, 0},
|
||||||
{"selectorSmall.png", selectorSmall_png, selectorSmall_png_size, NULL, 0},
|
{"selectorSmall.png", selectorSmall_png, selectorSmall_png_size, NULL, 0},
|
||||||
{"seperator.png", seperator_png, seperator_png_size, NULL, 0},
|
{"seperator.png", seperator_png, seperator_png_size, NULL, 0},
|
||||||
|
{"settingsbtn.png", settingsbtn_png, settingsbtn_png_size, NULL, 0},
|
||||||
|
{"settings_click_2.mp3", settings_click_2_mp3, settings_click_2_mp3_size, NULL, 0},
|
||||||
|
{"switchIconBase.png", switchIconBase_png, switchIconBase_png_size, NULL, 0},
|
||||||
|
{"switchIconBaseHighlighted.png", switchIconBaseHighlighted_png, switchIconBaseHighlighted_png_size, NULL, 0},
|
||||||
|
{"switchIconOff.png", switchIconOff_png, switchIconOff_png_size, NULL, 0},
|
||||||
|
{"switchIconOn.png", switchIconOn_png, switchIconOn_png_size, NULL, 0},
|
||||||
{"TVElementControllerBG.png", TVElementControllerBG_png, TVElementControllerBG_png_size, NULL, 0},
|
{"TVElementControllerBG.png", TVElementControllerBG_png, TVElementControllerBG_png_size, NULL, 0},
|
||||||
{"TVElementControllerBGSelected.png", TVElementControllerBGSelected_png, TVElementControllerBGSelected_png_size, NULL, 0},
|
{"TVElementControllerBGSelected.png", TVElementControllerBGSelected_png, TVElementControllerBGSelected_png_size, NULL, 0},
|
||||||
{"TwitterIcon.png", TwitterIcon_png, TwitterIcon_png_size, NULL, 0},
|
{"TwitterIcon.png", TwitterIcon_png, TwitterIcon_png_size, NULL, 0},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user