Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions scripts/utils_customElements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
--- Module API description:
--- * customElements:modifyOperatorPositions(operator_key, position_list) = Modify ECrewPositions for specified station
--- * customElements:closeAllMessagesUponClose(boolean_value) = change closing behavior
--- * customElements:addCustomButton(player_ship, operator, name, caption, callback) = wrapper around PlayerSpaceship:addCustomButton
--- * customElements:addCustomInfo(player_ship, operator, name, caption) = wrapper around PlayerSpaceship:addCustomInfo
--- * customElements:addCustomButton(player_ship, operator, name, caption, callback, order) = wrapper around PlayerSpaceship:addCustomButton
--- * customElements:addCustomInfo(player_ship, operator, name, caption, order) = wrapper around PlayerSpaceship:addCustomInfo
--- * customElements:addCustomMessage(player_ship, operator, name, caption) = wrapper around PlayerSpaceship:addCustomMessage
--- * customElements:addCustomMessageWithCallback(player_ship, operator, name, caption, callback) = wrapper around PlayerSpaceship:addCustomMessageWithCallback
--- * customElements:removeCustom(player_ship, name) = wrapper around PlayerSpaceship:removeCustom
Expand Down Expand Up @@ -75,9 +75,10 @@ end
-- @param name: String identifier of the button (parameter of PlayerShip:addCustomButton)
-- @param caption: Label of the button (parameter of PlayerShip:addCustomButton)
-- @param callback: Callback function to be run when button is pressed (parameter of PlayerShip:addCustomButton)
function customElements:addCustomButton(player_ship, operator, name, caption, callback)
-- @param order: Use the order value to specify a priority (parameter of PlayerShip:addCustomButton)
function customElements:addCustomButton(player_ship, operator, name, caption, callback, order)
for idx, station in ipairs(self:operatorPositions(operator)) do
player_ship:addCustomButton(station, name..station, caption, callback)
player_ship:addCustomButton(station, name..station, caption, callback, order)
end
end

Expand All @@ -86,9 +87,10 @@ end
-- @param operator: String identification of operator.
-- @param name: String identifier of the message (parameter of PlayerShip:addCustomInfo)
-- @param caption: Text content of the info field (parameter of PlayerShip:addCustomInfo)
function customElements:addCustomInfo(player_ship, operator, name, caption)
-- @param order: Use the order value to specify a priority (parameter of PlayerShip:addCustomInfo)
function customElements:addCustomInfo(player_ship, operator, name, caption, order)
for idx, station in ipairs(self:operatorPositions(operator)) do
player_ship:addCustomInfo(station, name..station, caption)
player_ship:addCustomInfo(station, name..station, caption, order)
end
end

Expand Down
Loading