mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
See desc for more.
1.) Fix Themes touch position. 2.) Properly detect if battery is full charged using `PTMU_GetAdapterState()` and `PTMU_GetBatteryChargeState()` together.
This commit is contained in:
+5
-2
@@ -165,11 +165,14 @@ static int blinkDelay = 40;
|
||||
static bool blinkState = true, batteryLow = false;
|
||||
void GFX::DrawBattery() {
|
||||
u8 chargeState = false, level = 0;
|
||||
bool chargerPlugged = false;
|
||||
|
||||
PTMU_GetBatteryChargeState(&chargeState); // Get Charge state.
|
||||
PTMU_GetBatteryLevel(&level); // Get Battery Level.
|
||||
PTMU_GetAdapterState(&chargerPlugged); // Get if charger adapter is plugged.
|
||||
|
||||
if (chargeState) {
|
||||
GFX::DrawSprite((level < 5 ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1);
|
||||
if (chargerPlugged) {
|
||||
GFX::DrawSprite((chargeState ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1);
|
||||
if (batteryLow) batteryLow = false; // Cause we're charging.
|
||||
|
||||
} else {
|
||||
|
||||
@@ -78,7 +78,7 @@ static const std::vector<Structs::ButtonPos> dirIcons = {
|
||||
};
|
||||
|
||||
static const Structs::ButtonPos back = { 45, 0, 24, 24 }; // Back arrow for directory.
|
||||
static const Structs::ButtonPos Themes = { 40, 220, 280, 24 }; // Themes.
|
||||
static const Structs::ButtonPos Themes = { 40, 196, 280, 24 }; // Themes.
|
||||
|
||||
|
||||
static const std::vector<std::string> mainStrings = { "LANGUAGE", "SELECT_UNISTORE", "AUTO_UPDATE_SETTINGS_BTN", "GUI_SETTINGS_BTN", "DIRECTORY_SETTINGS_BTN", "CREDITS", "EXIT_APP" };
|
||||
|
||||
Reference in New Issue
Block a user