mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Some, uhh.. changes?
This commit is contained in:
+23
-66
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
* Copyright (C) 2019-2020 Universal-Team
|
||||
*
|
||||
* 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
|
||||
@@ -29,50 +29,27 @@
|
||||
|
||||
extern std::unique_ptr<Config> config;
|
||||
extern bool isScriptSelected;
|
||||
extern u32 barColor;
|
||||
extern u32 bgTopColor;
|
||||
extern u32 bgBottomColor;
|
||||
extern u32 TextColor;
|
||||
extern u32 barColor, bgTopColor, bgBottomColor, TextColor;
|
||||
|
||||
void GFX::DrawTop(void) {
|
||||
Gui::ScreenDraw(Top);
|
||||
if (isScriptSelected == false) {
|
||||
Gui::Draw_Rect(0, 0, 400, 25, config->barColor());
|
||||
Gui::Draw_Rect(0, 25, 400, 190, config->topBG());
|
||||
Gui::Draw_Rect(0, 215, 400, 25, config->barColor());
|
||||
if (config->useBars() == true) {
|
||||
DrawSprite(sprites_top_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_top_screen_bot_idx, 0, 215);
|
||||
}
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::Draw_Rect(0, 0, 400, 30, barColor);
|
||||
Gui::Draw_Rect(0, 25, 400, 190, bgBottomColor);
|
||||
Gui::Draw_Rect(0, 215, 400, 25, barColor);
|
||||
if (config->useBars() == true) {
|
||||
DrawSprite(sprites_top_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_top_screen_bot_idx, 0, 215);
|
||||
}
|
||||
Gui::Draw_Rect(0, 0, 400, 25, isScriptSelected ? barColor : config->barColor());
|
||||
Gui::Draw_Rect(0, 25, 400, 190, isScriptSelected ? bgTopColor : config->topBG());
|
||||
Gui::Draw_Rect(0, 215, 400, 25, isScriptSelected ? barColor : config->barColor());
|
||||
if (config->useBars()) {
|
||||
DrawSprite(sprites_top_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_top_screen_bot_idx, 0, 215);
|
||||
}
|
||||
}
|
||||
|
||||
void GFX::DrawBottom(void) {
|
||||
Gui::ScreenDraw(Bottom);
|
||||
if (isScriptSelected == false) {
|
||||
Gui::Draw_Rect(0, 0, 320, 25, config->barColor());
|
||||
Gui::Draw_Rect(0, 25, 320, 190, config->bottomBG());
|
||||
Gui::Draw_Rect(0, 215, 320, 25, config->barColor());
|
||||
if (config->useBars() == true) {
|
||||
DrawSprite(sprites_bottom_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_bottom_screen_bot_idx, 0, 215);
|
||||
}
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::Draw_Rect(0, 0, 320, 30, barColor);
|
||||
Gui::Draw_Rect(0, 25, 320, 190, bgBottomColor);
|
||||
Gui::Draw_Rect(0, 215, 320, 25, barColor);
|
||||
if (config->useBars() == true) {
|
||||
DrawSprite(sprites_bottom_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_bottom_screen_bot_idx, 0, 215);
|
||||
}
|
||||
Gui::Draw_Rect(0, 0, 320, 25, isScriptSelected ? barColor : config->barColor());
|
||||
Gui::Draw_Rect(0, 25, 320, 190, isScriptSelected ? bgBottomColor : config->bottomBG());
|
||||
Gui::Draw_Rect(0, 215, 320, 25, isScriptSelected ? barColor : config->barColor());
|
||||
if (config->useBars()) {
|
||||
DrawSprite(sprites_bottom_screen_top_idx, 0, 0);
|
||||
DrawSprite(sprites_bottom_screen_bot_idx, 0, 215);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,17 +61,10 @@ void GFX::DrawSprite(int img, int x, int y, float ScaleX, float ScaleY) {
|
||||
|
||||
void GFX::DrawSpriteBlend(int img, int x, int y, float ScaleX, float ScaleY) {
|
||||
C2D_ImageTint tint;
|
||||
if (isScriptSelected) {
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, TextColor, 0.5);
|
||||
} else {
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, config->textColor(), 0.5);
|
||||
}
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
|
||||
C2D_DrawImageAt(C2D_SpriteSheetGetImage(sprites, img), x, y, 0.5f, &tint, ScaleX, ScaleY);
|
||||
}
|
||||
@@ -102,17 +72,10 @@ void GFX::DrawSpriteBlend(int img, int x, int y, float ScaleX, float ScaleY) {
|
||||
void GFX::DrawArrow(int x, int y, float rotation, int arrowSprite) {
|
||||
C2D_Sprite sprite;
|
||||
C2D_ImageTint tint;
|
||||
if (isScriptSelected) {
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, TextColor, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, TextColor, 0.5);
|
||||
} else {
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, config->textColor(), 0.5);
|
||||
}
|
||||
C2D_SetImageTint(&tint, C2D_TopLeft, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_TopRight, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, isScriptSelected ? TextColor : config->textColor(), 0.5);
|
||||
|
||||
if (arrowSprite == 0) {
|
||||
C2D_SpriteFromSheet(&sprite, sprites, sprites_arrow_idx);
|
||||
@@ -134,11 +97,5 @@ void GFX::DrawButton(int x, int y, std::string ButtonText, u32 color) {
|
||||
C2D_SetImageTint(&tint, C2D_BotLeft, color, 0.5);
|
||||
C2D_SetImageTint(&tint, C2D_BotRight, color, 0.5);
|
||||
C2D_DrawImageAt(C2D_SpriteSheetGetImage(sprites, sprites_button_idx), x, y, 0.5f, &tint);
|
||||
|
||||
// Draw String. TODO: Center.
|
||||
if (isScriptSelected) {
|
||||
Gui::DrawStringCentered(- (158/2) + x, y + (61/2) - (Gui::GetStringHeight(0.6f, ButtonText) / 2), 0.6f, TextColor, ButtonText, 145, 30);
|
||||
} else {
|
||||
Gui::DrawStringCentered(- (158/2) + x, y + (61/2) - (Gui::GetStringHeight(0.6f, ButtonText) / 2), 0.6f, config->textColor(), ButtonText, 145, 30);
|
||||
}
|
||||
Gui::DrawStringCentered(- (158/2) + x, y + (61/2) - (Gui::GetStringHeight(0.6f, ButtonText) / 2), 0.6f, isScriptSelected ? TextColor : config->textColor(), ButtonText, 145, 30);
|
||||
}
|
||||
+31
-5
@@ -1,3 +1,29 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 Universal-Team
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#include "config.hpp"
|
||||
#include "gfx.hpp"
|
||||
#include "gui.hpp"
|
||||
@@ -80,7 +106,7 @@ extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||
|
||||
|
||||
void Input::DrawNumpad() {
|
||||
for(uint i=0;i<(sizeof(NumpadStruct)/sizeof(NumpadStruct[0]));i++) {
|
||||
for(uint i = 0; i < (sizeof(NumpadStruct)/sizeof(NumpadStruct[0])); i++) {
|
||||
Gui::Draw_Rect(NumpadStruct[i].x, NumpadStruct[i].y, 60, 50, config->barColor());
|
||||
char c[2] = {NumpadStruct[i].character[0]};
|
||||
Gui::DrawString(NumpadStruct[i].x+25, NumpadStruct[i].y+15, 0.72f, config->textColor(), c, 50);
|
||||
@@ -88,7 +114,7 @@ void Input::DrawNumpad() {
|
||||
}
|
||||
|
||||
void Input::drawKeyboard() {
|
||||
for(uint i=0;i<(sizeof(keysQWERTY)/sizeof(keysQWERTY[0]));i++) {
|
||||
for(uint i = 0; i < (sizeof(keysQWERTY)/sizeof(keysQWERTY[0])); i++) {
|
||||
C2D_DrawRectSolid(keysQWERTY[i].x, keysQWERTY[i].y+103, 0.5f, 20, 20, config->barColor() & C2D_Color32(255, 255, 255, 200));
|
||||
if (shift) {
|
||||
char c[2] = {caps ? (char)toupper(keysQWERTYShift[i].character[0]) : keysQWERTYShift[i].character[0]};
|
||||
@@ -99,7 +125,7 @@ void Input::drawKeyboard() {
|
||||
}
|
||||
}
|
||||
|
||||
for(uint i=0;i<(sizeof(modifierKeys)/sizeof(modifierKeys[0]));i++) {
|
||||
for(uint i = 0; i < (sizeof(modifierKeys)/sizeof(modifierKeys[0])); i++) {
|
||||
std::string enter = modifierKeys[2].character;
|
||||
std::string arrowUp = modifierKeys[3].character;
|
||||
std::string backSpace = modifierKeys[0].character;
|
||||
@@ -234,7 +260,7 @@ std::string Input::getString(uint maxLength, std::string Text, float inputTextSi
|
||||
touchRead(&touch);
|
||||
if (string.length() < maxLength) {
|
||||
// Check if a regular key was pressed
|
||||
for(uint i=0;i<(sizeof(keysQWERTY)/sizeof(keysQWERTY[0]));i++) {
|
||||
for(uint i = 0; i < (sizeof(keysQWERTY)/sizeof(keysQWERTY[0])); i++) {
|
||||
if ((touch.px > keysQWERTY[i].x-2 && touch.px < keysQWERTY[i].x+18) && (touch.py > keysQWERTY[i].y+(103)-2 && touch.py < keysQWERTY[i].y+18+(103))) {
|
||||
char c = (shift ? keysQWERTYShift[i] : keysQWERTY[i]).character[0];
|
||||
string += (shift || caps ? toupper(c) : c);
|
||||
@@ -244,7 +270,7 @@ std::string Input::getString(uint maxLength, std::string Text, float inputTextSi
|
||||
}
|
||||
}
|
||||
// Check if a modifier key was pressed
|
||||
for(uint i=0;i<(sizeof(modifierKeys)/sizeof(modifierKeys[0]));i++) {
|
||||
for(uint i = 0; i < (sizeof(modifierKeys)/sizeof(modifierKeys[0])); i++) {
|
||||
if ((touch.px > modifierKeys[i].x-2 && touch.px < modifierKeys[i].x+modifierKeys[i].w+2) && (touch.py > modifierKeys[i].y+(103)-2 && touch.py < modifierKeys[i].y+18+(103))) {
|
||||
if (modifierKeys[i].character == "\uE071") {
|
||||
string = string.substr(0, string.length()-1);
|
||||
|
||||
+12
-37
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
* Copyright (C) 2019-2020 Universal-Team
|
||||
*
|
||||
* 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
|
||||
@@ -30,10 +30,7 @@
|
||||
extern std::unique_ptr<Config> config;
|
||||
extern bool isScriptSelected;
|
||||
|
||||
extern u32 barColor;
|
||||
extern u32 bgTopColor;
|
||||
extern u32 bgBottomColor;
|
||||
extern u32 TextColor;
|
||||
extern u32 barColor, bgTopColor, bgBottomColor, TextColor;
|
||||
|
||||
// I do not think we need that at all.
|
||||
void Msg::DisplayStartMSG() {
|
||||
@@ -61,12 +58,7 @@ void Msg::DisplayMsg(std::string text) {
|
||||
C2D_TargetClear(Top, BLACK);
|
||||
C2D_TargetClear(Bottom, BLACK);
|
||||
GFX::DrawTop();
|
||||
if (isScriptSelected == false) {
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, text))/2, 0.6f, config->textColor(), text, 395, 70);
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, text))/2, 0.6f, TextColor, text, 395, 70);
|
||||
}
|
||||
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, text))/2, 0.6f, isScriptSelected ? TextColor : config->textColor(), text, 395, 70);
|
||||
GFX::DrawBottom();
|
||||
C3D_FrameEnd(0);
|
||||
}
|
||||
@@ -77,12 +69,7 @@ void Msg::DisplayWarnMsg(std::string Text) {
|
||||
C2D_TargetClear(Top, BLACK);
|
||||
C2D_TargetClear(Bottom, BLACK);
|
||||
GFX::DrawTop();
|
||||
if (isScriptSelected == false) {
|
||||
Gui::DrawStringCentered(0, 1, 0.6f, config->textColor(), Text, 400);
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::DrawStringCentered(0, 1, 0.6f, TextColor, Text, 400);
|
||||
}
|
||||
|
||||
Gui::DrawStringCentered(0, 1, 0.6f, isScriptSelected ? TextColor : config->textColor(), Text, 400);
|
||||
GFX::DrawBottom();
|
||||
C3D_FrameEnd(0);
|
||||
for (int i = 0; i < 60*3; i++) {
|
||||
@@ -91,9 +78,9 @@ void Msg::DisplayWarnMsg(std::string Text) {
|
||||
}
|
||||
|
||||
|
||||
std::vector<Structs::ButtonPos> promptBtn = {
|
||||
const std::vector<Structs::ButtonPos> promptBtn = {
|
||||
{10, 100, 140, 35}, // Yes.
|
||||
{170, 100, 140, 35}, // No.
|
||||
{170, 100, 140, 35} // No.
|
||||
};
|
||||
|
||||
extern touchPosition touch;
|
||||
@@ -106,26 +93,14 @@ bool Msg::promptMsg(std::string promptMsg) {
|
||||
C2D_TargetClear(Top, BLACK);
|
||||
C2D_TargetClear(Bottom, BLACK);
|
||||
GFX::DrawTop();
|
||||
if (isScriptSelected == false) {
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, promptMsg))/2, 0.6f, config->textColor(), promptMsg, 395, 70);
|
||||
Gui::DrawStringCentered(0, 217, 0.72f, config->textColor(), Lang::get("CONFIRM_OR_CANCEL"), 400);
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, promptMsg))/2, 0.6f, TextColor, promptMsg, 395, 70);
|
||||
Gui::DrawStringCentered(0, 217, 0.72f, TextColor, Lang::get("CONFIRM_OR_CANCEL"), 400);
|
||||
}
|
||||
Gui::DrawStringCentered(0, (240-Gui::GetStringHeight(0.6f, promptMsg))/2, 0.6f, isScriptSelected ? TextColor : config->textColor(), promptMsg, 395, 70);
|
||||
Gui::DrawStringCentered(0, 217, 0.72f, isScriptSelected ? TextColor : config->textColor(), Lang::get("CONFIRM_OR_CANCEL"), 400);
|
||||
|
||||
GFX::DrawBottom();
|
||||
if (isScriptSelected == false) {
|
||||
Gui::Draw_Rect(10, 100, 140, 35, config->barColor());
|
||||
Gui::Draw_Rect(170, 100, 140, 35, config->barColor());
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("YES")))/2-150+70, 110, 0.6f, config->textColor(), Lang::get("YES"), 140);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("NO")))/2+150-70, 110, 0.6f, config->textColor(), Lang::get("NO"), 140);
|
||||
} else if (isScriptSelected == true) {
|
||||
Gui::Draw_Rect(10, 100, 140, 35, barColor);
|
||||
Gui::Draw_Rect(170, 100, 140, 35, barColor);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("YES")))/2-150+70, 110, 0.6f, TextColor, Lang::get("YES"), 140);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("NO")))/2+150-70, 110, 0.6f, TextColor, Lang::get("NO"), 140);
|
||||
}
|
||||
Gui::Draw_Rect(10, 100, 140, 35, isScriptSelected ? barColor : config->barColor());
|
||||
Gui::Draw_Rect(170, 100, 140, 35, isScriptSelected ? barColor : config->barColor());
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("YES")))/2-150+70, 110, 0.6f, isScriptSelected ? TextColor : config->textColor(), Lang::get("YES"), 140);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("NO")))/2+150-70, 110, 0.6f, isScriptSelected ? TextColor : config->textColor(), Lang::get("NO"), 140);
|
||||
|
||||
C3D_FrameEnd(0);
|
||||
while(1) {
|
||||
|
||||
Reference in New Issue
Block a user