Add command stubs
This commit is contained in:
@@ -125,6 +125,8 @@ namespace CaveGame::ClientApp {
|
||||
bool HelpCommand(const CommandArgs& args);
|
||||
/// Shows a list of every command label.
|
||||
bool ListCommand(const CommandArgs& args);
|
||||
bool TileListCmd(const CommandArgs& args);
|
||||
bool ItemListCmd(const CommandArgs& args);
|
||||
/// Toggles tile simulation if we are
|
||||
bool ToggleTileSim(const CommandArgs& args);
|
||||
|
||||
@@ -179,15 +181,15 @@ namespace CaveGame::ClientApp {
|
||||
{"freecam", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"noclip", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"god", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"fullbright", {"q"}, [this](const auto& args) {}},
|
||||
{"connect", {"q"}, [this](const auto& args) {}},
|
||||
{"disconnect", {"q"}, [this](const auto& args) {}},
|
||||
{"server", {"q"}, [this](const auto& args) {}},
|
||||
{"sandbox", {"q"}, [this](const auto& args) {}},
|
||||
{"crash", {"q"}, [this](const auto& args) {}},
|
||||
{"time", {"q"}, [this](const auto& args) {}},
|
||||
{"juidebug", {"q"}, [this](const auto& args) {}},
|
||||
{"fpslimit", {"fps"}, [this](const auto& args) {
|
||||
{"fullbright", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"connect", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"disconnect", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"server", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"sandbox", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"crash", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"time", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"juidebug", {"q"}, [this](const CommandArgs& args) {}},
|
||||
{"fpslimit", {"fps"}, [this](const CommandArgs& args) {
|
||||
if (args.size() < 2)
|
||||
return Log(std::format("Current FPS Limit: {}fps", max_fps));
|
||||
|
||||
@@ -195,29 +197,34 @@ namespace CaveGame::ClientApp {
|
||||
std::cout << val << std::endl;
|
||||
max_fps = val;
|
||||
}},
|
||||
{"grid", {}, [this](const auto& args) {
|
||||
{"grid", {}, [this](const CommandArgs& args) {
|
||||
if (current_scene == game_ctx)
|
||||
{
|
||||
game_ctx->World()->chunk_debug.Enable(!game_ctx->World()->chunk_debug.IsEnabled());
|
||||
} else
|
||||
Log("Must be in-game to use this command!");
|
||||
}},
|
||||
{"tileactivity", {}, [this](const auto& args) {
|
||||
{"tileactivity", {}, [this](const CommandArgs& args) {
|
||||
if (current_scene == game_ctx)
|
||||
{
|
||||
game_ctx->World()->SetShowTileActivity(!game_ctx->World()->IsShowTileActivityEnabled());
|
||||
} else
|
||||
Log("Must be in-game to use this command!");
|
||||
}},
|
||||
{"save-world", {}, [this](const auto& args) {
|
||||
{"save-world", {}, [this](const CommandArgs& args) {
|
||||
if (InGame())
|
||||
GameSession()->World()->Save();
|
||||
}},
|
||||
{"tile-list", {}, [this](const CommandArgs& args) { return TileListCmd(args); }},
|
||||
{"item-list", {}, [this](const CommandArgs& args) { return ItemListCmd(args); }},
|
||||
{"container", {}, [this](const CommandArgs& args) {
|
||||
|
||||
}}
|
||||
|
||||
};
|
||||
|
||||
Command InvalidCommand {
|
||||
"n/a", {}, [this](const auto& args) {
|
||||
"n/a", {}, [this](const CommandArgs& args) {
|
||||
Log("Nope");
|
||||
}
|
||||
};
|
||||
|
@@ -567,6 +567,28 @@ namespace CaveGame::ClientApp
|
||||
|
||||
void CaveGameWindow::MarkReadyToClose(bool close) { wanna_die = close;}
|
||||
|
||||
bool CaveGameWindow::TileListCmd(const CommandArgs &args) {
|
||||
auto tile_list = Core::GetAllTiles();
|
||||
|
||||
for (Core::Tile* tile : tile_list) {
|
||||
if (tile != nullptr)
|
||||
Log(std::format("ID: {}, Mnemonic: {}, DisplayName: {}", (int)tile->NumericID(), tile->MnemonicID(), tile->Name()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CaveGameWindow::ItemListCmd(const CommandArgs &args) {
|
||||
auto item_list = Core::GetAllItems();
|
||||
|
||||
for (auto [name, item] : item_list) {
|
||||
if (item != nullptr)
|
||||
Log(std::format("Mnemonic: {}", name));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
#include <J3ML/LinearAlgebra/Vector2.hpp>
|
||||
|
||||
|
||||
namespace CaveGame::Core
|
||||
{
|
||||
|
||||
struct Frame {
|
||||
Vector2 origin;
|
||||
Vector2 offset;
|
||||
Vector2 size;
|
||||
//AABB2D quad;
|
||||
};
|
||||
|
||||
/* class KeyframeAnimation
|
||||
{
|
||||
Event<> Began;
|
||||
Event<> Complete;
|
||||
Event<> Paused;
|
||||
Event<> Resumed;
|
||||
Event<> Cancelled;
|
||||
std::vector<Frame> keyframes;
|
||||
float timer;
|
||||
int keyframe_index;
|
||||
};*/
|
||||
|
||||
class AnimatedSprite {
|
||||
public:
|
||||
AnimatedSprite() { }
|
||||
void AddFrame(const std::string& frame_id, const Frame& frame);
|
||||
void SetCurrentFrame();
|
||||
void DrawFrame();
|
||||
void DrawCurrentFrame();
|
||||
|
||||
//void PlayAnimation(const KeyframeAnimation& anim);
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user