yahh
This commit is contained in:
parent
d2176afff9
commit
ecb2998462
4 changed files with 53 additions and 12 deletions
|
@ -9,6 +9,22 @@ namespace CruelMan.Modules {
|
|||
public void Awake() {
|
||||
instance = this;
|
||||
AddModules();
|
||||
new Terminal.ConsoleCommand($"cmbind", "binds a module to a key", delegate (Terminal.ConsoleEventArgs args) {
|
||||
if (args.Args.Length < 2) {
|
||||
args.Context.AddString("Usage: cmbind <module> <key>");
|
||||
return;
|
||||
}
|
||||
string module = args.Args[1];
|
||||
string key = args.Args[2];
|
||||
foreach (Module m in modules) {
|
||||
if (m.Command == module.ToLower()) {
|
||||
m.bind = (KeyCode)System.Enum.Parse(typeof(KeyCode), key);
|
||||
args.Context.AddString($"Bound {module} to {key}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
args.Context.AddString($"Module {module} not found");
|
||||
});
|
||||
}
|
||||
|
||||
public void Update() {
|
||||
|
@ -27,6 +43,7 @@ namespace CruelMan.Modules {
|
|||
AddModule<Speed>();
|
||||
AddModule<JumpHeight>();
|
||||
AddModule<InstantDmg>();
|
||||
AddModule<SwimSpeed>();
|
||||
}
|
||||
|
||||
private void AddModule<T>() where T : Module, new() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue