mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-20 10:19:15 +01:00
2c268af0f9
*changed fat/ntfs/ext installer to use the header title as foldername instead of wiitdb title (this is the way it is in the wbfs managers) *Fixed language changing for wiitdb titles / coverdownload even without available .lang file which is loaded *Added reload of game titles on language change *Added check for valid config files. If config file is not valid it will not be used. Current valid configs are R1031 to all. (You configs will be reseted with this. If you want to save them, move them and merge them afterwards manually.) *Fixed possible crash on mounting *Changed default settings for device free space display to off, because fat32 partitions are very slow on that. Added a warning when on FAT partition and trying to enable this option. *Updated langauge files
72 lines
1.9 KiB
C++
72 lines
1.9 KiB
C++
#ifndef _GAME_SETTINGS_H_
|
|
#define _GAME_SETTINGS_H_
|
|
|
|
#include <string>
|
|
#include <stdio.h>
|
|
#include <gctypes.h>
|
|
#include <vector>
|
|
#include "usbloader/disc.h"
|
|
|
|
typedef struct _GameCFG
|
|
{
|
|
char id[7];
|
|
u8 video;
|
|
u8 language;
|
|
u8 ocarina;
|
|
u8 vipatch;
|
|
u8 ios;
|
|
u8 parentalcontrol;
|
|
u8 errorfix002;
|
|
u8 iosreloadblock;
|
|
u8 loadalternatedol;
|
|
u32 alternatedolstart;
|
|
u8 patchcountrystrings;
|
|
char alternatedolname[40];
|
|
u8 returnTo;
|
|
u8 Locked;
|
|
} GameCFG;
|
|
|
|
class CGameSettings
|
|
{
|
|
public:
|
|
//!Constructor
|
|
CGameSettings();
|
|
//!Destructor
|
|
~CGameSettings();
|
|
//!Load
|
|
bool Load(const char * path);
|
|
//!Save
|
|
bool Save();
|
|
//!AddGame
|
|
bool AddGame(const GameCFG & NewGame);
|
|
//!Reset
|
|
bool RemoveAll();
|
|
//!Overload Reset for one Game
|
|
bool Remove(const char * id);
|
|
bool Remove(const u8 * id) { return Remove((const char *) id); };
|
|
bool Remove(const struct discHdr * game) { if(!game) return false; else return Remove(game->id); };
|
|
//!Get GameCFG
|
|
GameCFG * GetGameCFG(const char * id);
|
|
//!Overload
|
|
GameCFG * GetGameCFG(const u8 * id) { return GetGameCFG((const char *) id); };
|
|
//!Overload
|
|
GameCFG * GetGameCFG(const struct discHdr * game) { if(!game) return NULL; else return GetGameCFG(game->id); };
|
|
//!Quick settings to PEGI conversion
|
|
static int GetPartenalPEGI(int parentalsetting);
|
|
protected:
|
|
bool ReadGameID(const char * src, char * GameID, int size);
|
|
bool SetSetting(GameCFG & game, char *name, char *value);
|
|
bool ValidVersion(FILE * file);
|
|
//!Find the config file in the default paths
|
|
bool FindConfig();
|
|
|
|
void ParseLine(char *line);
|
|
void TrimLine(char *dest, const char *src, int size);
|
|
std::string ConfigPath;
|
|
std::vector<GameCFG> GameList;
|
|
};
|
|
|
|
extern CGameSettings GameSettings;
|
|
|
|
#endif
|