Makes data in OverlayCommand private.

This commit is contained in:
Kenix3 2022-08-16 22:26:17 -04:00
parent b43eb2d0bd
commit ea92a2e123
2 changed files with 9 additions and 4 deletions

View File

@ -9,7 +9,7 @@
#include "Utils/StringHelper.h"
namespace Ship {
bool OverlayCommand(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
bool GameOverlay::OverlayCommand(std::shared_ptr<Console> Console, const std::vector<std::string>& args) {
if (args.size() < 3) {
return CMD_FAILED;
}

View File

@ -1,7 +1,9 @@
#pragma once
#include <string>
#include <vector>
#include <memory>
#include "Console.h"
#include "Lib/ImGui/imgui.h"
#include <unordered_map>
@ -20,9 +22,8 @@ namespace Ship {
class GameOverlay {
public:
std::unordered_map<std::string, Overlay*> RegisteredOverlays;
std::unordered_map<std::string, ImFont*> Fonts;
std::string CurrentFont = "Default";
static bool OverlayCommand(std::shared_ptr<Console> Console, const std::vector<std::string>& args);
void Init();
void Draw();
void DrawSettings();
@ -33,7 +34,11 @@ namespace Ship {
void TextDraw(float x, float y, bool shadow, ImVec4 color, const char* text, ...);
void TextDrawNotification(float duration, bool shadow, const char* fmt, ...);
private:
std::unordered_map<std::string, ImFont*> Fonts;
std::unordered_map<std::string, Overlay*> RegisteredOverlays;
std::string CurrentFont = "Default";
bool NeedsCleanup = false;
void CleanupNotifications();
void LoadFont(const std::string& name, const std::string& path, float fontSize);
};