diff --git a/languages/BR_Portuguese.lang b/languages/BR_Portuguese.lang index 3cf0a97..ef1c971 100644 --- a/languages/BR_Portuguese.lang +++ b/languages/BR_Portuguese.lang @@ -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 "" msgstr "" diff --git a/languages/english.lang b/languages/english.lang index dd5fc52..16da705 100644 --- a/languages/english.lang +++ b/languages/english.lang @@ -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 "" msgstr "" diff --git a/languages/french.lang b/languages/french.lang index 3e79fa3..25cc4e9 100644 --- a/languages/french.lang +++ b/languages/french.lang @@ -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 "" msgstr "" diff --git a/languages/german.lang b/languages/german.lang index dd75e08..8c5ad30 100644 --- a/languages/german.lang +++ b/languages/german.lang @@ -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 "" msgstr "" diff --git a/languages/italian.lang b/languages/italian.lang index 3be82db..285368c 100644 --- a/languages/italian.lang +++ b/languages/italian.lang @@ -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 "" msgstr "" diff --git a/languages/spanish.lang b/languages/spanish.lang index 04540ec..5f841b8 100644 --- a/languages/spanish.lang +++ b/languages/spanish.lang @@ -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 "" msgstr "" diff --git a/src/common/common.h b/src/common/common.h index beb4566..b7f38a9 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -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 diff --git a/src/menu/drc/content/ContentSettings.cpp b/src/menu/drc/content/ContentSettings.cpp index ea21704..ce5fb98 100644 --- a/src/menu/drc/content/ContentSettings.cpp +++ b/src/menu/drc/content/ContentSettings.cpp @@ -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; diff --git a/src/menu/drc/content/ContentSettings.h b/src/menu/drc/content/ContentSettings.h index 64842e5..90a8721 100644 --- a/src/menu/drc/content/ContentSettings.h +++ b/src/menu/drc/content/ContentSettings.h @@ -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 languagesNames; @@ -44,7 +45,7 @@ private: DefaultGuiSwitch rumbleSwitch; DefaultGuiSwitch musicSwitch; - DefaultGuiCheckBox networkControllerSwitch; + DefaultGuiSwitch networkControllerSwitch; GuiSound *buttonClickSound; diff --git a/src/mygui/DefaultGuiCheckBox.cpp b/src/mygui/DefaultGuiCheckBox.cpp index 2deec6d..3ff7726 100644 --- a/src/mygui/DefaultGuiCheckBox.cpp +++ b/src/mygui/DefaultGuiCheckBox.cpp @@ -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); diff --git a/src/mygui/DefaultGuiCheckBox.h b/src/mygui/DefaultGuiCheckBox.h index 32610e5..0683e25 100644 --- a/src/mygui/DefaultGuiCheckBox.h +++ b/src/mygui/DefaultGuiCheckBox.h @@ -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: diff --git a/src/mygui/DefaultGuiSwitch.cpp b/src/mygui/DefaultGuiSwitch.cpp index 8f77cd4..6a18b48 100644 --- a/src/mygui/DefaultGuiSwitch.cpp +++ b/src/mygui/DefaultGuiSwitch.cpp @@ -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); diff --git a/src/mygui/DefaultGuiSwitch.h b/src/mygui/DefaultGuiSwitch.h index 85f39d8..acebbe3 100644 --- a/src/mygui/DefaultGuiSwitch.h +++ b/src/mygui/DefaultGuiSwitch.h @@ -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(); diff --git a/src/mygui/DefaultSelectBox.cpp b/src/mygui/DefaultSelectBox.cpp new file mode 100644 index 0000000..72c2b31 --- /dev/null +++ b/src/mygui/DefaultSelectBox.cpp @@ -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 . + ****************************************************************************/ +#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); +} diff --git a/src/mygui/DefaultSelectBox.h b/src/mygui/DefaultSelectBox.h new file mode 100644 index 0000000..b6a2de0 --- /dev/null +++ b/src/mygui/DefaultSelectBox.h @@ -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 . + ****************************************************************************/ +#ifndef DEFAULT_GUI_SELECTBOX_H_ +#define DEFAULT_GUI_SELECTBOX_H_ + +#include + +//!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