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"
msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:46
#: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:50
#: src/menu/drc/content/ContentSettings.cpp:55
msgid "Language"
msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:47
#: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:51
#: src/menu/drc/content/ContentSettings.cpp:56
msgid "Rumble"
msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:48
#: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:52
#: src/menu/drc/content/ContentSettings.cpp:57
msgid "Music"
msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:49
#: src/menu/drc/content/ContentSettings.cpp:54
#: src/menu/drc/content/ContentSettings.cpp:53
#: src/menu/drc/content/ContentSettings.cpp:58
msgid "Network Controller"
msgstr ""
#: src/menu/drc/content/ContentSettings.cpp:75
#: src/menu/drc/content/ContentSettings.cpp:79
msgid "<Default>"
msgstr ""

View File

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

View File

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

View File

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

View File

@ -11,20 +11,11 @@ extern "C" {
#define SD_PATH "sd:"
#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_SIZE (*(volatile u32*)(MEM_BASE + 0x1300 + 0x04))
#define MAIN_ENTRY_ADDR (*(volatile u32*)(MEM_BASE + 0x1400 + 0x00))
#define OS_FIRMWARE (*(volatile u32*)(MEM_BASE + 0x1400 + 0x04))
#define OS_SPECIFICS ((OsSpecifics*)(MEM_BASE + 0x1500))
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif

View File

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

View File

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

View File

@ -19,7 +19,7 @@
* Constructor for the DefaultGuiCheckBox class.
*/
DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked,f32 scale)
DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked)
: GuiCheckBox(checked)
,checkbox_imgdata(Resources::GetImageData("checkbox.png"))
,checkbox_img(checkbox_imgdata)
@ -28,9 +28,7 @@ DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked,f32 scale)
,highlighted_imgdata(Resources::GetImageData("checkbox_highlighted.png"))
,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->setImageSelected(&checkbox_selected_img);
this->setImageHighlighted(&highlighted_img);

View File

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

View File

@ -19,7 +19,7 @@
* Constructor for the DefaultGuiSwitch class.
*/
DefaultGuiSwitch::DefaultGuiSwitch(bool checked,f32 scale)
DefaultGuiSwitch::DefaultGuiSwitch(bool checked)
: GuiSwitch(checked)
,switchbase_imgdata(Resources::GetImageData("switchIconBase.png"))
,switchbase_img(switchbase_imgdata)
@ -30,9 +30,7 @@ DefaultGuiSwitch::DefaultGuiSwitch(bool checked,f32 scale)
,switchOff_imgdata(Resources::GetImageData("switchIconOff.png"))
,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->setImageHighlighted(&switchbase_highlighted_img);
this->setImageOn(&switchOn_img);

View File

@ -25,7 +25,7 @@ class DefaultGuiSwitch : public GuiSwitch
public:
//!Constructor
//!\param checked Checked
DefaultGuiSwitch(bool checked,f32 scale = 1.0f);
DefaultGuiSwitch(bool checked);
//!Destructor
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