mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-04 00:38:51 +00:00
Switch over to Universal-Core. (#18)
* Don't build here. * WIP: Switch to Universal-Core. * Update Submodule repo & azure-pipelines.
This commit is contained in:
@@ -1,59 +1,60 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef COLORS_HPP
|
||||
#define COLORS_HPP
|
||||
|
||||
#include <citro2d.h>
|
||||
#include <citro3d.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief Creates a 8 byte RGBA color
|
||||
* @param r red component of the color
|
||||
* @param g green component of the color
|
||||
* @param b blue component of the color
|
||||
* @param a alpha component of the color
|
||||
*/
|
||||
#define RGBA8(r, g, b, a) ((((r)&0xFF)<<0) | (((g)&0xFF)<<8) | (((b)&0xFF)<<16) | (((a)&0xFF)<<24))
|
||||
|
||||
#define BarColor C2D_Color32(57, 84, 114, 255)
|
||||
#define TopBGColor C2D_Color32(96, 168, 192, 255)
|
||||
#define BottomBGColor C2D_Color32(38, 44, 77, 255)
|
||||
#define SelectedColordefault C2D_Color32(120, 192, 216, 255)
|
||||
#define UnselectedColordefault C2D_Color32(77, 118, 132, 255)
|
||||
#define BLACK C2D_Color32(0, 0, 0, 255)
|
||||
#define WHITE C2D_Color32(255, 255, 255, 255)
|
||||
|
||||
typedef u32 Color;
|
||||
|
||||
namespace ColorHelper {
|
||||
int getColorValue(int color, int bgr);
|
||||
std::string getColorName(int color, int bgr);
|
||||
}
|
||||
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef COLORHELPER_HPP
|
||||
#define COLORHELPER_HPP
|
||||
|
||||
#include <citro2d.h>
|
||||
#include <citro3d.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief Creates a 8 byte RGBA color
|
||||
* @param r red component of the color
|
||||
* @param g green component of the color
|
||||
* @param b blue component of the color
|
||||
* @param a alpha component of the color
|
||||
*/
|
||||
#define RGBA8(r, g, b, a) ((((r)&0xFF)<<0) | (((g)&0xFF)<<8) | (((b)&0xFF)<<16) | (((a)&0xFF)<<24))
|
||||
|
||||
#define BarColor C2D_Color32(57, 84, 114, 255)
|
||||
#define TopBGColor C2D_Color32(96, 168, 192, 255)
|
||||
#define BottomBGColor C2D_Color32(38, 44, 77, 255)
|
||||
#define SelectedColordefault C2D_Color32(120, 192, 216, 255)
|
||||
#define UnselectedColordefault C2D_Color32(77, 118, 132, 255)
|
||||
#define BLACK C2D_Color32(0, 0, 0, 255)
|
||||
#define WHITE C2D_Color32(255, 255, 255, 255)
|
||||
#define TRANSPARENT C2D_Color32(0, 0, 0, 0)
|
||||
|
||||
typedef u32 Color;
|
||||
|
||||
namespace ColorHelper {
|
||||
int getColorValue(int color, int bgr);
|
||||
std::string getColorName(int color, int bgr);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,12 +24,13 @@
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef DOWNLOAD_HPP
|
||||
#define DOWNLOAD_HPP
|
||||
|
||||
#include "utils/common.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
#define APP_TITLE "Universal-Updater"
|
||||
#define VERSION_STRING "2.2.0"
|
||||
#define VERSION_STRING "2.2.1"
|
||||
|
||||
enum DownloadError {
|
||||
DL_ERROR_NONE = 0,
|
||||
@@ -86,4 +87,6 @@ std::string getLatestCommit(std::string repo, std::string item);
|
||||
* item is that to get from the API. (Ex. "message")
|
||||
* @return the string from the API.
|
||||
*/
|
||||
std::string getLatestCommit(std::string repo, std::string array, std::string item);
|
||||
std::string getLatestCommit(std::string repo, std::string array, std::string item);
|
||||
|
||||
#endif
|
||||
@@ -1,49 +1,46 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SCREEN_HPP
|
||||
#define SCREEN_HPP
|
||||
|
||||
#include <3ds.h>
|
||||
#include <memory>
|
||||
|
||||
class screen
|
||||
{
|
||||
public:
|
||||
virtual ~screen() {}
|
||||
virtual void Logic(u32 hDown, u32 hHeld, touchPosition touch) = 0;
|
||||
virtual void Draw() const = 0;
|
||||
private:
|
||||
};
|
||||
|
||||
namespace Screen {
|
||||
void set(std::unique_ptr<screen> screen2);
|
||||
void fade(std::unique_ptr<screen> screen2, bool fadeout = true);
|
||||
void back(void);
|
||||
void loop(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
}
|
||||
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef GFX_HPP
|
||||
#define GFX_HPP
|
||||
|
||||
#include "colorHelper.hpp"
|
||||
#include "gui.hpp"
|
||||
#include "sprites.h"
|
||||
|
||||
namespace GFX
|
||||
{
|
||||
// Basic GUI.
|
||||
void DrawTop(void);
|
||||
void DrawBottom(void);
|
||||
// Draw arrow.
|
||||
void DrawArrow(int x, int y, float rotation = 0, int arrowSprite = 0);
|
||||
// Draw Sprites.
|
||||
void DrawSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
|
||||
void DrawSpriteBlend(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef GUI_HPP
|
||||
#define GUI_HPP
|
||||
|
||||
#include "colors.hpp"
|
||||
#include "sprites.h"
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
|
||||
namespace Gui
|
||||
{
|
||||
// Init and Exit of the GUI.
|
||||
Result init(void);
|
||||
void exit(void);
|
||||
|
||||
C3D_RenderTarget* target(gfxScreen_t t);
|
||||
void setDraw(C3D_RenderTarget * screen);
|
||||
|
||||
// Clear Text.
|
||||
void clearTextBufs(void);
|
||||
|
||||
// Draw a Sprite from the sheet.
|
||||
void sprite(int key, int x, int y, float ScaleX = 1, float ScaleY = 1);
|
||||
void spriteBlend(int key, int x, int y, float ScaleX = 1, float ScaleY = 1);
|
||||
void DrawArrow(int x, int y, float rotation = 0, int arrowSprite = 0);
|
||||
void drawAnimatedSelector(float xPos, float yPos, float Width, float Height, float speed = .060, u32 colour = C2D_Color32(0, 0, 0, 0));
|
||||
|
||||
// Misc.
|
||||
bool Draw_Rect(float x, float y, float w, float h, u32 color);
|
||||
|
||||
// Text / String Functions.
|
||||
void DrawStringCentered(float x, float y, float size, u32 color, std::string Text, int maxWidth = 0);
|
||||
void DrawString(float x, float y, float size, u32 color, std::string Text, int maxWidth = 0);
|
||||
void GetStringSize(float size, float *width, float *height, std::string Text);
|
||||
float GetStringWidth(float size, std::string Text);
|
||||
float GetStringHeight(float size, std::string Text);
|
||||
|
||||
// Basic GUI.
|
||||
void DrawTop(void);
|
||||
void DrawBottom(void);
|
||||
|
||||
void DisplayWarnMsg(std::string Text);
|
||||
bool promptMsg(std::string promptMsg);
|
||||
}
|
||||
|
||||
void DisplayMsg(std::string text);
|
||||
|
||||
#endif
|
||||
@@ -1,52 +1,44 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef STRUCTS_HPP
|
||||
#define STRUCTS_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
class Structs
|
||||
{
|
||||
public:
|
||||
struct ButtonPos {
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
int link;
|
||||
};
|
||||
|
||||
struct Key {
|
||||
std::string character;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
};
|
||||
private:
|
||||
};
|
||||
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef INIT_HPP
|
||||
#define INIT_HPP
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
namespace Init {
|
||||
// Init, Mainloop & Exit.
|
||||
Result Initialize();
|
||||
Result MainLoop();
|
||||
Result Exit();
|
||||
|
||||
// Sound / Music stuff.
|
||||
void loadSoundEffects(void);
|
||||
void playMusic(void);
|
||||
void stopMusic(void);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef LANG_HPP
|
||||
#define LANG_HPP
|
||||
|
||||
#include "utils/json.hpp"
|
||||
#include "json.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -1,37 +1,39 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SCREENCOMMON_HPP
|
||||
#define SCREENCOMMON_HPP
|
||||
|
||||
#include "gui.hpp"
|
||||
|
||||
#include "lang/lang.hpp"
|
||||
|
||||
extern C3D_RenderTarget* top;
|
||||
extern C3D_RenderTarget* bottom;
|
||||
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019-2020 DeadPhoenix8091, Epicpkmn11, Flame, RocketRobz, StackZ, TotallyNotGuy
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef MSG_HPP
|
||||
#define MSG_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Msg
|
||||
{
|
||||
void DisplayMsg(std::string text);
|
||||
void DisplayWarnMsg(std::string Text);
|
||||
bool promptMsg(std::string promptMsg);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -27,14 +27,12 @@
|
||||
#ifndef CREDITS_HPP
|
||||
#define CREDITS_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
|
||||
#include "utils/structs.hpp"
|
||||
#include "common.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class Credits : public screen
|
||||
class Credits : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -43,8 +41,8 @@ private:
|
||||
int creditsPage = 1;
|
||||
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{295, 215, 25, 25, -1}, // Next Page.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{295, 215, 25, 25}, // Next Page.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
|
||||
#include "utils/structs.hpp"
|
||||
#include "common.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class FTPScreen : public screen
|
||||
class FTPScreen : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -39,6 +38,6 @@ public:
|
||||
private:
|
||||
int ftpEnabled = 1;
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
};
|
||||
};
|
||||
@@ -27,13 +27,12 @@
|
||||
#ifndef MAINMENU_HPP
|
||||
#define MAINMENU_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
|
||||
#include "utils/structs.hpp"
|
||||
#include "common.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class MainMenu : public screen
|
||||
class MainMenu : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -42,11 +41,11 @@ private:
|
||||
int Selection = 0;
|
||||
|
||||
std::vector<Structs::ButtonPos> mainButtons = {
|
||||
{10, 70, 140, 40, -1}, // Scripts.
|
||||
{170, 70, 140, 40, -1}, // UniStore.
|
||||
{10, 145, 140, 40, -1}, // Settings.
|
||||
{170, 145, 140, 40, -1}, // FTP.
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{10, 70, 140, 40}, // Scripts.
|
||||
{170, 70, 140, 40}, // UniStore.
|
||||
{10, 145, 140, 40}, // Settings.
|
||||
{170, 145, 140, 40}, // FTP.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -27,14 +27,13 @@
|
||||
#ifndef SCRIPTBROWSE_HPP
|
||||
#define SCRIPTBROWSE_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
#include "common.hpp"
|
||||
#include "fileBrowse.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include "utils/config.hpp"
|
||||
#include "utils/fileBrowse.h"
|
||||
#include "utils/structs.hpp"
|
||||
#include <vector>
|
||||
|
||||
class ScriptBrowse : public screen
|
||||
class ScriptBrowse : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -49,12 +48,12 @@ private:
|
||||
int keyRepeatDelay = 0;
|
||||
int fastMode = false;
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{295, 0, 25, 25, -1}, // Arrow Up.
|
||||
{295, 215, 25, 25, -1}, // Arrow Down.
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{5, 0, 25, 25, -1}, // Download All.
|
||||
{45, 0, 25, 25, -1}, // ViewMode Change.
|
||||
{80, 0, 25, 25, -1}, // Search.
|
||||
{295, 0, 25, 25}, // Arrow Up.
|
||||
{295, 215, 25, 25}, // Arrow Down.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{5, 0, 25, 25}, // Download All.
|
||||
{45, 0, 25, 25}, // ViewMode Change.
|
||||
{80, 0, 25, 25}, // Search.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -27,15 +27,12 @@
|
||||
#ifndef SCRIPTCREATOR_HPP
|
||||
#define SCRIPTCREATOR_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
|
||||
#include "utils/json.hpp"
|
||||
#include "utils/structs.hpp"
|
||||
#include "common.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class ScriptCreator : public screen
|
||||
class ScriptCreator : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -88,18 +85,18 @@ private:
|
||||
std::string jsonFileName;
|
||||
// Main Pos.
|
||||
std::vector<Structs::ButtonPos> mainButtons = {
|
||||
{90, 40, 140, 35, -1}, // New Script.
|
||||
{90, 100, 140, 35, -1}, // Existing Script.
|
||||
{90, 40, 140, 35}, // New Script.
|
||||
{90, 100, 140, 35}, // Existing Script.
|
||||
};
|
||||
|
||||
// Creator Button Pos.
|
||||
std::vector<Structs::ButtonPos> creatorButtons = {
|
||||
{10, 40, 140, 35, -1},
|
||||
{170, 40, 140, 35, -1},
|
||||
{10, 100, 140, 35, -1},
|
||||
{170, 100, 140, 35, -1},
|
||||
{10, 160, 140, 35, -1},
|
||||
{170, 160, 140, 35, -1},
|
||||
{10, 40, 140, 35},
|
||||
{170, 40, 140, 35},
|
||||
{10, 100, 140, 35},
|
||||
{170, 100, 140, 35},
|
||||
{10, 160, 140, 35},
|
||||
{170, 160, 140, 35},
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
#ifndef SCRIPTLIST_HPP
|
||||
#define SCRIPTLIST_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
#include "common.hpp"
|
||||
#include "fileBrowse.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include "utils/fileBrowse.h"
|
||||
#include "utils/structs.hpp"
|
||||
#include <vector>
|
||||
|
||||
class ScriptList : public screen
|
||||
class ScriptList : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -61,18 +61,18 @@ private:
|
||||
int fastMode = false;
|
||||
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{295, 0, 25, 25, -1}, // Arrow Up.
|
||||
{295, 215, 25, 25, -1}, // Arrow Down.
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{5, 0, 25, 25, -1}, // viewMode Change
|
||||
{45, 0, 25, 25, -1}, // Search.
|
||||
{295, 0, 25, 25}, // Arrow Up.
|
||||
{295, 215, 25, 25}, // Arrow Down.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{5, 0, 25, 25}, // viewMode Change
|
||||
{45, 0, 25, 25}, // Search.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> subPos = {
|
||||
{10, 70, 140, 40, -1}, // Script list.
|
||||
{170, 70, 140, 40, -1}, // Get Scripts.
|
||||
{10, 145, 140, 40, -1}, // Script Creator.
|
||||
{170, 145, 140, 40, -1}, // Script path change.
|
||||
{10, 70, 140, 40}, // Script list.
|
||||
{170, 70, 140, 40}, // Get Scripts.
|
||||
{10, 145, 140, 40}, // Script Creator.
|
||||
{170, 145, 140, 40}, // Script path change.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -27,15 +27,13 @@
|
||||
#ifndef SETTINGS_HPP
|
||||
#define SETTINGS_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
|
||||
#include "utils/fileBrowse.h"
|
||||
#include "utils/structs.hpp"
|
||||
#include "common.hpp"
|
||||
#include "fileBrowse.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class Settings : public screen
|
||||
class Settings : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -58,36 +56,36 @@ private:
|
||||
void MiscSettingsLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
|
||||
std::vector<Structs::ButtonPos> mainButtons = {
|
||||
{90, 40, 140, 35, -1}, // Language.
|
||||
{90, 100, 140, 35, -1}, // Colors.
|
||||
{90, 160, 140, 35, -1}, // Misc.
|
||||
{90, 40, 140, 35}, // Language.
|
||||
{90, 100, 140, 35}, // Colors.
|
||||
{90, 160, 140, 35}, // Misc.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> langBlocks = {
|
||||
{37, 32, 20, 20, -1},
|
||||
{37, 72, 20, 20, -1},
|
||||
{37, 112, 20, 20, -1},
|
||||
{37, 152, 20, 20, -1},
|
||||
{37, 188, 20, 20, -1},
|
||||
{177, 32, 20, 20, -1},
|
||||
{177, 72, 20, 20, -1},
|
||||
{177, 112, 20, 20, -1},
|
||||
{177, 152, 20, 20, -1},
|
||||
{177, 188, 20, 20, -1},
|
||||
{37, 32, 20, 20},
|
||||
{37, 72, 20, 20},
|
||||
{37, 112, 20, 20},
|
||||
{37, 152, 20, 20},
|
||||
{37, 188, 20, 20},
|
||||
{177, 32, 20, 20},
|
||||
{177, 72, 20, 20},
|
||||
{177, 112, 20, 20},
|
||||
{177, 152, 20, 20},
|
||||
{177, 188, 20, 20},
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> buttons = {
|
||||
{10, 85, 95, 41, -1},
|
||||
{115, 85, 95, 41, -1},
|
||||
{220, 85, 95, 41, -1},
|
||||
{10, 85, 95, 41},
|
||||
{115, 85, 95, 41},
|
||||
{220, 85, 95, 41},
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{0, 0, 25, 25, -1}, // Previous Arrow.
|
||||
{295, 0, 25, 25, -1}, // Next Arrow.
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{0, 0, 25, 25, -1}, // Back Arrow top left.
|
||||
{295, 215, 25, 25, -1}, // Next Page / Misc Arrow.
|
||||
{0, 0, 25, 25}, // Previous Arrow.
|
||||
{295, 0, 25, 25}, // Next Arrow.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{0, 0, 25, 25}, // Back Arrow top left.
|
||||
{295, 215, 25, 25}, // Next Page / Misc Arrow.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
#ifndef UNISTORE_HPP
|
||||
#define UNISTORE_HPP
|
||||
|
||||
#include "screens/screen.hpp"
|
||||
#include "screens/screenCommon.hpp"
|
||||
#include "common.hpp"
|
||||
#include "fileBrowse.hpp"
|
||||
#include "structs.hpp"
|
||||
|
||||
#include "utils/fileBrowse.h"
|
||||
#include "utils/structs.hpp"
|
||||
#include <vector>
|
||||
|
||||
class UniStore : public screen
|
||||
class UniStore : public Screen
|
||||
{
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
@@ -83,31 +83,31 @@ private:
|
||||
std::vector<DirEntry> dirContents;
|
||||
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{295, 0, 25, 25, -1}, // Arrow Up.
|
||||
{295, 215, 25, 25, -1}, // Arrow Down.
|
||||
{0, 215, 25, 25, -1}, // Back Arrow.
|
||||
{5, 0, 25, 25, -1}, // ViewMode Change.
|
||||
{45, 0, 25, 25, -1}, // Search.
|
||||
{85, 0, 25, 25, -1}, // Update.
|
||||
{295, 0, 25, 25}, // Arrow Up.
|
||||
{295, 215, 25, 25}, // Arrow Down.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{5, 0, 25, 25}, // ViewMode Change.
|
||||
{45, 0, 25, 25}, // Search.
|
||||
{85, 0, 25, 25}, // Update.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> URLBtn = {
|
||||
{10, 70, 140, 40, -1}, // FULL URL.
|
||||
{170, 70, 140, 40, -1}, // Github.
|
||||
{10, 145, 140, 40, -1}, // TinyDB.
|
||||
{170, 145, 140, 40, -1}, // QR Code?
|
||||
{10, 70, 140, 40}, // FULL URL.
|
||||
{170, 70, 140, 40}, // Github.
|
||||
{10, 145, 140, 40}, // TinyDB.
|
||||
{170, 145, 140, 40}, // QR Code?
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> GitHubPos = {
|
||||
{30, 50, 260, 30, -1}, // Owner & Repo.
|
||||
{30, 130, 260, 30, -1}, // Filename.
|
||||
{135, 180, 50, 30, -1}, // OK.
|
||||
{30, 50, 260, 30}, // Owner & Repo.
|
||||
{30, 130, 260, 30}, // Filename.
|
||||
{135, 180, 50, 30}, // OK.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> subPos = {
|
||||
{90, 40, 140, 35, -1}, // StoreList.
|
||||
{90, 100, 140, 35, -1}, // storeSearch.
|
||||
{90, 160, 140, 35, -1}, // storePathChange.
|
||||
{90, 40, 140, 35}, // StoreList.
|
||||
{90, 100, 140, 35}, // storeSearch.
|
||||
{90, 160, 140, 35}, // storePathChange.
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "utils/files.h"
|
||||
#include "files.h"
|
||||
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
@@ -42,8 +42,14 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#include "utils/json.hpp"
|
||||
#include "utils/stringutils.hpp"
|
||||
#include "config.hpp"
|
||||
#include "gfx.hpp"
|
||||
#include "gui.hpp"
|
||||
#include "json.hpp"
|
||||
#include "lang.hpp"
|
||||
#include "msg.hpp"
|
||||
#include "screenCommon.hpp"
|
||||
#include "stringutils.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef EXTRACT_HPP
|
||||
#define EXTRACT_HPP
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
@@ -38,4 +39,6 @@ enum ExtractError {
|
||||
EXTRACT_ERROR_WRITEFILE,
|
||||
};
|
||||
|
||||
Result extractArchive(std::string archivePath, std::string wantedFile, std::string outputPath);
|
||||
Result extractArchive(std::string archivePath, std::string wantedFile, std::string outputPath);
|
||||
|
||||
#endif
|
||||
@@ -1,35 +1,27 @@
|
||||
#ifndef FILE_BROWSE_H
|
||||
#define FILE_BROWSE_H
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct DirEntry {
|
||||
std::string name;
|
||||
std::string path;
|
||||
bool isDirectory;
|
||||
char tid[5];
|
||||
off_t size;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char gameTitle[12]; //!< 12 characters for the game title.
|
||||
char gameCode[4]; //!< 4 characters for the game code.
|
||||
} sNDSHeadertitlecodeonly;
|
||||
|
||||
void findNdsFiles(vector<DirEntry>& dirContents);
|
||||
|
||||
bool nameEndsWith(const std::string& name, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents);
|
||||
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList);
|
||||
|
||||
bool returnIfExist(const std::string &path, const std::vector<std::string> &extensionList);
|
||||
|
||||
std::string selectFilePath(std::string selectText, const std::vector<std::string> &extensionList, int selectionMode = 1);
|
||||
|
||||
#endif //FILE_BROWSE_H
|
||||
#ifndef FILE_BROWSE_HPP
|
||||
#define FILE_BROWSE_HPP
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct DirEntry {
|
||||
std::string name;
|
||||
std::string path;
|
||||
bool isDirectory;
|
||||
off_t size;
|
||||
};
|
||||
|
||||
bool nameEndsWith(const std::string& name, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents, const std::vector<std::string> extensionList);
|
||||
void getDirectoryContents(std::vector<DirEntry>& dirContents);
|
||||
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList);
|
||||
|
||||
bool returnIfExist(const std::string &path, const std::vector<std::string> &extensionList);
|
||||
|
||||
std::string selectFilePath(std::string selectText, const std::vector<std::string> &extensionList, int selectionMode = 1);
|
||||
|
||||
#endif //FILE_BROWSE_HPP
|
||||
@@ -24,6 +24,11 @@
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef FORMATTING_HPP
|
||||
#define FORMATTING_HPP
|
||||
|
||||
std::string formatBytes(int bytes);
|
||||
#include <string>
|
||||
|
||||
std::string formatBytes(int bytes);
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef STRINGUTILS_HPP
|
||||
#define STRINGUTILS_HPP
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
@@ -7,4 +8,6 @@ bool matchPattern(std::string pattern, std::string tested);
|
||||
namespace StringUtils
|
||||
{
|
||||
std::string format(const std::string& fmt_str, ...);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user