-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
6,757 additions
and
2,506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- TODO command systems | ||
---@alias command_table table<string, {text:string, tooltip:string, callback:fun()}> | ||
|
||
---@class CommandManager : Class | ||
local defaults = { | ||
path = "script/vlib/mct/core/commands/", | ||
|
||
---@type table<string, command_table[]> | ||
commands = {}, | ||
} | ||
|
||
---@class CommandManager : Class | ||
local CommandManager = VLib.NewClass("CommandManager", defaults) | ||
|
||
function CommandManager:init() | ||
VLib.LoadModules( | ||
self.path, | ||
"*.lua", | ||
function(filename, this_module) | ||
--- Assign the commands table to self.commands[filename], ie. self.commands[mct_mod] = {commands = {command_a,}} etc. | ||
|
||
---= self.commands.mct_mod_commands = {command_a} | ||
self.commands[filename.."_commands"] = this_module | ||
|
||
common.set_context_value(filename.."_commands", {commands = self.commands[filename.."_commands"]}) | ||
end | ||
) | ||
end | ||
|
||
return CommandManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- MCT.Mod contextual commands. | ||
|
||
---@type command_table[] | ||
return { | ||
revert_to_defaults = { | ||
text = "Revert to Defaults", | ||
tooltip = "My tooltip", | ||
---@param mod_obj MCT.Mod | ||
callback = function(mod_obj) mod_obj:revert_to_defaults() end, | ||
} | ||
} |
Empty file.
Empty file.
Oops, something went wrong.