Added the custom naming option, included the license information in the sources.

master
Jaka Perovšek 2021-10-11 19:05:02 +02:00
parent 8fcf1b8b16
commit 95e85dd57a
6 changed files with 153 additions and 83 deletions

View File

@ -210,13 +210,13 @@ def build_xml_code(data, config):
# render the template
output_file.write(template0.render(config=config))
with open("./build/sunken_tapes.xml", "w+", encoding="utf8") as output_file:
with open(f"./build/{config['slug']}.xml", "w+", encoding="utf8") as output_file:
# render the template
output_file.write(template1.render(tapes=data, config=config,
condition_delta=condition_delta,
affliction_delta=affliction_delta))
with open("./build/sunken_tapes_style.xml", "w+", encoding="utf8") as output_file:
with open(f"./build/{config['slug']}_style.xml", "w+", encoding="utf8") as output_file:
# render the template
output_file.write(template2.render(tapes=data, config=config))
@ -225,6 +225,10 @@ def deploy(config):
try:
os.mkdir('./build')
except FileExistsError:
logging.info(f"removing old XML files in ./build/:")
for f in Path('./build/').glob("*.xml"):
logging.info(f" {f}")
os.remove(f)
pass
logging.info("Reading tapes.yaml")
@ -238,10 +242,7 @@ def deploy(config):
prepare_images(data, config)
build_xml_code(data, config)
if config["override_workshop"]:
mod_directory = "/Mods/Sunken Tapes/"
else:
mod_directory = "/Mods/Sunken Tapez/"
mod_directory = f"/Mods/{config['slug']}/"
logging.info(f"removing the old installed mod directory {config['installdir'] + mod_directory}")
rmfulldir(config["installdir"] + mod_directory)

116
main.py
View File

@ -8,6 +8,25 @@ from pathlib import Path
from deploy import download_ffmpeg, download_git, deploy, get_ffmpeg_version, update
import logging
import sys
import re
import unicodedata
def slugify(value, allow_unicode=False):
"""
Taken from https://github.com/django/django/blob/master/django/utils/text.py
Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated
dashes to single dashes. Remove characters that aren't alphanumerics,
underscores, or hyphens. Convert to lowercase. Also strip leading and
trailing whitespace, dashes, and underscores.
"""
value = str(value)
if allow_unicode:
value = unicodedata.normalize('NFKC', value)
else:
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
value = re.sub(r'[^\w\s-]', '', value.lower())
return re.sub(r'[-\s]+', '-', value).strip('-_')
def get_curr_screen_geometry():
@ -28,6 +47,63 @@ def get_curr_screen_geometry():
return geometry
def create_name_frame(container):
frame = ttk.LabelFrame(container, text='Mod Name')
# Override Workshop checkbox
override_workshop = tk.StringVar()
override_workshop.set("0")
override_workshop_check = ttk.Checkbutton(
frame,
variable=override_workshop,
text='Override Workshop',
command=lambda: override_action())
override_workshop_check.pack(side="left", padx=3, pady=3)
name = tk.StringVar()
name.set("Sunken Tapez")
name_entry = ttk.Entry(frame, width=30, textvariable=name)
name_entry.pack(side="left", padx=3, pady=3, expand=True, fill="x")
slug = tk.StringVar()
slug.set(slugify("Sunken Tapez"))
slug_entry = ttk.Entry(frame, width=30, textvariable=slug)
slug_entry["state"] = "disable"
slug_entry.pack(side="left", padx=3, pady=3, expand=True, fill="x")
Hovertip(override_workshop_check,
'Keep this unchecked to prevent Steam Workshop'
'\noverriding your custom installation.'
'\n\nIt exists only for the author\'s convenience.')
Hovertip(name_entry,
'Name of the deploy mod. You can customise this'
'\nif you want to create your own version.')
Hovertip(slug_entry,
'Slug of the deployed mod name that is'
'\nused for file paths and references.')
def update_slug(*args):
slug.set(slugify(name.get()))
name.trace("w", update_slug)
def override_action():
if override_workshop.get() == "1":
name.set("Sunken Tapes")
name_entry["state"] = "disable"
slug.set("Sunken Tapes")
elif override_workshop.get() == "0":
name.set("Sunken Tapez")
name_entry["state"] = "normal"
return frame, name, slug
def create_install_frame(container):
def find_barotrauma_directory():
first_guess = Path("C:/Program Files (x86)/Steam/steamapps/common/Barotrauma")
@ -83,15 +159,6 @@ def create_options_frame(container):
text='Buffs',
command=lambda: print(buffs.get()))
# Override Workshop checkbox
override_workshop = tk.StringVar()
override_workshop.set("0")
override_workshop_check = ttk.Checkbutton(
frame,
variable=override_workshop,
text='Override Workshop',
command=lambda: print(override_workshop.get()))
Hovertip(use_ita_check,
'Check this box if you use Into The Abyss mod.'
'\nITA and Sunken Tapes override the same style file.')
@ -100,14 +167,10 @@ def create_options_frame(container):
'Check this box to enable some songs causing strange effects'
'\nThis is the intended default behaviour.')
Hovertip(override_workshop_check,
'Keep this unchecked to prevent Steam Workshop'
'\noverriding your custom installation.')
for widget in frame.winfo_children():
widget.pack(side="top", padx=3, pady=3, fill="x")
return frame, use_ita, buffs, override_workshop
return frame, use_ita, buffs
def create_resolution_frame(container):
@ -141,24 +204,24 @@ def create_deploy_frame(container, config):
config_values = {"installdir": config["installdir"].get(),
"use_ita": config["use_ita"].get() == "1",
"buffs": config["buffs"].get() == "1",
"override_workshop": config["override_workshop"].get() == "1",
"name": config["name"].get(),
"slug": config["slug"].get(),
"resolution_x": int(config["resolution_x"].get()),
"resolution_y": int(config["resolution_y"].get())}
logging.info(f"deploying with config: {config_values}")
deploy(config_values)
if config_values["override_workshop"]:
mod_name = "Sunken Tapes"
note = ""
if config_values["name"] != "Sunken Tapes":
note = f'\n\nThis is a custom version and is named {config_values["name"]} to differentiate it from ' \
+ 'the Steam Workshop version that would overwrite it otherwise.' \
+ '\n\nPlease include a link to the original mod if you publish it to Steam Workshop.'
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.'
note = ""
showinfo(title='Success!',
message=f'{mod_name} was successfully installed to:'
f'\n{config["installdir"].get()}'
message=f'{config_values["name"]} was successfully installed to:'
f'\n\n{config_values["installdir"]}/Mods/{config_values["slug"]}'
f'\n\nThis installer will now close.'
f'{note}')
@ -246,19 +309,22 @@ def create_main_window():
root.title('Sunken Tapes')
middle_frame = ttk.Frame(root)
name_frame, name, slug = create_name_frame(root)
install_frame, install_dir = create_install_frame(root)
options_frame, use_ita, buffs, override_workshop = create_options_frame(middle_frame)
options_frame, use_ita, buffs = create_options_frame(middle_frame)
resolution_frame, width, height = create_resolution_frame(middle_frame)
config = {"installdir": install_dir,
"use_ita": use_ita,
"buffs": buffs,
"override_workshop": override_workshop,
"name": name,
"slug": slug,
"resolution_x": width,
"resolution_y": height}
deploy_frame = create_deploy_frame(root, config)
name_frame.pack(side="top", fill="x", pady=3, padx=3)
install_frame.pack(side="top", fill="x", pady=3, padx=3)
options_frame.pack(side="left", fill="y", pady=3, padx=3)
resolution_frame.pack(side="left", fill="both", pady=3, padx=3, expand=True)

View File

@ -1,38 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<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 Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes.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 %}/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" />
{% 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['slug'] }}/filelist.xml" gameversion="0.14.9.1" {% if config['slug'] == "Sunken Tapes" %}steamworkshopid="2616577901" {% endif %}corepackage="false">
<Item file="Mods/{{ config['slug'] }}/{{ config['slug'] }}.xml" />
<UIStyle file="Mods/{{ config['slug'] }}/{{ config['slug'] }}_style.xml" />
<None file="Mods/{{ config['slug'] }}/icons.png" />
<None file="Mods/{{ config['slug'] }}/covers.png" />
<None file="Mods/{{ config['slug'] }}/boombox.png" />
<None file="Mods/{{ config['slug'] }}/music/08080_canyons_joyride.ogg" />
<None file="Mods/{{ config['slug'] }}/music/08080_minor_threat.ogg" />
<None file="Mods/{{ config['slug'] }}/music/bedouin.ogg" />
<None file="Mods/{{ config['slug'] }}/music/biosphere.ogg" />
<None file="Mods/{{ config['slug'] }}/music/ddt.ogg" />
<None file="Mods/{{ config['slug'] }}/music/dm.ogg" />
<None file="Mods/{{ config['slug'] }}/music/dmx.ogg" />
<None file="Mods/{{ config['slug'] }}/music/dmxcut.ogg" />
<None file="Mods/{{ config['slug'] }}/music/hardbass.ogg" />
<None file="Mods/{{ config['slug'] }}/music/ira.ogg" />
<None file="Mods/{{ config['slug'] }}/music/immigrantsong.ogg" />
<None file="Mods/{{ config['slug'] }}/music/java.ogg" />
<None file="Mods/{{ config['slug'] }}/music/nazare.ogg" />
<None file="Mods/{{ config['slug'] }}/music/rainbowstalin.ogg" />
<None file="Mods/{{ config['slug'] }}/music/redoctober.ogg" />
<None file="Mods/{{ config['slug'] }}/music/rum.ogg" />
<None file="Mods/{{ config['slug'] }}/music/rusija.ogg" />
<None file="Mods/{{ config['slug'] }}/music/schritte.ogg" />
<None file="Mods/{{ config['slug'] }}/music/schritte_08080.ogg" />
<None file="Mods/{{ config['slug'] }}/music/shanty1.ogg" />
<None file="Mods/{{ config['slug'] }}/music/shanty2.ogg" />
<None file="Mods/{{ config['slug'] }}/music/shoegazeprincessa.ogg" />
<None file="Mods/{{ config['slug'] }}/music/sigma.ogg" />
<None file="Mods/{{ config['slug'] }}/music/swgd.ogg" />
<None file="Mods/{{ config['slug'] }}/music/tha.ogg" />
<None file="Mods/{{ config['slug'] }}/music/urfaust.ogg" />
<None file="Mods/{{ config['slug'] }}/music/wacky_tape.ogg" />
<None file="Mods/{{ config['slug'] }}/sound_effects/boombox_insert_cassette.ogg" />
<None file="Mods/{{ config['slug'] }}/sound_effects/boombox_play_cassette.ogg" />
<None file="Mods/{{ config['slug'] }}/sound_effects/cassette_drop.ogg" />
</contentpackage>

View File

@ -1,4 +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 %}
<Override>
<style>
<!--
@ -179,9 +180,9 @@
</Sprite>
</TitleText>
{% for tape in tapes %}
<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 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 %}
<{{ config['slug'] }}_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
<Sprite name="{{ config['slug'] }}_cover_{{ tape.identifier }}" texture="Mods/{{ config['slug'] }}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
</{{ config['slug'] }}_cover_{{ tape.identifier }}>{% endfor %}
<ita_document1 color="255,255,255,255" textcolor="0,0,0,255">
<Sprite name="ita_document1" texture="Mods/IntoTheAbyss/Content/Sprites/ita_document_s-3.2a.png" size="0.0, 0.0" sourcerect="0,0,576,600" origin="0.5,0.5" compress="false" tile="false"/>

View File

@ -1,4 +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 %}
<Override>
<style>
<!--
@ -181,9 +182,9 @@
</Sprite>
</TitleText>
{% for tape in tapes %}
<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 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 %}
<{{ config['slug'] }}_cover_{{ tape.identifier }} color="255,255,255,255" textcolor="0,0,0,255">
<Sprite name="{{ config['slug'] }}_cover_{{ tape.identifier }}" texture="Mods/{{ config['slug'] }}/covers.png" size="0.0, 0.0" sourcerect="0,{{ loop.index0*328 }},512,328" origin="0.5,0.5" compress="false" tile="false"/>
</{{ config['slug'] }}_cover_{{ tape.identifier }}>{% endfor %}
<InnerGlow color="255,255,255,204" hovercolor="255,255,255,204" selectedcolor="255,255,255,204">
<Sprite texture="Content/UI/InnerGlow.png" sourcerect="0,0,512,384" slice="128,128,384,256" />

View File

@ -1,6 +1,6 @@
<?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 %}
<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">
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.1"/>
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
@ -12,8 +12,8 @@
<Price locationtype="mine" multiplier="1.5" sold="false"/>
</Price>
<Upgrade gameversion="0.9.2.0" scale="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 Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/boombox.png" sourcerect="0,0,100,60" depth="0.55" origin="0.5,0.5" />
<InventoryIcon texture="Mods/{{ config['slug'] }}/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
<Sprite texture="Mods/{{ config['slug'] }}/boombox.png" sourcerect="0,0,100,60" depth="0.55" origin="0.5,0.5" />
<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>
@ -22,7 +22,7 @@
<TickBox text="Play">
<StatusEffect type="OnUse" targettype="This" IsOn="true">
<Conditional IsOn="false" />
<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" />
<sound file="Mods/{{ config['slug'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
</StatusEffect>
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
<Conditional condition="lte 50.0" />
@ -49,7 +49,7 @@
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
<Conditional IsOn="true" />
<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" />
<sound file="Mods/{{ config['slug'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<Use />
</StatusEffect>
</TickBox>
@ -109,16 +109,16 @@
<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>
<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 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" />
<InventoryIcon texture="Mods/{{ config['slug'] }}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" origin="0.5,0.5" />
<Sprite texture="Mods/{{ config['slug'] }}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" depth="0.6" origin="0.5,0.5" />
<Body width="48" height="48" />
<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">
<sound file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/cassette_drop.ogg" range="500" volume="1.0" />
<sound file="Mods/{{ config['slug'] }}/sound_effects/cassette_drop.ogg" range="500" volume="1.0" />
</StatusEffect>
</Throwable>
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
<GuiFrame relativesize="{{ 512.0 / config['resolution_x'] }},{{ 328.0 / config['resolution_y'] }}" anchor="CenterRight" pivot="CenterRight" style="sunken_tapes_cover_{{ tape.identifier }}" />
<GuiFrame relativesize="{{ 512.0 / config['resolution_x'] }},{{ 328.0 / config['resolution_y'] }}" anchor="CenterRight" pivot="CenterRight" style="{{ config['slug'] }}_cover_{{ tape.identifier }}" />
</CustomInterface>
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
<StatusEffect type="OnNotContained" targettype="Contained">
@ -151,7 +151,7 @@
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />
<ItemComponent>
<StatusEffect type="Always" target="This">
<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" />
<sound file="Mods/{{ config['slug'] }}/music/{{ tape.identifier }}.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
</StatusEffect>{% if tape.buffs %}
<StatusEffect type="Always" target="NearbyCharacters" range="1000">{% for buff in tape.buffs %}
{% if buff == "psychosis" %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (tape.buff_multiplier*(delta + 0.1)) }}" />{% else %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (tape.buff_multiplier*(delta*4 + 1)) }}" />{% endif %}{% endfor %}