-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try a more modding-friendly way of adding commands.
- Loading branch information
1 parent
638f8b2
commit efc1f87
Showing
12 changed files
with
122 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hotspot topleft | ||
frame cursortechup_0.png 5 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
|
||
local data = { | ||
name = "TECH_UP", | ||
cmdID = 38412, | ||
|
||
commandType = CMDTYPE.ICON_UNIT_OR_AREA, | ||
isState = false, -- Hold fire etc | ||
isInstant = false, -- Such as Stop, Self-D etc | ||
humanName = "Tech Up", | ||
actionName = "techup", | ||
cursor = "Techup", | ||
image = "LuaUI/Images/commands/Bold/tech_up.png", -- If a state, then this should be a list of images. | ||
|
||
onCommandMenuByDefault = true, | ||
position = {pos = 7, priority = 0.1}, | ||
stateNames = nil, -- A list of what the states are called. | ||
stateTooltip = nil, -- A list of tooltips to use for each state. | ||
tooltip = "Tech Up: Upgrade the constructor's factory to the next tech level, or any other structure to the current tech level.", | ||
} | ||
|
||
return data |
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,20 @@ | ||
|
||
local commands = {} | ||
local commandsMap = {} | ||
local commandFiles = VFS.DirList('LuaRules/Configs/ModCommands') | ||
for i = 1, #commandFiles do | ||
local fileData = VFS.Include(commandFiles[i]) | ||
fileData.cmdDesc = { | ||
id = fileData.cmdID, | ||
type = fileData.commandType, | ||
tooltip = fileData.name, -- Overridden by luaUI | ||
name = fileData.humanName, | ||
cursor = fileData.cursor, | ||
action = fileData.actionName, | ||
params = {}, | ||
} | ||
commands[#commands + 1] = fileData | ||
commandsMap[fileData.cmdID] = fileData | ||
end | ||
|
||
return commands, commandsMap |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.