Fixed the bugs with different installation options addition
parent
78f911ab41
commit
b9d4b63a4f
|
@ -224,7 +224,7 @@ def build_xml_code(data, config):
|
||||||
|
|
||||||
with open("./build/sunken_tapes_style.xml", "w+", encoding="utf8") as output_file:
|
with open("./build/sunken_tapes_style.xml", "w+", encoding="utf8") as output_file:
|
||||||
# render the template
|
# render the template
|
||||||
output_file.write(template2.render(tapes=data))
|
output_file.write(template2.render(tapes=data, config=config))
|
||||||
|
|
||||||
|
|
||||||
def deploy(config):
|
def deploy(config):
|
||||||
|
@ -245,9 +245,9 @@ def deploy(config):
|
||||||
build_xml_code(data, config)
|
build_xml_code(data, config)
|
||||||
|
|
||||||
if config["override_workshop"]:
|
if config["override_workshop"]:
|
||||||
mod_directory = "Mods/Sunken Tapes via Installer/"
|
mod_directory = "/Mods/Sunken Tapes/"
|
||||||
else:
|
else:
|
||||||
mod_directory = "Mods/Sunken Tapes/"
|
mod_directory = "/Mods/Sunken Tapez/"
|
||||||
|
|
||||||
logging.info(f"removing the old installed mod directory {config['installdir'] + mod_directory}")
|
logging.info(f"removing the old installed mod directory {config['installdir'] + mod_directory}")
|
||||||
rmfulldir(config["installdir"] + mod_directory)
|
rmfulldir(config["installdir"] + mod_directory)
|
||||||
|
|
18
main.py
18
main.py
|
@ -128,16 +128,26 @@ def create_deploy_frame(container, config):
|
||||||
config_values = {"installdir": config["installdir"].get(),
|
config_values = {"installdir": config["installdir"].get(),
|
||||||
"use_ita": config["use_ita"].get() == "1",
|
"use_ita": config["use_ita"].get() == "1",
|
||||||
"buffs": config["buffs"].get() == "1",
|
"buffs": config["buffs"].get() == "1",
|
||||||
|
"override_workshop": config["override_workshop"].get() == "1",
|
||||||
"resolution_x": int(config["resolution_x"].get()),
|
"resolution_x": int(config["resolution_x"].get()),
|
||||||
"resolution_y": int(config["resolution_x"].get())}
|
"resolution_y": int(config["resolution_y"].get())}
|
||||||
|
|
||||||
logging.info(f"deploying with config: {config_values}")
|
logging.info(f"deploying with config: {config_values}")
|
||||||
deploy(config_values)
|
deploy(config_values)
|
||||||
|
|
||||||
|
if config_values["override_workshop"]:
|
||||||
|
mod_name = "Sunken Tapes"
|
||||||
|
note = ""
|
||||||
|
else:
|
||||||
|
mod_name = "Sunken Tapez"
|
||||||
|
note = '\n\nThis is a custom version and is named with Z (Sunken Tapez) to differentiate it from ' \
|
||||||
|
+ 'the Steam Workshop version that would overwrite it otherwise.'
|
||||||
|
|
||||||
showinfo(title='Success!',
|
showinfo(title='Success!',
|
||||||
message=f'Sunken Tapes was successfully installed to:'
|
message=f'{mod_name} was successfully installed to:'
|
||||||
f'\n{config["installdir"].get()}'
|
f'\n{config["installdir"].get()}'
|
||||||
f'\n\nThis installer will now close.')
|
f'\n\nThis installer will now close.'
|
||||||
|
f'{note}')
|
||||||
|
|
||||||
container.destroy()
|
container.destroy()
|
||||||
|
|
||||||
|
@ -232,7 +242,7 @@ def create_main_window():
|
||||||
"buffs": buffs,
|
"buffs": buffs,
|
||||||
"override_workshop": override_workshop,
|
"override_workshop": override_workshop,
|
||||||
"resolution_x": width,
|
"resolution_x": width,
|
||||||
"resolution_y": height_workshop}
|
"resolution_y": height}
|
||||||
|
|
||||||
deploy_frame = create_deploy_frame(root, config)
|
deploy_frame = create_deploy_frame(root, config)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,40 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<contentpackage name="Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}" path="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/filelist.xml" gameversion="0.14.9.1" {% if config['override_workshop'] %}steamworkshopid="2616577901" {% endif &}corepackage="false">
|
<contentpackage name="Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}" path="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/filelist.xml" gameversion="0.14.9.1" {% if config['override_workshop'] %}steamworkshopid="2616577901" {% endif %}corepackage="false">
|
||||||
<Item file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/sunken_tapes.xml" />
|
<Item file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes.xml" />
|
||||||
<UIStyle file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/sunken_tapes_style.xml" />
|
<UIStyle file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes_style.xml" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/covers.png" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/boombox.png" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes_titletext_ita.png" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes_titletext_vanilla.png" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/08080_canyons_joyride.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/08080_minor_threat.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/bedouin.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/biosphere.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/ddt.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dm.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dmx.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dmxcut.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/hardbass.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/ira.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/immigrantsong.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/java.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/nazare.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rainbowstalin.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/redoctober.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rum.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rusija.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/schritte.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/schritte_08080.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shanty1.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shanty2.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shoegazeprincessa.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/sigma.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/swgd.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/tha.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/urfaust.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/wacky_tape.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_insert_cassette.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_play_cassette.ogg" />
|
||||||
|
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/cassette_drop.ogg" />
|
||||||
</contentpackage>
|
</contentpackage>
|
|
@ -180,7 +180,7 @@
|
||||||
</TitleText>
|
</TitleText>
|
||||||
{% for tape in tapes %}
|
{% for tape in tapes %}
|
||||||
<sunken_tapes_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
|
<sunken_tapes_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
|
||||||
<Sprite name="sunken_tapes_cover_{{ tape.identifier }}" texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
|
<Sprite name="sunken_tapes_cover_{{ tape.identifier }}" texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
|
||||||
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
||||||
|
|
||||||
<ita_document1 color="255,255,255,255" textcolor="0,0,0,255">
|
<ita_document1 color="255,255,255,255" textcolor="0,0,0,255">
|
||||||
|
|
|
@ -180,7 +180,7 @@
|
||||||
</TitleText>
|
</TitleText>
|
||||||
{% for tape in tapes %}
|
{% for tape in tapes %}
|
||||||
<sunken_tapes_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
|
<sunken_tapes_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
|
||||||
<Sprite name="sunken_tapes_cover_{{ tape.identifier }}" texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
|
<Sprite name="sunken_tapes_cover_{{ tape.identifier }}" texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
|
||||||
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
||||||
|
|
||||||
<InnerGlow color="255,255,255,204" hovercolor="255,255,255,204" selectedcolor="255,255,255,204">
|
<InnerGlow color="255,255,255,204" hovercolor="255,255,255,204" selectedcolor="255,255,255,204">
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<Price locationtype="mine" multiplier="1.5" sold="false"/>
|
<Price locationtype="mine" multiplier="1.5" sold="false"/>
|
||||||
</Price>
|
</Price>
|
||||||
<Upgrade gameversion="0.9.2.0" scale="0.5" />
|
<Upgrade gameversion="0.9.2.0" scale="0.5" />
|
||||||
<InventoryIcon texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
|
<InventoryIcon texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
|
||||||
<Sprite texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/boombox.png" sourcerect="0,0,100,60" depth="0.55" origin="0.5,0.5" />
|
<Sprite texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/boombox.png" sourcerect="0,0,100,60" depth="0.55" origin="0.5,0.5" />
|
||||||
<Body width="100" height="60" />
|
<Body width="100" height="60" />
|
||||||
<LightComponent LightColor="0.78,0.04,0.235,0.59" range="10" powerconsumption="0" blinkfrequency="1" IsOn="false" canbeselected="false">
|
<LightComponent LightColor="0.78,0.04,0.235,0.59" range="10" powerconsumption="0" blinkfrequency="1" IsOn="false" canbeselected="false">
|
||||||
</LightComponent>
|
</LightComponent>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<TickBox text="Play">
|
<TickBox text="Play">
|
||||||
<StatusEffect type="OnUse" targettype="This" IsOn="true">
|
<StatusEffect type="OnUse" targettype="This" IsOn="true">
|
||||||
<Conditional IsOn="false" />
|
<Conditional IsOn="false" />
|
||||||
<sound file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
<sound file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
|
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
|
||||||
<Conditional condition="lte 50.0" />
|
<Conditional condition="lte 50.0" />
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
|
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
|
||||||
<Conditional IsOn="true" />
|
<Conditional IsOn="true" />
|
||||||
<sound file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
<sound file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
||||||
<Use />
|
<Use />
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
</TickBox>
|
</TickBox>
|
||||||
|
@ -109,12 +109,12 @@
|
||||||
<Price baseprice="{{ tape.price }}" soldeverywhere="false">{% for location in ["outpost", "city", "research", "military", "mine"] %}
|
<Price baseprice="{{ tape.price }}" soldeverywhere="false">{% for location in ["outpost", "city", "research", "military", "mine"] %}
|
||||||
<Price locationtype="{{ location }}" multiplier="{{ tape.multipliers[loop.index0] }}" sold="{{ tape.sold[loop.index0] }}" minavailable="1" />{% endfor %}
|
<Price locationtype="{{ location }}" multiplier="{{ tape.multipliers[loop.index0] }}" sold="{{ tape.sold[loop.index0] }}" minavailable="1" />{% endfor %}
|
||||||
</Price>
|
</Price>
|
||||||
<InventoryIcon texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" origin="0.5,0.5" />
|
<InventoryIcon texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" origin="0.5,0.5" />
|
||||||
<Sprite texture="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" depth="0.6" origin="0.5,0.5" />
|
<Sprite texture="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" depth="0.6" origin="0.5,0.5" />
|
||||||
<Body width="48" height="48" />
|
<Body width="48" height="48" />
|
||||||
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10" msg="ItemMsgPickUpSelect">
|
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10" msg="ItemMsgPickUpSelect">
|
||||||
<StatusEffect type="OnImpact" target="This" Condition="-5.0" disabledeltatime="true">
|
<StatusEffect type="OnImpact" target="This" Condition="-5.0" disabledeltatime="true">
|
||||||
<sound file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/sound_effects/cassette_drop.ogg" range="500" volume="1.0" />
|
<sound file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/cassette_drop.ogg" range="500" volume="1.0" />
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
</Throwable>
|
</Throwable>
|
||||||
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
|
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />
|
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />
|
||||||
<ItemComponent>
|
<ItemComponent>
|
||||||
<StatusEffect type="Always" target="This">
|
<StatusEffect type="Always" target="This">
|
||||||
<sound file="Mods/Sunken Tapes{% if config['override_workshop'] %} via Installer{% endif %}/music/{{ tape.identifier }}.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
<sound file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/{{ tape.identifier }}.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
||||||
</StatusEffect>{% if tape.buffs %}
|
</StatusEffect>{% if tape.buffs %}
|
||||||
<StatusEffect type="Always" target="NearbyCharacters" range="1000">{% for buff in tape.buffs %}
|
<StatusEffect type="Always" target="NearbyCharacters" range="1000">{% for buff in tape.buffs %}
|
||||||
{% if buff == "psychosis" %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta + 0.1) }}" />{% else %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta*4 + 1) }}" />{% endif %}{% endfor %}
|
{% if buff == "psychosis" %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta + 0.1) }}" />{% else %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta*4 + 1) }}" />{% endif %}{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue