forked from cacklingfiend/lignumis
You can't leave Lignumis before researching Nauvis discovery
This commit is contained in:
parent
dca8ae4ec8
commit
675136ee06
2 changed files with 10 additions and 4 deletions
|
|
@ -15,11 +15,16 @@ local function build_gui(player, rocket_silo)
|
|||
local launch_button = { type = "button", name = "provisional-rocket-silo-launch-button", caption = { "lignumis.provisional-rocket-silo-button" } }
|
||||
|
||||
local inventory = player.get_main_inventory()
|
||||
launch_button.enabled = inventory.is_empty()
|
||||
if not launch_button.enabled then
|
||||
launch_button.tooltip = { "lignumis.provisional-rocket-silo-button-tooltip" }
|
||||
local is_inventory_empty = inventory.is_empty()
|
||||
local is_nauvis_researched = player.force.technologies["planet-discovery-nauvis"].researched
|
||||
launch_button.enabled = is_inventory_empty and is_nauvis_researched
|
||||
if not is_inventory_empty then
|
||||
launch_button.tooltip = { "lignumis.provisional-rocket-silo-button-tooltip-inventory" }
|
||||
elseif not is_nauvis_researched then
|
||||
launch_button.tooltip = { "lignumis.provisional-rocket-silo-button-tooltip-nauvis" }
|
||||
end
|
||||
|
||||
|
||||
storage.rocket_silo_guis = storage.rocket_silo_guis or {}
|
||||
storage.rocket_silo_guis[player.index] = {
|
||||
fake_silo = rocket_silo,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue