Skip to content

Commit

Permalink
HOS 15 Full Support
Browse files Browse the repository at this point in the history
  • Loading branch information
proferabg committed Oct 21, 2022
1 parent 1f75698 commit b7bd6a3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

APP_TITLE := EdiZon
APP_AUTHOR := WerWolv & proferabg
APP_VERSION := v1.0.2d
APP_VERSION := v1.0.3

TARGET := EdiZon
OUTDIR := out
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ Continued Support by proferabg
<br />
<br />

# Latest Changelog - v1.0.2d
# Latest Changelog - v1.0.3

Support for HOS 15.0.0
<br />

# Known Issues

* Wifi Signal will no longer display on HOS versions 15+
Full HOS 15 Support
Displays Connection Status instead of WiFi Signal in System Information on HOS versions 15+
<br />

# How To Use Submenus
Expand Down
44 changes: 35 additions & 9 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ class GuiStats : public tsl::Gui {
auto rootFrame = new tsl::elm::OverlayFrame("EdiZon", "System Information");

auto infos = new tsl::elm::CustomDrawer([this](tsl::gfx::Renderer *renderer, u16 x, u16 y, u16 w, u16 h){

renderer->drawString("CPU Temparature:", false, 45, 160, 18, renderer->a(tsl::style::color::ColorText));
renderer->drawString("PCB Temparature:", false, 45, 190, 18, renderer->a(tsl::style::color::ColorText));

Expand All @@ -200,7 +199,6 @@ class GuiStats : public tsl::Gui {

renderer->drawRect(x, 303, w, 1, renderer->a(tsl::style::color::ColorFrame));
renderer->drawString("Local IP:", false, 45, 330, 18, renderer->a(tsl::style::color::ColorText));
renderer->drawString("WiFi Signal:", false, 45, 360, 18, renderer->a(tsl::style::color::ColorText));

s32 temparature = 0;
if(hosversionAtLeast(14,0,0)){
Expand Down Expand Up @@ -236,12 +234,37 @@ class GuiStats : public tsl::Gui {
else
renderer->drawString(this->m_ipAddressString.c_str(), false, 240, 330, 18, renderer->a(tsl::style::color::ColorHighlight));

s32 signalStrength = 0;
wlaninfGetRSSI(&signalStrength);
if(hosversionAtLeast(15,0,0)){
NifmInternetConnectionType conType;
u32 wifiStrength;
NifmInternetConnectionStatus conStatus;
nifmGetInternetConnectionStatus(&conType, &wifiStrength, &conStatus);
renderer->drawString("Connection:", false, 45, 360, 18, renderer->a(tsl::style::color::ColorText));
if(conStatus == NifmInternetConnectionStatus_Connected && conType == NifmInternetConnectionType_WiFi) {
std::string wifiStrengthStr = "(Strong)";
tsl::Color color = tsl::Color(0x0, 0xF, 0x0, 0xF);
if(wifiStrength == 2){
wifiStrengthStr = "(Fair)";
color = tsl::Color(0xE, 0xE, 0x2, 0xF);
} else if(wifiStrength <= 1){
wifiStrengthStr = "(Poor)";
color = tsl::Color(0xF, 0x0, 0x0, 0xF);
}
renderer->drawString("WiFi", false, 240, 360, 18, renderer->a(tsl::style::color::ColorHighlight));
renderer->drawString(wifiStrengthStr.c_str(), false, 285, 360, 18, renderer->a(color));
} else if(conStatus == NifmInternetConnectionStatus_Connected && conType == NifmInternetConnectionType_Ethernet){
renderer->drawString("Ethernet", false, 240, 360, 18, renderer->a(tsl::style::color::ColorHighlight));
} else {
renderer->drawString("Disconnected", false, 240, 360, 18, renderer->a(tsl::style::color::ColorHighlight));
}
} else {
s32 signalStrength = 0;
wlaninfGetRSSI(&signalStrength);

renderer->drawString(formatString("%d dBm", signalStrength).c_str(), false, 240, 360, 18, renderer->a(tsl::style::color::ColorHighlight));
renderer->drawString("WiFi Signal:", false, 45, 360, 18, renderer->a(tsl::style::color::ColorText));
renderer->drawString(formatString("%d dBm", signalStrength).c_str(), false, 240, 360, 18, renderer->a(tsl::style::color::ColorHighlight));
}
});

rootFrame->setContent(infos);

return rootFrame;
Expand All @@ -265,7 +288,7 @@ class GuiMain : public tsl::Gui {
auto *rootFrame = new tsl::elm::HeaderOverlayFrame();
rootFrame->setHeader(new tsl::elm::CustomDrawer([this](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) {
renderer->drawString("EdiZon", false, 20, 50, 30, renderer->a(tsl::style::color::ColorText));
renderer->drawString("v1.0.2d", false, 20, 70, 15, renderer->a(tsl::style::color::ColorDescription));
renderer->drawString("v1.0.3", false, 20, 70, 15, renderer->a(tsl::style::color::ColorDescription));

if (edz::cheat::CheatManager::getProcessID() != 0) {
renderer->drawString("Program ID:", false, 150, 40, 15, renderer->a(tsl::style::color::ColorText));
Expand All @@ -280,7 +303,7 @@ class GuiMain : public tsl::Gui {
auto list = new tsl::elm::List();

auto cheatsItem = new tsl::elm::ListItem("Cheats");
auto statsItem = new tsl::elm::ListItem("System information");
auto statsItem = new tsl::elm::ListItem("System Information");
cheatsItem->setClickListener([](s64 keys) {
if (keys & HidNpadButton_A) {
tsl::changeTo<GuiCheats>("");
Expand Down Expand Up @@ -324,7 +347,9 @@ class EdiZonOverlay : public tsl::Overlay {
dmntchtInitialize();
edz::cheat::CheatManager::initialize();
tsInitialize();
if (!hosversionAtLeast(15,0,0)) {
if (hosversionAtLeast(15,0,0)) {
nifmInitialize(NifmServiceType_User);
} else {
wlaninfInitialize();
}
clkrstInitialize();
Expand All @@ -337,6 +362,7 @@ class EdiZonOverlay : public tsl::Overlay {
edz::cheat::CheatManager::exit();
tsExit();
wlaninfExit();
nifmExit();
clkrstExit();
pcvExit();
}
Expand Down

0 comments on commit b7bd6a3

Please sign in to comment.