diff --git a/SeaBlock/changelog.txt b/SeaBlock/changelog.txt index c8cd2f0..859e1fe 100644 --- a/SeaBlock/changelog.txt +++ b/SeaBlock/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.5.17 +Date: ??.??.?? + Changes: + - Added custom Better Victory Screen statistics #323 +--------------------------------------------------------------------------------------------------- Version: 0.5.16 Date: 27.02.2024 Changes: @@ -577,4 +582,4 @@ Date: 8. 1. 2018 - Disable bobplates cheaper steel - Reduce number of beacon module slots. Two modules per beacon regardless of level. - Undo boblogistics changes to logistic-system technology. High tech and production science packs restored. - - Add setting for changing ScienceCostTweaker multiplier when SpaceMod is present. \ No newline at end of file + - Add setting for changing ScienceCostTweaker multiplier when SpaceMod is present. diff --git a/SeaBlock/info.json b/SeaBlock/info.json index c68ce71..8497c40 100644 --- a/SeaBlock/info.json +++ b/SeaBlock/info.json @@ -1,6 +1,6 @@ { "name": "SeaBlock", - "version": "0.5.16", + "version": "0.5.17", "factorio_version": "1.1", "title": "Sea Block", "author": "Trainwreck", diff --git a/SeaBlock/locale/en/SeaBlock.cfg b/SeaBlock/locale/en/SeaBlock.cfg index febec98..deeb742 100644 --- a/SeaBlock/locale/en/SeaBlock.cfg +++ b/SeaBlock/locale/en/SeaBlock.cfg @@ -62,3 +62,10 @@ sb-default-landfill-landfill-grass-1=[img=item/landfill-grass-1]Grass sb-default-landfill-landfill=[img=item/landfill]Landfill sb-default-landfill-landfill-red-desert-1=[img=item/landfill-red-desert-1]Red desert sb-default-landfill-landfill-sand-3=[img=item/landfill-sand-3]Sand + +[bvs-stats] +mineral-sludge-consumed=Mineral sludge consumed +landfill-count=Landfill placed + +[bvs-stat-tooltip] +landfill-count=The amount of non-water tiles that currently exists. Includes generated islands. diff --git a/SeaBlock/remote.lua b/SeaBlock/remote.lua index f2c6dad..228736b 100644 --- a/SeaBlock/remote.lua +++ b/SeaBlock/remote.lua @@ -221,6 +221,31 @@ local function get_jetpack_fuels() return { ["enriched-fuel"] = 0.7 } end +---@param winning_force LuaForce +---@param forces LuaForce[] list of forces that GUI will be show to +local function better_victory_screen_statistics(winning_force, forces) + + -- Landfil is common to all forces. To prevent having to check which + -- tiles can be used for landfil, and handle paving, etc, we will only + -- count non-water tiles according to the collision masks. + local landfill_count = game.surfaces.nauvis.count_tiles_filtered{collision_mask="water-tile", invert=true} + + local stats_by_force = { } + for _, force in pairs(forces) do + local get_output_fluid_count = force.fluid_production_statistics.get_output_count + stats_by_force[force.name] = { + ["production"] = { stats = { + ["mineral-sludge-consumed"] = { value = get_output_fluid_count("mineral-sludge"), order="b" }, + ["ores-produced"] = { ignore = true }, -- Cannot mine ores + }}, + ["infrastructure"] = { stats = { + ["landfill-count"] = {value = landfill_count , order = "i", has_tooltip=true} + }} + } + end + return { by_force = stats_by_force } +end + remote.add_interface("SeaBlock", { get_unlocks = get_unlocks, set_unlock = set_unlock, @@ -229,4 +254,5 @@ remote.add_interface("SeaBlock", { set_starting_items = set_starting_items, milestones_presets = milestones_presets, jetpack_fuels = get_jetpack_fuels, + ["better-victory-screen-statistics"] = better_victory_screen_statistics, })