prime/include/MetroidPrime/CInGameTweakManager.hpp

77 lines
2.0 KiB
C++
Raw Normal View History

#ifndef _CINGAMETWEAKMANAGER
#define _CINGAMETWEAKMANAGER
#include "types.h"
#include "rstl/string.hpp"
2022-10-01 06:19:09 +00:00
#include "rstl/vector.hpp"
class CTweakValue {
public:
struct Audio {
public:
Audio(float fadeIn, float fadeOut, float vol, const rstl::string& fileName, uint handle)
2022-10-01 06:19:09 +00:00
: x0_fadeIn(fadeIn)
, x4_fadeOut(fadeOut)
, x8_volume(vol)
, xc_fileName(fileName)
, x1c_res(handle) {}
float GetFadeIn() const { return x0_fadeIn; }
float GetFadeOut() const { return x4_fadeOut; }
float GetVolume() const { return x8_volume; }
2022-10-01 06:19:09 +00:00
const rstl::string& GetFileName() const { return xc_fileName; }
CAssetId GetResId() const { return x1c_res; }
// static Audio None() { return Audio(0.f, 0.f, 0.f, "", 0); }
private:
float x0_fadeIn;
float x4_fadeOut;
float x8_volume;
2022-10-01 06:19:09 +00:00
rstl::string xc_fileName;
CAssetId x1c_res;
};
enum EType {};
CTweakValue();
// CTweakValue(const rstl::string&, EType, const Audio&);
// CTweakValue(CTextInputStream&);
// void PutTo(CTextOutStream&);
const rstl::string& GetName() const { return x4_key; }
const rstl::string& GetValueAsString() const;
void SetValueFromString(const rstl::string&);
const Audio& GetAudio() const { return x24_audio; }
EType GetType() const { return x0_type; }
private:
EType x0_type;
rstl::string x4_key;
rstl::string x14_str;
Audio x24_audio;
union {
uint x44_int;
float x44_flt;
2022-10-01 06:19:09 +00:00
};
};
class CInGameTweakManager {
public:
CInGameTweakManager();
2022-10-21 21:40:29 +00:00
bool HasTweakValue(const rstl::string& name) const;
const CTweakValue* GetTweakValue(const rstl::string& name) const;
bool ReadFromMemoryCard(const rstl::string&);
2023-01-05 17:06:10 +00:00
static rstl::string sub_8021cb38(CAssetId, const rstl::string&);
2022-12-22 14:19:00 +00:00
2022-10-21 21:40:29 +00:00
static rstl::string GetIdentifierForMidiEvent(CAssetId world, CAssetId area, const rstl::string& midiObj);
private:
2022-10-01 06:19:09 +00:00
rstl::vector< CTweakValue > x0_values;
};
2022-10-01 06:19:09 +00:00
CHECK_SIZEOF(CInGameTweakManager, 0x10)
extern CInGameTweakManager* gpTweakManager;
#endif // _CINGAMETWEAKMANAGER