sysclk: merge info/about gui
This commit is contained in:
@@ -18,9 +18,12 @@
|
||||
#include <tesla.hpp>
|
||||
#include <string>
|
||||
|
||||
tsl::elm::ListItem* SpeedoItem = NULL;
|
||||
tsl::elm::ListItem* IddqItem = NULL;
|
||||
|
||||
AboutGui::AboutGui()
|
||||
{
|
||||
memset(strings, 0, sizeof(strings));
|
||||
}
|
||||
|
||||
AboutGui::~AboutGui()
|
||||
@@ -29,6 +32,22 @@ AboutGui::~AboutGui()
|
||||
|
||||
void AboutGui::listUI()
|
||||
{
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::CategoryHeader("Speedo/IDDQ")
|
||||
);
|
||||
|
||||
SpeedoItem =
|
||||
new tsl::elm::ListItem("Speedos:");
|
||||
this->listElement->addItem(SpeedoItem);
|
||||
|
||||
IddqItem =
|
||||
new tsl::elm::ListItem("IDDQ:");
|
||||
this->listElement->addItem(IddqItem);
|
||||
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::CategoryHeader("Credits")
|
||||
);
|
||||
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::CategoryHeader("Developers")
|
||||
);
|
||||
@@ -154,8 +173,7 @@ void AboutGui::listUI()
|
||||
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::ListItem("The Switch Homebrew Community")
|
||||
);
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
void AboutGui::update()
|
||||
@@ -169,7 +187,11 @@ void AboutGui::refresh()
|
||||
|
||||
if (!this->context)
|
||||
return;
|
||||
|
||||
// Format strings once per refresh
|
||||
sprintf(strings[0], "%u/%u/%u", this->context->speedos[HorizonOCSpeedo_CPU], this->context->speedos[HorizonOCSpeedo_GPU], this->context->speedos[HorizonOCSpeedo_SOC]);
|
||||
sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]);
|
||||
SpeedoItem->setValue(strings[0]);
|
||||
IddqItem->setValue(strings[1]);
|
||||
}
|
||||
/*
|
||||
## Credits
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
class AboutGui : public BaseMenuGui
|
||||
{
|
||||
protected:
|
||||
// char strings[32][32]; // Pre-formatted strings
|
||||
char strings[32][32]; // Pre-formatted strings
|
||||
|
||||
public:
|
||||
AboutGui();
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Souldbminer and Horizon OC Contributors
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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 "info_gui.h"
|
||||
#include "../format.h"
|
||||
#include <tesla.hpp>
|
||||
#include <string>
|
||||
|
||||
tsl::elm::ListItem* SpeedoItem;
|
||||
tsl::elm::ListItem* IddqItem;
|
||||
|
||||
InfoGui::InfoGui()
|
||||
{
|
||||
// Initialize display strings
|
||||
memset(strings, 0, sizeof(strings));
|
||||
}
|
||||
|
||||
InfoGui::~InfoGui()
|
||||
{
|
||||
}
|
||||
|
||||
void InfoGui::listUI()
|
||||
{
|
||||
SpeedoItem =
|
||||
new tsl::elm::ListItem("Speedos:");
|
||||
this->listElement->addItem(SpeedoItem);
|
||||
|
||||
IddqItem =
|
||||
new tsl::elm::ListItem("IDDQ:");
|
||||
this->listElement->addItem(IddqItem);
|
||||
|
||||
}
|
||||
|
||||
void InfoGui::update()
|
||||
{
|
||||
BaseMenuGui::update();
|
||||
}
|
||||
|
||||
void InfoGui::refresh()
|
||||
{
|
||||
BaseMenuGui::refresh();
|
||||
|
||||
if (!this->context)
|
||||
return;
|
||||
|
||||
// Format strings once per refresh
|
||||
sprintf(strings[0], "%u/%u/%u", this->context->speedos[HorizonOCSpeedo_CPU], this->context->speedos[HorizonOCSpeedo_GPU], this->context->speedos[HorizonOCSpeedo_SOC]);
|
||||
sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]);
|
||||
SpeedoItem->setValue(strings[0]);
|
||||
IddqItem->setValue(strings[1]);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Souldbminer and Horizon OC Contributors
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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/>.
|
||||
*/
|
||||
#pragma once
|
||||
#include "../../ipc.h"
|
||||
#include "base_menu_gui.h"
|
||||
#include "freq_choice_gui.h"
|
||||
#include "value_choice_gui.h"
|
||||
#include "fatal_gui.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class InfoGui : public BaseMenuGui
|
||||
{
|
||||
protected:
|
||||
char strings[32][32]; // Pre-formatted strings
|
||||
|
||||
public:
|
||||
InfoGui();
|
||||
~InfoGui();
|
||||
|
||||
void listUI() override;
|
||||
void update() override;
|
||||
void refresh() override;
|
||||
};
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "app_profile_gui.h"
|
||||
#include "global_override_gui.h"
|
||||
#include "misc_gui.h"
|
||||
#include "info_gui.h"
|
||||
#include "about_gui.h"
|
||||
|
||||
void MainGui::listUI()
|
||||
@@ -98,20 +97,7 @@ void MainGui::listUI()
|
||||
|
||||
return false;
|
||||
});
|
||||
this->listElement->addItem(miscItem);
|
||||
#if IS_MINIMAL == 0
|
||||
tsl::elm::ListItem* infoItem = new tsl::elm::ListItem("Information");
|
||||
infoItem->setClickListener([this](u64 keys) {
|
||||
if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)
|
||||
{
|
||||
tsl::changeTo<InfoGui>();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
this->listElement->addItem(infoItem);
|
||||
#endif
|
||||
tsl::elm::ListItem* aboutItem = new tsl::elm::ListItem("About");
|
||||
aboutItem->setClickListener([this](u64 keys) {
|
||||
if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)
|
||||
|
||||
Reference in New Issue
Block a user