mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Add Tool Gui (#20)
* Update _file_loader.lua * Create tool.lua * Update trains.lua * Update research.lua * Fix use of created_entity in events * Update trains.lua * Update tool.lua * Update research.lua * Update research.lua * Update tool.lua * Update research.lua * Update trains.lua * Fix waterfill locale * Fix bug with selection tools and remote view * Fix tool GUI * Update tool.lua --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
@@ -29,19 +29,19 @@ Selection.on_selection(SelectionName, function(event)
|
||||
local surface = event.surface
|
||||
|
||||
if surface.planet and surface.planet ~= game.planets.nauvis then
|
||||
player.print({ "exp-cods_waterfill.nauvis-only" }, Commands.print_settings.error)
|
||||
player.print({ "exp-commands_waterfill.nauvis-only" }, Commands.print_settings.error)
|
||||
return
|
||||
end
|
||||
|
||||
local area_size = (area.right_bottom.x - area.left_top.x) * (area.right_bottom.y - area.left_top.y)
|
||||
if area_size > 1000 then
|
||||
player.print({ "exp-cods_waterfill.area-too-large", 1000, area_size }, Commands.print_settings.error)
|
||||
player.print({ "exp-commands_waterfill.area-too-large", 1000, area_size }, Commands.print_settings.error)
|
||||
return
|
||||
end
|
||||
|
||||
local item_count = player.get_item_count("cliff-explosives")
|
||||
if item_count < area_size then
|
||||
player.print({ "exp-cods_waterfill.too-few-explosives", area_size, item_count }, Commands.print_settings.error)
|
||||
player.print({ "exp-commands_waterfill.too-few-explosives", area_size, item_count }, Commands.print_settings.error)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -62,8 +62,8 @@ Selection.on_selection(SelectionName, function(event)
|
||||
player.remove_item{ name = "cliff-explosives", count = tile_count - remaining_tiles }
|
||||
|
||||
if remaining_tiles > 0 then
|
||||
player.print({ "exp-cods_waterfill.part-complete", tile_count, remaining_tiles }, Commands.print_settings.default)
|
||||
player.print({ "exp-commands_waterfill.part-complete", tile_count, remaining_tiles }, Commands.print_settings.default)
|
||||
else
|
||||
player.print({ "exp-cods_waterfill.complete", tile_count }, Commands.print_settings.default)
|
||||
player.print({ "exp-commands_waterfill.complete", tile_count }, Commands.print_settings.default)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user