add Mod::hasSavedValue + fix some enumKeyCodes

This commit is contained in:
HJfod 2023-04-11 20:41:35 +03:00
parent bcc3c6a47a
commit 3a357027d6
3 changed files with 9 additions and 5 deletions

View file

@ -15,10 +15,8 @@ RT_ADD(
typedef enum
{
// this one might not actually exist in gd itself
HJ_ADD(
KEY_What = -0x01,
KEY_None = 0x00,
)
KEY_Unknown = -0x01,
KEY_None = 0x00,
KEY_Backspace = 0x08,
KEY_Tab = 0x09,
KEY_Clear = 0x0C,

View file

@ -160,6 +160,8 @@ namespace geode {
return T();
}
bool hasSavedValue(std::string const& key);
template <class T>
T getSavedValue(std::string const& key) {
auto& saved = this->getSaveContainer();

View file

@ -190,4 +190,8 @@ char const* Mod::expandSpriteName(char const* name) {
ModJson Mod::getRuntimeInfo() const {
return m_impl->getRuntimeInfo();
}
}
bool Mod::hasSavedValue(std::string const& key) {
return this->getSaveContainer().contains(key);
}