resonance 1.0.1
Loading...
Searching...
No Matches
globalsettings.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <iostream>
5#include <vector>
6
9#include "met/gameoptions.h"
10#include "os/hxstr.h"
11#include "stream/ibstream.h"
12#include "stream/obstream.h"
13
32public:
34 static constexpr int kControllerCount = 4;
35
44 void *operator new(size_t nSize);
45
53 void operator delete(void *pBlock);
54
63
68 virtual ~GlobalSettings();
69
80 virtual void Save(OBStream &stream);
81
94 virtual void Load(IBStream &stream);
95
104
111 static void Create();
112
119 static void Destroy();
120
131 void SetMacros(std::vector<HxStr> macros);
132
142 void Print(std::ostream &stream);
143
154 void operator=(const GlobalSettings &other);
155
160
161private:
170 void SkipLegacyMacros(IBStream &stream);
171
172 // MetKeyboardScreen's default macros, which the constructor copies into mMacros. +0x3c
173 std::vector<HxStr> *mDefaultMacros;
174 // The keyboard macros Save() writes. +0x40
175 std::vector<HxStr> mMacros;
176 // The network address, labelled `Net IP Address` by Print(). +0x4c
177 HxStr mNetAddress;
178 // The network port as text, labelled `Net Port` by Print(). +0x54
179 HxStr mNetPort;
180
181public:
188 std::vector<MemcardConnectState> mCardSlots;
204
213
221};
One controller's mapping from gameplay actions to buttons.
Definition controllerconfig.h:24
The three game option settings GlobalSettings records.
Definition gameoptions.h:14
static void Create()
Allocate the instance.
virtual ~GlobalSettings()
virtual void Save(OBStream &stream)
Write the settings.
void operator=(const GlobalSettings &other)
Copy another instance's settings, except the memory-card locations.
virtual void Load(IBStream &stream)
Read the settings back.
int mRequiredSaveSpace
The free space the game needs on the first card.
Definition globalsettings.h:196
int mTutorialComplete
Non-zero once the tutorial is complete, labelled by Print().
Definition globalsettings.h:183
static constexpr int kControllerCount
The number of controller mappings.
Definition globalsettings.h:34
static void Destroy()
Delete the instance and clear the pointer shared() reports.
ControllerConfig mControllers[kControllerCount]
The four controller mappings.
Definition globalsettings.h:157
void SetMacros(std::vector< HxStr > macros)
Replace the keyboard macros with a list.
GameOptions mGameOptions
The game options.
Definition globalsettings.h:159
static GlobalSettings * shared()
Report the instance.
GlobalSettings()
Start with the default mappings, options, and keyboard macros, the address 127.0.0....
int mTeamFreqUnlocked
Non-zero to offer the team FreQ identities instead of the pre-fab ones.
Definition globalsettings.h:220
std::vector< MemcardConnectState > mCardSlots
The memory-card locations.
Definition globalsettings.h:188
void Print(std::ostream &stream)
Write the address, the port, the four mapping labels, and the tutorial flag to a stream.
int mMinimumFreeClusters
The free space a remix save needs.
Definition globalsettings.h:203
int mPersonaMinimumFreeClusters
The free space a persona save needs.
Definition globalsettings.h:212
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25