Adopt changes for the new libgui

- Needs a new SelectBox wrapper with default values.
- Removed the scale parameter from the default chechbox/Switch
- Removed unneeded values from the common.h
This commit is contained in:
Maschell 2017-10-29 16:06:17 +01:00
parent c94d182911
commit 1719033114
15 changed files with 167 additions and 78 deletions

View File

@ -248,27 +248,27 @@ msgstr "É de código aberto e pode encontrar aquí:"
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "" msgstr ""

View File

@ -246,27 +246,27 @@ msgstr ""
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "" msgstr ""

View File

@ -247,27 +247,27 @@ msgstr "Il est Open source et peut être trouvé ici: "
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgstr "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "Langue" msgstr "Langue"
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "Vibration" msgstr "Vibration"
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "Musique" msgstr "Musique"
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "<Défaut>" msgstr "<Défaut>"

View File

@ -248,27 +248,27 @@ msgstr "Es ist Open-Source und kann hier geladen werden:"
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "Sprache" msgstr "Sprache"
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "Musik" msgstr "Musik"
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "" msgstr ""

View File

@ -247,27 +247,27 @@ msgstr "È open source e puoi trovarlo qui:"
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgstr "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "Lingua" msgstr "Lingua"
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "Vibrazione" msgstr "Vibrazione"
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "Musica" msgstr "Musica"
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "<Default>" msgstr "<Default>"

View File

@ -248,27 +248,27 @@ msgstr "Es de código abierto y puedes encontrarlo aquí:"
msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:46 #: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:51 #: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:47 #: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:52 #: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble" msgid "Rumble"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:48 #: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:53 #: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music" msgid "Music"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:49 #: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:54 #: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller" msgid "Network Controller"
msgstr "" msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75 #: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>" msgid "<Default>"
msgstr "" msgstr ""

View File

@ -11,20 +11,11 @@ extern "C" {
#define SD_PATH "sd:" #define SD_PATH "sd:"
#define WIIU_PATH "/wiiu" #define WIIU_PATH "/wiiu"
// none dynamic libs
#define LIB_LOADER 0x1001
#ifndef MEM_BASE
#define MEM_BASE (0x00800000)
#endif
#define ELF_DATA_ADDR (*(volatile u32*)(MEM_BASE + 0x1300 + 0x00)) #define ELF_DATA_ADDR (*(volatile u32*)(MEM_BASE + 0x1300 + 0x00))
#define ELF_DATA_SIZE (*(volatile u32*)(MEM_BASE + 0x1300 + 0x04)) #define ELF_DATA_SIZE (*(volatile u32*)(MEM_BASE + 0x1300 + 0x04))
#define MAIN_ENTRY_ADDR (*(volatile u32*)(MEM_BASE + 0x1400 + 0x00)) #define MAIN_ENTRY_ADDR (*(volatile u32*)(MEM_BASE + 0x1400 + 0x00))
#define OS_FIRMWARE (*(volatile u32*)(MEM_BASE + 0x1400 + 0x04)) #define OS_FIRMWARE (*(volatile u32*)(MEM_BASE + 0x1400 + 0x04))
#define OS_SPECIFICS ((OsSpecifics*)(MEM_BASE + 0x1500))
#ifndef EXIT_SUCCESS #ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
#endif #endif

View File

@ -26,9 +26,9 @@ ContentSettings::ContentSettings():ContentTemplate()
, touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH) , touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH)
, wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A) , wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A)
, languageSelectBox("",NULL) , languageSelectBox("",NULL)
, rumbleSwitch(CSettings::instance()->getValueAsBool(CSettings::RumbleActivated),2.0f) , rumbleSwitch(CSettings::instance()->getValueAsBool(CSettings::RumbleActivated))
, musicSwitch(CSettings::instance()->getValueAsBool(CSettings::MusicActivated),2.0f) , musicSwitch(CSettings::instance()->getValueAsBool(CSettings::MusicActivated))
, networkControllerSwitch(CSettings::instance()->getValueAsBool(CSettings::NetworkControllerActivated),4.0f) , networkControllerSwitch(CSettings::instance()->getValueAsBool(CSettings::NetworkControllerActivated))
, buttonClickSound(Resources::GetSound("settings_click_2.mp3")) , buttonClickSound(Resources::GetSound("settings_click_2.mp3"))
{ {
headLine.setText(gettext("Settings")); headLine.setText(gettext("Settings"));
@ -43,6 +43,10 @@ ContentSettings::ContentSettings():ContentTemplate()
settingsFrame.setSize(getWidth(),getHeight()); settingsFrame.setSize(getWidth(),getHeight());
append(&settingsFrame); append(&settingsFrame);
rumbleSwitch.setScale(2.0f);
musicSwitch.setScale(2.0f);
networkControllerSwitch.setScale(2.0f);
settings[gettext("Language")] = &languageSelectBox; settings[gettext("Language")] = &languageSelectBox;
settings[gettext("Rumble")] = &rumbleSwitch; settings[gettext("Rumble")] = &rumbleSwitch;
settings[gettext("Music")] = &musicSwitch; settings[gettext("Music")] = &musicSwitch;

View File

@ -24,6 +24,7 @@
#include "mygui/DefaultGuiCheckBox.h" #include "mygui/DefaultGuiCheckBox.h"
#include "mygui/DefaultGuiSwitch.h" #include "mygui/DefaultGuiSwitch.h"
#include "mygui/DefaultSelectBox.h"
#include "ContentTemplate.h" #include "ContentTemplate.h"
class ContentSettings : public ContentTemplate{ class ContentSettings : public ContentTemplate{
@ -34,7 +35,7 @@ public:
private: private:
GuiTrigger touchTrigger; GuiTrigger touchTrigger;
GuiTrigger wpadTouchTrigger; GuiTrigger wpadTouchTrigger;
GuiSelectBox languageSelectBox; DefaultSelectBox languageSelectBox;
std::map<std::string,std::string> languagesNames; std::map<std::string,std::string> languagesNames;
@ -44,7 +45,7 @@ private:
DefaultGuiSwitch rumbleSwitch; DefaultGuiSwitch rumbleSwitch;
DefaultGuiSwitch musicSwitch; DefaultGuiSwitch musicSwitch;
DefaultGuiCheckBox networkControllerSwitch; DefaultGuiSwitch networkControllerSwitch;
GuiSound *buttonClickSound; GuiSound *buttonClickSound;

View File

@ -19,7 +19,7 @@
* Constructor for the DefaultGuiCheckBox class. * Constructor for the DefaultGuiCheckBox class.
*/ */
DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked,f32 scale) DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked)
: GuiCheckBox(checked) : GuiCheckBox(checked)
,checkbox_imgdata(Resources::GetImageData("checkbox.png")) ,checkbox_imgdata(Resources::GetImageData("checkbox.png"))
,checkbox_img(checkbox_imgdata) ,checkbox_img(checkbox_imgdata)
@ -28,9 +28,7 @@ DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked,f32 scale)
,highlighted_imgdata(Resources::GetImageData("checkbox_highlighted.png")) ,highlighted_imgdata(Resources::GetImageData("checkbox_highlighted.png"))
,highlighted_img(highlighted_imgdata) ,highlighted_img(highlighted_imgdata)
{ {
setScale(scale); setSize(checkbox_img.getWidth(),checkbox_img.getHeight());
setSize(checkbox_img.getWidth(),
checkbox_img.getHeight());
this->setImageBackground(&checkbox_img); this->setImageBackground(&checkbox_img);
this->setImageSelected(&checkbox_selected_img); this->setImageSelected(&checkbox_selected_img);
this->setImageHighlighted(&highlighted_img); this->setImageHighlighted(&highlighted_img);

View File

@ -24,7 +24,7 @@ class DefaultGuiCheckBox : public GuiCheckBox{
public: public:
//!Constructor //!Constructor
//!\param checked Checked //!\param checked Checked
DefaultGuiCheckBox(bool checked,f32 scale = 1.0f); DefaultGuiCheckBox(bool checked);
//!Destructor //!Destructor
virtual ~DefaultGuiCheckBox(); virtual ~DefaultGuiCheckBox();
protected: protected:

View File

@ -19,7 +19,7 @@
* Constructor for the DefaultGuiSwitch class. * Constructor for the DefaultGuiSwitch class.
*/ */
DefaultGuiSwitch::DefaultGuiSwitch(bool checked,f32 scale) DefaultGuiSwitch::DefaultGuiSwitch(bool checked)
: GuiSwitch(checked) : GuiSwitch(checked)
,switchbase_imgdata(Resources::GetImageData("switchIconBase.png")) ,switchbase_imgdata(Resources::GetImageData("switchIconBase.png"))
,switchbase_img(switchbase_imgdata) ,switchbase_img(switchbase_imgdata)
@ -30,9 +30,7 @@ DefaultGuiSwitch::DefaultGuiSwitch(bool checked,f32 scale)
,switchOff_imgdata(Resources::GetImageData("switchIconOff.png")) ,switchOff_imgdata(Resources::GetImageData("switchIconOff.png"))
,switchOff_img(switchOff_imgdata) ,switchOff_img(switchOff_imgdata)
{ {
setScale(scale); setSize(switchbase_img.getWidth(),switchbase_img.getHeight());
setSize(switchbase_img.getWidth(),
switchbase_img.getHeight());
this->setImageBackground(&switchbase_img); this->setImageBackground(&switchbase_img);
this->setImageHighlighted(&switchbase_highlighted_img); this->setImageHighlighted(&switchbase_highlighted_img);
this->setImageOn(&switchOn_img); this->setImageOn(&switchOn_img);

View File

@ -25,7 +25,7 @@ class DefaultGuiSwitch : public GuiSwitch
public: public:
//!Constructor //!Constructor
//!\param checked Checked //!\param checked Checked
DefaultGuiSwitch(bool checked,f32 scale = 1.0f); DefaultGuiSwitch(bool checked);
//!Destructor //!Destructor
virtual ~DefaultGuiSwitch(); virtual ~DefaultGuiSwitch();

View File

@ -0,0 +1,52 @@
/****************************************************************************
* Copyright (C) 2017 Maschell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "DefaultSelectBox.h"
/**
* Constructor for the DefaultSelectBox class.
*/
DefaultSelectBox::DefaultSelectBox(std::string caption, GuiFrame *parent)
: GuiSelectBox(caption,parent)
,topBackgroundImg_imgdata(Resources::GetImageData("gameSettingsButton.png"))
,topBackgroundImg_img(topBackgroundImg_imgdata)
,topHighlightedImg_imgdata(Resources::GetImageData("gameSettingsButtonSelected.png"))
,topHighlightedImg_img(topHighlightedImg_imgdata)
,valueImageData(Resources::GetImageData("gameSettingsButtonEx.png"))
,valueSelectedImageData(Resources::GetImageData("gameSettingsButtonExSelected.png"))
,valueHighlightedImageData(Resources::GetImageData("gameSettingsButtonExHighlighted.png"))
,buttonClickSound(Resources::GetSound("settings_click_2.mp3"))
{
setSize(topBackgroundImg_img.getWidth(),topBackgroundImg_img.getHeight());
this->setImageTopBackground(&topBackgroundImg_img);
this->setImageTopHighlighted(&topHighlightedImg_img);
this->setImageValueBackground(valueImageData);
this->setImageValueHighlighted(valueHighlightedImageData);
this->setImageValueSelected(valueSelectedImageData);
this->setSoundClick(buttonClickSound);
}
/**
* Destructor for the DefaultSelectBox class.
*/
DefaultSelectBox::~DefaultSelectBox()
{
Resources::RemoveImageData(topBackgroundImg_imgdata);
Resources::RemoveImageData(topHighlightedImg_imgdata);
Resources::RemoveImageData(valueImageData);
Resources::RemoveImageData(valueSelectedImageData);
Resources::RemoveImageData(valueHighlightedImageData);
Resources::RemoveSound(buttonClickSound);
}

View File

@ -0,0 +1,45 @@
/****************************************************************************
* Copyright (C) 2017 Maschell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef DEFAULT_GUI_SELECTBOX_H_
#define DEFAULT_GUI_SELECTBOX_H_
#include <gui/GuiSelectBox.h>
//!A simple select box with default values.
class DefaultSelectBox : public GuiSelectBox{
public:
//!Constructor
//!\param checked Checked
DefaultSelectBox(std::string caption, GuiFrame *parent = NULL);
//!Destructor
virtual ~DefaultSelectBox();
protected:
GuiImageData * topBackgroundImg_imgdata;
GuiImage topBackgroundImg_img;
GuiImageData * topHighlightedImg_imgdata;
GuiImage topHighlightedImg_img;
GuiImageData * valueImageData;
GuiImageData * valueSelectedImageData;
GuiImageData * valueHighlightedImageData;
GuiSound * buttonClickSound;
};
#endif