Update z3ed CLI tool and project build configuration
- Updated `.clang-tidy` and `.clangd` configurations for improved code quality checks and diagnostics. - Added new submodules for JSON and HTTP libraries to support future features. - Refined README and documentation files to standardize naming conventions and improve clarity. - Introduced a new command palette in the CLI for easier command access and execution. - Implemented various CLI handlers for managing ROM, sprites, palettes, and dungeon functionalities. - Enhanced the TUI components for better user interaction and command execution. - Added AI service integration for generating commands based on user prompts, expanding the CLI's capabilities.
This commit is contained in:
30
src/cli/handlers/sprite.cc
Normal file
30
src/cli/handlers/sprite.cc
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "cli/z3ed.h"
|
||||
#include "app/zelda3/sprite/sprite_builder.h"
|
||||
#include "absl/flags/flag.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
|
||||
absl::Status SpriteCreate::Run(const std::vector<std::string>& arg_vec) {
|
||||
if (arg_vec.size() < 2 || arg_vec[0] != "--name") {
|
||||
return absl::InvalidArgumentError("Usage: sprite create --name <sprite_name>");
|
||||
}
|
||||
|
||||
std::string sprite_name = arg_vec[1];
|
||||
|
||||
// Create a simple sprite with a single action
|
||||
auto builder = zelda3::SpriteBuilder::Create(sprite_name)
|
||||
.SetProperty("!Health", 1)
|
||||
.SetProperty("!Damage", 2)
|
||||
.AddAction(zelda3::SpriteAction::Create("MAIN")
|
||||
.AddInstruction(zelda3::SpriteInstruction::ApplySpeedTowardsPlayer(1))
|
||||
.AddInstruction(zelda3::SpriteInstruction::MoveXyz())
|
||||
);
|
||||
|
||||
std::cout << builder.Build() << std::endl;
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
Reference in New Issue
Block a user