mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
add Factorio world gen settings
This commit is contained in:
2
data/factorio/mod_template/data.lua
Normal file
2
data/factorio/mod_template/data.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
{% from "macros.lua" import dict_to_lua %}
|
||||
data.raw["map-gen-presets"].default["archipelago"] = {{ dict_to_lua({"default": False, "order": "a", "basic_settings": world_gen}) }}
|
@@ -1,3 +1,8 @@
|
||||
[map-gen-preset-name]
|
||||
archipelago=Archipelago
|
||||
|
||||
[map-gen-preset-description]
|
||||
archipelago=World preset created by the Archipelago Randomizer. World may or may not contain actual archipelagos.
|
||||
|
||||
[technology-name]
|
||||
{% for original_tech_name, item_name, receiving_player, advancement in locations %}
|
||||
|
@@ -1,10 +1,17 @@
|
||||
{% macro dict_to_lua(dict) -%}
|
||||
{
|
||||
{%- for key, value in dict.items() -%}
|
||||
["{{ key }}"] = {% if value is mapping %}{{ dict_to_lua(value) }}{% else %}{{ value | safe }}{% endif %}{% if not loop.last %},{% endif %}
|
||||
["{{ key }}"] = {{ variable_to_lua(value) }}{% if not loop.last %},{% endif %}
|
||||
{% endfor -%}
|
||||
}
|
||||
{%- endmacro %}
|
||||
{%- macro variable_to_lua(value) %}
|
||||
{%- if value is mapping -%}{{ dict_to_lua(value) }}
|
||||
{%- elif value is boolean -%}{{ value | string | lower }}
|
||||
{%- elif value is string -%} "{{ value | safe }}"
|
||||
{%- else -%} {{ value | safe }}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
{% macro dict_to_recipe(dict) -%}
|
||||
{
|
||||
{%- for key, value in dict.items() -%}
|
||||
|
Reference in New Issue
Block a user