-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64106cc
commit fb7adc4
Showing
9 changed files
with
862 additions
and
863 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#include "MCM/MCM.h" | ||
|
||
#include "Menus/PowerArmorConditionMenu.h" | ||
|
||
namespace MCM | ||
{ | ||
void Settings::ResetStatePost() | ||
{ | ||
if (RE::PowerArmor::PlayerInPowerArmor()) | ||
{ | ||
if (General::bEnable) | ||
{ | ||
RE::SendHUDMessage::SetPowerArmorMode(false); | ||
Menus::PowerArmorConditionMenu::ShowMenu(); | ||
} | ||
else | ||
{ | ||
RE::SendHUDMessage::SetPowerArmorMode(true); | ||
Menus::PowerArmorConditionMenu::HideMenu(); | ||
} | ||
} | ||
|
||
m_ini_base.Reset(); | ||
m_ini_user.Reset(); | ||
} | ||
} | ||
#include "MCM/MCM.h" | ||
|
||
#include "Menus/PowerArmorConditionMenu.h" | ||
|
||
namespace MCM | ||
{ | ||
void Settings::ResetStatePost() | ||
{ | ||
if (RE::PowerArmor::PlayerInPowerArmor()) | ||
{ | ||
if (General::bEnable) | ||
{ | ||
RE::SendHUDMessage::SetPowerArmorMode(false); | ||
Menus::PowerArmorConditionMenu::ShowMenu(); | ||
} | ||
else | ||
{ | ||
RE::SendHUDMessage::SetPowerArmorMode(true); | ||
Menus::PowerArmorConditionMenu::HideMenu(); | ||
} | ||
} | ||
|
||
m_ini_base.Reset(); | ||
m_ini_user.Reset(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,83 @@ | ||
#pragma once | ||
|
||
namespace MCM | ||
{ | ||
class Settings | ||
{ | ||
public: | ||
class General | ||
{ | ||
public: | ||
inline static bool bEnable{ true }; | ||
inline static bool bDisablePAColor{ false }; | ||
inline static bool bDisableColor{ false }; | ||
|
||
inline static double fConditionMeterX{ 136.0 }; | ||
inline static double fConditionMeterY{ 675.0 }; | ||
inline static double fConditionMeterScale{ 1.0 }; | ||
}; | ||
|
||
static void Update() | ||
{ | ||
ResetStateInit(); | ||
|
||
GetModSettingBool("General", "bEnable", General::bEnable); | ||
GetModSettingBool("General", "bDisablePAColor", General::bDisablePAColor); | ||
GetModSettingBool("General", "bDisableColor", General::bDisableColor); | ||
|
||
GetModSettingDouble("General", "fConditionMeterX", General::fConditionMeterX); | ||
GetModSettingDouble("General", "fConditionMeterY", General::fConditionMeterY); | ||
GetModSettingDouble("General", "fConditionMeterScale", General::fConditionMeterScale); | ||
|
||
ResetStatePost(); | ||
} | ||
|
||
inline static bool m_FirstRun{ true }; | ||
|
||
private: | ||
static void ResetStateInit() | ||
{ | ||
if (m_FirstRun) | ||
{ | ||
m_FirstRun = false; | ||
} | ||
|
||
m_ini_base.LoadFile("Data/MCM/Config/BakaPowerArmorHUD/settings.ini"); | ||
m_ini_user.LoadFile("Data/MCM/Settings/BakaPowerArmorHUD.ini"); | ||
} | ||
|
||
static void ResetStatePost(); | ||
|
||
protected: | ||
static void GetModSettingChar(const std::string& a_section, const std::string& a_setting, std::string_view& a_value) | ||
{ | ||
auto base = m_ini_base.GetValue(a_section.c_str(), a_setting.c_str(), a_value.data()); | ||
auto user = m_ini_user.GetValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingBool(const std::string& a_section, const std::string& a_setting, bool& a_value) | ||
{ | ||
auto base = m_ini_base.GetBoolValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetBoolValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingDouble(const std::string& a_section, const std::string& a_setting, double& a_value) | ||
{ | ||
auto base = m_ini_base.GetDoubleValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetDoubleValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingLong(const std::string& a_section, const std::string& a_setting, std::int32_t& a_value) | ||
{ | ||
auto base = m_ini_base.GetLongValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetLongValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = static_cast<std::int32_t>(user); | ||
} | ||
|
||
inline static CSimpleIniA m_ini_base{ true }; | ||
inline static CSimpleIniA m_ini_user{ true }; | ||
}; | ||
} | ||
#pragma once | ||
|
||
namespace MCM | ||
{ | ||
class Settings | ||
{ | ||
public: | ||
class General | ||
{ | ||
public: | ||
inline static bool bEnable{ true }; | ||
inline static bool bDisablePAColor{ false }; | ||
inline static bool bDisableColor{ false }; | ||
|
||
inline static double fConditionMeterX{ 136.0 }; | ||
inline static double fConditionMeterY{ 675.0 }; | ||
inline static double fConditionMeterScale{ 1.0 }; | ||
}; | ||
|
||
static void Update() | ||
{ | ||
ResetStateInit(); | ||
|
||
GetModSettingBool("General", "bEnable", General::bEnable); | ||
GetModSettingBool("General", "bDisablePAColor", General::bDisablePAColor); | ||
GetModSettingBool("General", "bDisableColor", General::bDisableColor); | ||
|
||
GetModSettingDouble("General", "fConditionMeterX", General::fConditionMeterX); | ||
GetModSettingDouble("General", "fConditionMeterY", General::fConditionMeterY); | ||
GetModSettingDouble("General", "fConditionMeterScale", General::fConditionMeterScale); | ||
|
||
ResetStatePost(); | ||
} | ||
|
||
inline static bool m_FirstRun{ true }; | ||
|
||
private: | ||
static void ResetStateInit() | ||
{ | ||
if (m_FirstRun) | ||
{ | ||
m_FirstRun = false; | ||
} | ||
|
||
m_ini_base.LoadFile("Data/MCM/Config/BakaPowerArmorHUD/settings.ini"); | ||
m_ini_user.LoadFile("Data/MCM/Settings/BakaPowerArmorHUD.ini"); | ||
} | ||
|
||
static void ResetStatePost(); | ||
|
||
protected: | ||
static void GetModSettingChar(const std::string& a_section, const std::string& a_setting, std::string_view& a_value) | ||
{ | ||
auto base = m_ini_base.GetValue(a_section.c_str(), a_setting.c_str(), a_value.data()); | ||
auto user = m_ini_user.GetValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingBool(const std::string& a_section, const std::string& a_setting, bool& a_value) | ||
{ | ||
auto base = m_ini_base.GetBoolValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetBoolValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingDouble(const std::string& a_section, const std::string& a_setting, double& a_value) | ||
{ | ||
auto base = m_ini_base.GetDoubleValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetDoubleValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = user; | ||
} | ||
|
||
static void GetModSettingLong(const std::string& a_section, const std::string& a_setting, std::int32_t& a_value) | ||
{ | ||
auto base = m_ini_base.GetLongValue(a_section.c_str(), a_setting.c_str(), a_value); | ||
auto user = m_ini_user.GetLongValue(a_section.c_str(), a_setting.c_str(), base); | ||
a_value = static_cast<std::int32_t>(user); | ||
} | ||
|
||
inline static CSimpleIniA m_ini_base{ true }; | ||
inline static CSimpleIniA m_ini_user{ true }; | ||
}; | ||
} |
Oops, something went wrong.