feat(Core): Added speedo_meter to data and renamed CustomWeapon enum

This commit is contained in:
Yimura 2021-05-19 18:09:13 +02:00
parent f070caf23d
commit d6072b26b6
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682
5 changed files with 52 additions and 7 deletions

View File

@ -17,7 +17,7 @@ namespace big
void looped::weapons_gravity_gun()
{
bool bGravityGun = g.weapons.custom_weapon == CustomWeapons::GRAVITY_GUN;
bool bGravityGun = g.weapons.custom_weapon == CustomWeapon::GRAVITY_GUN;
double multiplier = 3.0;
if (bGravityGun)

View File

@ -2,11 +2,11 @@
#include "core/enums.hpp"
struct custom_weapon {
big::CustomWeapons id;
big::CustomWeapon id;
const char name[16];
};
const custom_weapon custom_weapons[] = {
{ big::CustomWeapons::NONE, "No weapon" },
{ big::CustomWeapons::GRAVITY_GUN, "Gravity Gun" }
{ big::CustomWeapon::NONE, "No weapon" },
{ big::CustomWeapon::GRAVITY_GUN, "Gravity Gun" }
};

View File

@ -0,0 +1,13 @@
#pragma once
#include "core/enums.hpp"
struct speedo_meter {
big::SpeedoMeter id;
const char name[16];
};
const speedo_meter speedo_meters[] = {
{ big::SpeedoMeter::DISABLED, "Disabled" },
{ big::SpeedoMeter::KMH, "km/h" },
{ big::SpeedoMeter::MPH, "mph" }
};

View File

@ -2,9 +2,16 @@
namespace big
{
enum class CustomWeapons
enum class CustomWeapon
{
NONE,
GRAVITY_GUN
};
enum class SpeedoMeter
{
DISABLED,
KMH,
MPH
};
}

View File

@ -1,19 +1,44 @@
#pragma once
#include "enums.hpp"
#include "settings.h"
#ifndef GLOBALS_H
#define GLOBALS_H
using namespace big;
struct globals {
void load()
{
this->self.noclip = g_settings.options["self"]["godmode"];
}
void save()
{
g_settings.options["self"]["godmode"] = this->self.noclip;
g_settings.save();
}
struct self {
bool godmode = false;
bool noclip = false;
};
struct weapons {
big::CustomWeapons custom_weapon = big::CustomWeapons::NONE;
struct vehicle {
SpeedoMeter speedo_meter = SpeedoMeter::DISABLED;
};
struct weapons {
CustomWeapon custom_weapon = CustomWeapon::NONE;
};
globals()
{
this->load();
}
self self{};
vehicle vehicle{};
weapons weapons{};
};