fixed the naming for custom mod

master
Jaka Perovšek 2021-11-14 21:20:03 +01:00
parent e897c861f2
commit 610b260e0b
5 changed files with 14 additions and 40 deletions

View File

@ -218,7 +218,7 @@ def build_xml_code(data, config):
logging.info(f"rendering the xml files")
with open("./build/filelist.xml", "w+", encoding="utf8") as output_file:
# render the template
output_file.write(template0.render(config=config))
output_file.write(template0.render(config=config, tapes=data))
with open(f"./build/{config['slug']}.xml", "w+", encoding="utf8") as output_file:
# render the template

View File

@ -1,38 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
{% if config['slug'] != "Sunken Tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
<contentpackage name="{{ config['name'] }}" path="Mods/{{ config['name'] }}/filelist.xml" gameversion="0.14.9.1" {% if config['slug'] == "Sunken Tapes" %}steamworkshopid="2616577901" {% endif %}corepackage="false">
{% if config['slug'] != "sunken_tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
<contentpackage name="{{ config['name'] }}" path="Mods/{{ config['name'] }}/filelist.xml" corepackage="false" gameversion="0.15.12.0" {% if config['slug'] == "Sunken Tapes" %}steamworkshopid="2616577901"{% endif %}>
<Item file="Mods/{{ config['name'] }}/{{ config['slug'] }}.xml" />
<UIStyle file="Mods/{{ config['name'] }}/{{ config['slug'] }}_style.xml" />
<None file="Mods/{{ config['name'] }}/icons.png" />
<None file="Mods/{{ config['name'] }}/covers.png" />
<None file="Mods/{{ config['name'] }}/boombox.png" />
<None file="Mods/{{ config['name'] }}/music/08080_canyons_joyride.ogg" />
<None file="Mods/{{ config['name'] }}/music/08080_minor_threat.ogg" />
<None file="Mods/{{ config['name'] }}/music/bedouin.ogg" />
<None file="Mods/{{ config['name'] }}/music/biosphere.ogg" />
<None file="Mods/{{ config['name'] }}/music/ddt.ogg" />
<None file="Mods/{{ config['name'] }}/music/dm.ogg" />
<None file="Mods/{{ config['name'] }}/music/dmx.ogg" />
<None file="Mods/{{ config['name'] }}/music/dmxcut.ogg" />
<None file="Mods/{{ config['name'] }}/music/hardbass.ogg" />
<None file="Mods/{{ config['name'] }}/music/ira.ogg" />
<None file="Mods/{{ config['name'] }}/music/immigrantsong.ogg" />
<None file="Mods/{{ config['name'] }}/music/java.ogg" />
<None file="Mods/{{ config['name'] }}/music/nazare.ogg" />
<None file="Mods/{{ config['name'] }}/music/rainbowstalin.ogg" />
<None file="Mods/{{ config['name'] }}/music/redoctober.ogg" />
<None file="Mods/{{ config['name'] }}/music/rum.ogg" />
<None file="Mods/{{ config['name'] }}/music/rusija.ogg" />
<None file="Mods/{{ config['name'] }}/music/schritte.ogg" />
<None file="Mods/{{ config['name'] }}/music/schritte_08080.ogg" />
<None file="Mods/{{ config['name'] }}/music/shanty1.ogg" />
<None file="Mods/{{ config['name'] }}/music/shanty2.ogg" />
<None file="Mods/{{ config['name'] }}/music/shoegazeprincessa.ogg" />
<None file="Mods/{{ config['name'] }}/music/sigma.ogg" />
<None file="Mods/{{ config['name'] }}/music/swgd.ogg" />
<None file="Mods/{{ config['name'] }}/music/tha.ogg" />
<None file="Mods/{{ config['name'] }}/music/urfaust.ogg" />
<None file="Mods/{{ config['name'] }}/music/wacky_tape.ogg" />
<None file="Mods/{{ config['name'] }}/boombox.png" />{% for tape in tapes %}
<None file="Mods/{{ config['name'] }}/music/{{ tape["identifier"] }}.ogg" />{% endfor %}
<None file="Mods/{{ config['name'] }}/sound_effects/boombox_insert_cassette.ogg" />
<None file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" />
<None file="Mods/{{ config['name'] }}/sound_effects/cassette_drop.ogg" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
{% if config['slug'] != "Sunken Tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
{% if config['slug'] != "sunken_tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
<Override>
<style>
<!--

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
{% if config['slug'] != "Sunken Tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
{% if config['slug'] != "sunken_tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
<Override>
<style>
<!--

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
{% if config['slug'] != "Sunken Tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
{% if config['slug'] != "sunken_tapes" %}<!--This mod is based on Sunken Tapes. See https://git.kompot.si/jaka/barotrauma-sunken-tapes and https://steamcommunity.com/sharedfiles/filedetails/?id=2616577901 for the source material and code generator.-->{% else %}<!--Code licensed under GPLv3 and generated with a script available at https://git.kompot.si/jaka/barotrauma-sunken-tapes-->{% endif %}
<Items>
<Item name="Boombox" cargocontaineridentifier="metalcrate" identifier="boombox" category="Equipment" Tags="mediumitem,boombox" scale="0.5" description="" price="850" impactsoundtag="impact_metal_light" isshootable="true">
<Item name="Boombox" cargocontaineridentifier="metalcrate" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}boombox" category="Equipment" Tags="mediumitem,boombox" scale="0.5" description="" price="850" impactsoundtag="impact_metal_light" isshootable="true">
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.1"/>
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
<Price baseprice="500" soldeverywhere="false">
@ -43,8 +43,8 @@
</StatusEffect-->
{% for tape in tapes %}
<StatusEffect type="OnUse" targettype="Contained" condition="-{{ condition_delta[loop.index0] }}">
<RequiredItem items="cassette-{{ tape.identifier }}" type="Contained" />
<SpawnItem identifiers="song-{{ tape.identifier }}" spawnposition="ContainedInventory" />
<RequiredItem items="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-{{ tape.identifier }}" type="Contained" />
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" spawnposition="ContainedInventory" />
</StatusEffect>{% endfor %}
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
@ -67,7 +67,7 @@
<!-- tape box -->
<Item name="Cassette Tape Box" identifier="cassette-tape-box" category="Equipment" tags="smallitem,mobilecontainer,tool" cargocontaineridentifier="" showcontentsintooltip="true" Scale="0.5" fireproof="true" description="" impactsoundtag="impact_metal_heavy">
<Item name="Cassette Tape Box" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-tape-box" category="Equipment" tags="smallitem,mobilecontainer,tool" cargocontaineridentifier="" showcontentsintooltip="true" Scale="0.5" fireproof="true" description="" impactsoundtag="impact_metal_heavy">
<PreferredContainer secondary="wreckstoragecab" spawnprobability="0.06"/>
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.2"/>
<Deconstruct time="10">
@ -103,7 +103,7 @@
<!-- Cassette Tapes -->
{% for tape in tapes %}
<Item name="Tape: {{ tape.name }}" identifier="cassette-{{ tape.identifier }}" category="Equipment" maxstacksize="8" Tags="smallitem,cassette" cargocontaineridentifier="metalcrate" scale="0.5" isshootable="true" impacttolerance="1.3">
<Item name="Tape: {{ tape.name }}" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-{{ tape.identifier }}" category="Equipment" maxstacksize="8" Tags="smallitem,cassette" cargocontaineridentifier="metalcrate" scale="0.5" isshootable="true" impacttolerance="1.3">
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.05"/>
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.05"/>
<Price baseprice="{{ tape.price }}" soldeverywhere="false">{% for location in ["outpost", "city", "research", "military", "mine"] %}
@ -145,7 +145,7 @@
<!-- SONGS -->
{% for tape, delta in zip(tapes, affliction_delta) %}
<Item name="Song: {{ tape.name }}" identifier="song-{{ tape.identifier }}" Tags="song" category="Misc">
<Item name="Song: {{ tape.name }}" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" Tags="song" category="Misc">
<Sprite texture="Content/Items/Electricity/signalcomp.png" depth="0.8" sourcerect="0,160,4,4" origin="0.5,0.5" />
<Body width="48" height="48" />
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />