Surface Property Viewer

by tanvec

Allow you to view the properties of the surface, without turning to factoriopedia. Maybe useful when other mods change the surface property at run time.

Utilities
3 months ago
2.0
63
Owner:
tanvec
Source:
https://github.com/cyx2015s/factorio-...
Homepage:
N/A
License:
MIT
Created:
4 months ago
Latest Version:
0.2.4 (3 months ago)
Factorio version:
2.0
Downloaded by:
63 users

Overview

This is a mod that allow you to view the current properties of the viewing surface.

Scripting

Technically, all surface_properties are number types, but some mods encode other data in number form, and the number itself doesn't mean anything. You can register a localiser function to define the way a surface property is displayed. For example, you can test with the following code at run time:

remote.add_interface(
    "test_i",
    {
        test_f = function(value)
            return math.floor(value / 10) / 100 .. "bar"
        end
    }
)

remote.call(
    "spv",
    "set_localiser",
    {
        surface_property = "pressure",
        remote_interface = "test_i",
        localiser = "test_f",
    }
)

You can check the pressure at top left, it now displays the pressure in bar instead of hPa.

TODO

  • <input disabled type="checkbox"> Auto detect surface properties that are intended to be hidden, and/or add another remote interface to hide them.