mirror of https://github.com/AxioDL/metaforce.git
Initial PlayerLoadout structure
This commit is contained in:
parent
201d5c5423
commit
27f25223fb
|
@ -206,7 +206,8 @@ elseif(UNIX)
|
||||||
set(PLAT_LIBS rt)
|
set(PLAT_LIBS rt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(metaforce CMain.cpp ${PLAT_SRCS} ImGuiConsole.hpp ImGuiConsole.cpp ImGuiEntitySupport.hpp ImGuiEntitySupport.cpp)
|
add_executable(metaforce CMain.cpp ${PLAT_SRCS} ImGuiConsole.hpp ImGuiConsole.cpp ImGuiEntitySupport.hpp ImGuiEntitySupport.cpp ImGuiPlayerLoadouts.hpp)
|
||||||
|
target_atdna(metaforce atdna_ImGuiPlayerLoadouts.cpp ImGuiPlayerLoadouts.hpp)
|
||||||
# RUNTIME_LIBRARIES repeated here for link ordering
|
# RUNTIME_LIBRARIES repeated here for link ordering
|
||||||
target_link_libraries(metaforce PUBLIC RuntimeCommon RuntimeCommonB ${RUNTIME_LIBRARIES} ${PLAT_LIBS})
|
target_link_libraries(metaforce PUBLIC RuntimeCommon RuntimeCommonB ${RUNTIME_LIBRARIES} ${PLAT_LIBS})
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace metaforce {
|
||||||
|
|
||||||
std::array<ImGuiEntityEntry, 1024> ImGuiConsole::entities;
|
std::array<ImGuiEntityEntry, 1024> ImGuiConsole::entities;
|
||||||
std::set<TUniqueId> ImGuiConsole::inspectingEntities;
|
std::set<TUniqueId> ImGuiConsole::inspectingEntities;
|
||||||
|
ImGuiPlayerLoadouts ImGuiConsole::loadouts;
|
||||||
|
|
||||||
void ImGuiStringViewText(std::string_view text) {
|
void ImGuiStringViewText(std::string_view text) {
|
||||||
// begin()/end() do not work on MSVC
|
// begin()/end() do not work on MSVC
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "RetroTypes.hpp"
|
#include "RetroTypes.hpp"
|
||||||
#include "Runtime/World/CActor.hpp"
|
#include "Runtime/World/CActor.hpp"
|
||||||
#include "Runtime/World/CEntity.hpp"
|
#include "Runtime/World/CEntity.hpp"
|
||||||
|
#include "Runtime/ImGuiPlayerLoadouts.hpp"
|
||||||
|
|
||||||
#include "hecl/CVarCommons.hpp"
|
#include "hecl/CVarCommons.hpp"
|
||||||
#include "hecl/CVarManager.hpp"
|
#include "hecl/CVarManager.hpp"
|
||||||
|
@ -33,6 +34,7 @@ class ImGuiConsole {
|
||||||
public:
|
public:
|
||||||
static std::set<TUniqueId> inspectingEntities;
|
static std::set<TUniqueId> inspectingEntities;
|
||||||
static std::array<ImGuiEntityEntry, 1024> entities;
|
static std::array<ImGuiEntityEntry, 1024> entities;
|
||||||
|
static ImGuiPlayerLoadouts loadouts;
|
||||||
|
|
||||||
ImGuiConsole(hecl::CVarManager& cvarMgr, hecl::CVarCommons& cvarCommons)
|
ImGuiConsole(hecl::CVarManager& cvarMgr, hecl::CVarCommons& cvarCommons)
|
||||||
: m_cvarMgr(cvarMgr), m_cvarCommons(cvarCommons) {}
|
: m_cvarMgr(cvarMgr), m_cvarCommons(cvarCommons) {}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <athena/DNA.hpp>
|
||||||
|
#include <athena/DNAYaml.hpp>
|
||||||
|
|
||||||
|
namespace metaforce {
|
||||||
|
struct ImGuiPlayerLoadouts : athena::io::DNA<athena::Endian::Big> {
|
||||||
|
AT_DECL_DNA_YAML
|
||||||
|
struct Item : athena::io::DNA<athena::Endian::Big> {
|
||||||
|
AT_DECL_DNA_YAML
|
||||||
|
String<-1> type;
|
||||||
|
Value<atUint32> amount;
|
||||||
|
};
|
||||||
|
struct LoadOut : athena::io::DNA<athena::Endian::Big> {
|
||||||
|
AT_DECL_DNA_YAML
|
||||||
|
String<-1> name;
|
||||||
|
Value<atUint32> itemCount;
|
||||||
|
Vector<Item, AT_DNA_COUNT(itemCount)> items;
|
||||||
|
};
|
||||||
|
Value<atUint32> loadoutCount;
|
||||||
|
Vector<LoadOut, AT_DNA_COUNT(loadoutCount)> loadouts;
|
||||||
|
};
|
||||||
|
} // namespace metaforce
|
Loading…
Reference in New Issue