Skip to content

Commit

Permalink
chore: style formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shad0wshayd3 authored and github-actions[bot] committed May 11, 2024
1 parent 64106cc commit fb7adc4
Show file tree
Hide file tree
Showing 9 changed files with 862 additions and 863 deletions.
633 changes: 316 additions & 317 deletions Plugin/src/Hooks/Hooks.h

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions Plugin/src/MCM/MCM.cpp
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();
}
}
166 changes: 83 additions & 83 deletions Plugin/src/MCM/MCM.h
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 };
};
}
Loading

0 comments on commit fb7adc4

Please sign in to comment.