Adding controls.

This commit is contained in:
2025-04-23 13:59:13 -05:00
parent 9126593e51
commit 7d8d8cf7ba

View File

@@ -191,6 +191,11 @@ public:
LoadShader(vert_name, frag_name);
}
using CmdArgs = std::vector<std::string>;
void PositionCmd(const CmdArgs& args) {
}
void CreateMenu() {
using namespace JUI::UDimLiterals;
@@ -227,7 +232,11 @@ public:
console->OnInput += [this] (const std::string& message) {
auto tokens = string_expand(message);
std::string cmd = tokens[0];
// TODO: Remove 0th element from tokens before passing to command delegates.
if (tokens.size() == 0)
{
@@ -253,6 +262,8 @@ public:
return;
}
console->Log("Error: Command syntax is ls <shader-name>", Colors::Red);
} else if (cmd == "pos") {
return PositionCmd(tokens);
} else {
console->Log(std::format("No such command: {}", cmd), Colors::Red);
}
@@ -331,6 +342,11 @@ public:
// TODO: Vary the rate appropriately.
float rate = elapsed * 0.125f;
if (IsKeyDown(Keys::LeftShift))
rate *= 0.125f;
if (IsKeyDown(Keys::LeftControl))
rate *= 0.125f;
if (IsKeyDown(Keys::Minus))
u_scale += rate;