Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Commit

Permalink
Get rid of INI and use JSON instead! (#14)
Browse files Browse the repository at this point in the history
* Don't build here.

* We get rid of INI.

* Likely Part 2 of 3.

* merge master to the current branch.

* Hopefully Part 3 of 3?
  • Loading branch information
SuperSaiyajinStackZ committed Nov 17, 2019
1 parent cf326f5 commit 9db088c
Show file tree
Hide file tree
Showing 27 changed files with 450 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
@@ -1,7 +1,7 @@
trigger:
branches:
include: ['*']
exclude: [translation, external-sheets, cleanup, redo-translation-and-centering]
exclude: [translation, external-sheets, cleanup, switch-to-json]
tags:
include: ['*']

Expand Down
41 changes: 14 additions & 27 deletions include/common/config.hpp
Expand Up @@ -30,34 +30,21 @@
#include <string>

namespace Config {
void load();
void save();
void initializeNewConfig();

// [CORE]
extern int check; // If checked on startup -> 1.
extern int update; // Tell, if an Update of AC:NL was found. (For the old version).

// [MISC]
extern int Logging; // Enable / Disable writing to the Log.

// [UI]
extern int LangLocation; // Language Location (Romfs/SD).
extern int lang; // The current Language.
extern std::string sheetIni; // Sheet Ini Path.

void loadConfig();
void saveConfig();

// Spritesheet stuff.
void loadSheetIni();
void saveSheetIni(std::string sheetIniPath);
void loadSheetIniStuff();
extern int barText;
extern int buttonText;
extern int bgText;
extern int boxText;
extern int fileBrowseText;
extern int MessageText;
extern int helpMsg;
extern int Color1, Color2, Color3;
bool getBool(const std::string &key);
void setBool(const std::string &key, bool v);

int getInt(const std::string &key);
void setInt(const std::string &key, int v);

std::string getString(const std::string &key);
void setString(const std::string &key, const std::string &v);

int getLang(const std::string &key);
extern int Color1, Color2, Color3, TxtColor, lang;
}

#endif
46 changes: 0 additions & 46 deletions include/common/inifile.h

This file was deleted.

1 change: 1 addition & 0 deletions include/gui/colors.hpp
Expand Up @@ -74,6 +74,7 @@ typedef u32 Color;
namespace ColorHelper {
int getColorValue(int color, int bgr);
std::string getColorName(int color, int bgr);
u32 getColor(std::string colorString);
}

#endif
@@ -1,5 +1,5 @@
/*
* This file is part of Universal-Manager
* This file is part of LeafEdit
* Copyright (C) 2019 VoltZ, Epicpkmn11, Flame, RocketRobz, TotallyNotGuy
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -24,61 +24,29 @@
* reasonable ways as different from the original version.
*/

#include "common/fileBrowse.h"
#include "common/inifile.h"
#ifndef COLOREDITOR_HPP
#define COLOREDITOR_HPP

#include "common/structs.hpp"

#include "screens/screen.hpp"
#include "gui/screens/screen.hpp"
#include "gui/screens/screenCommon.hpp"

#include <algorithm>
#include <fstream>
#include <string>
#include <unistd.h>
#include <vector>

class LeafEditEditor : public Screen
class ColorEditor : public Screen
{
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;

private:
int mode = 0;
int colorMode = 0;

CIniFile sheetFile; // Sheet color informations.

void DrawIniBrowse(void) const;
void IniBrowseLogic(u32 hDown, u32 hHeld);

void DrawIniEditor(void) const;
void EditorLogic(u32 hDown, u32 hHeld, touchPosition touch);

void drawTestSelector(float x, float y) const;

void loadIniContents();
void saveIniContents();
void createNewSheet(std::string sheetIni);

uint selectedSheetIniFile = 0;
int keyRepeatDelay = 0;
int fastMode = false;
mutable bool refresh = true;
std::vector<DirEntry> dirContents;

std::string sheetsFile = "";
std::string savesPath = "";




std::vector<Structs::ButtonPos> buttons = {
{10, 85, 95, 41, -1},
{115, 85, 95, 41, -1},
{220, 85, 95, 41, -1},
{293, 213, 27, 27, -1},
};
};

namespace Sheet {
extern int barText, bgText, buttonText, boxText, fileBrowseText, MessageText, helpMsg, Color1, Color2, Color3;
}
#endif
18 changes: 2 additions & 16 deletions romfs/lang/en/app.json
Expand Up @@ -53,7 +53,7 @@
"NEW_PLAYER_NAME": "Enter new player name.",

"LANGUAGE": "Language",
"INI_EDITOR": "Ini Editor",
"COLORS": "Colors",
"SELECT_LANG": "Choose the current language.",

"SELECT_TITLE": "Select a title to start.",
Expand Down Expand Up @@ -104,29 +104,15 @@
"ITEM_DRESSER": "Dresser: ",
"ITEM_POCKET": "Pocket",

"INI_BROWSE": "Ini Browse",
"WANT_USE_INI": "Do you want to use this ini?",
"WANT_EDIT_INI": "Do you want to edit this ini?",
"CREATE_INI": "Are you sure, you want to create a new ini?\nIt will reset the existing Ini File, if it already exist!",
"NEW_SHEET_NAME": "Enter the name of the sheet.",
"INI_EDITOR": "Ini Editor",
"CHANGE_INI_OPTION": "Press L/R to change the ini option.",
"BARTEXT_COLOR": "This is the BarText Color.",
"BGTEXT_COLOR": "This is the BGText Color.",
"UNSELECTED": "Unselected",
"SELECTED": "Selected",
"BUTTONTEXT_COLOR": "This is the ButtonText Color.",
"BOXTEXT_COLOR": "This is the BoxText Color.",
"SELTEXT_COLOR": "> This is the Selector Text Color.\n\nThis is the Selector Text Color.",
"MESTEXT_COLOR": "This is the Message Text Color.",
"INSTRUCTION_COLOR": "Example Instruction Color.",
"BAR_COLOR": "This is the Bar Color.",
"BG_TOP_COLOR": "This is the Top BG Color.",
"BG_BOTTOM_COLOR": "This is the Bottom BG Color.",
"TEXT_COLOR": "This is the Text Color.",
"ENTER_RED_RGB": "Enter the Red RGB Value.",
"ENTER_GREEN_RGB": "Enter the Green RGB Value.",
"ENTER_BLUE_RGB": "Enter the Blue RGB Value.",
"SAVE_INI": "Would you like to save the Ini?",

"ACRES": "Acres",
"PLAYER_SELECTION": "Player Selection",
Expand Down

0 comments on commit 9db088c

Please sign in to comment.