Added the custom naming option, included the license information in the sources.
parent
8fcf1b8b16
commit
95e85dd57a
13
deploy.py
13
deploy.py
|
@ -210,13 +210,13 @@ def build_xml_code(data, config):
|
||||||
# render the template
|
# render the template
|
||||||
output_file.write(template0.render(config=config))
|
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
|
# render the template
|
||||||
output_file.write(template1.render(tapes=data, config=config,
|
output_file.write(template1.render(tapes=data, config=config,
|
||||||
condition_delta=condition_delta,
|
condition_delta=condition_delta,
|
||||||
affliction_delta=affliction_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
|
# render the template
|
||||||
output_file.write(template2.render(tapes=data, config=config))
|
output_file.write(template2.render(tapes=data, config=config))
|
||||||
|
|
||||||
|
@ -225,6 +225,10 @@ def deploy(config):
|
||||||
try:
|
try:
|
||||||
os.mkdir('./build')
|
os.mkdir('./build')
|
||||||
except FileExistsError:
|
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
|
pass
|
||||||
|
|
||||||
logging.info("Reading tapes.yaml")
|
logging.info("Reading tapes.yaml")
|
||||||
|
@ -238,10 +242,7 @@ def deploy(config):
|
||||||
prepare_images(data, config)
|
prepare_images(data, config)
|
||||||
build_xml_code(data, config)
|
build_xml_code(data, config)
|
||||||
|
|
||||||
if config["override_workshop"]:
|
mod_directory = f"/Mods/{config['slug']}/"
|
||||||
mod_directory = "/Mods/Sunken Tapes/"
|
|
||||||
else:
|
|
||||||
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)
|
||||||
|
|
116
main.py
116
main.py
|
@ -8,6 +8,25 @@ from pathlib import Path
|
||||||
from deploy import download_ffmpeg, download_git, deploy, get_ffmpeg_version, update
|
from deploy import download_ffmpeg, download_git, deploy, get_ffmpeg_version, update
|
||||||
import logging
|
import logging
|
||||||
import sys
|
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():
|
def get_curr_screen_geometry():
|
||||||
|
@ -28,6 +47,63 @@ def get_curr_screen_geometry():
|
||||||
return 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 create_install_frame(container):
|
||||||
def find_barotrauma_directory():
|
def find_barotrauma_directory():
|
||||||
first_guess = Path("C:/Program Files (x86)/Steam/steamapps/common/Barotrauma")
|
first_guess = Path("C:/Program Files (x86)/Steam/steamapps/common/Barotrauma")
|
||||||
|
@ -83,15 +159,6 @@ def create_options_frame(container):
|
||||||
text='Buffs',
|
text='Buffs',
|
||||||
command=lambda: print(buffs.get()))
|
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,
|
Hovertip(use_ita_check,
|
||||||
'Check this box if you use Into The Abyss mod.'
|
'Check this box if you use Into The Abyss mod.'
|
||||||
'\nITA and Sunken Tapes override the same style file.')
|
'\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'
|
'Check this box to enable some songs causing strange effects'
|
||||||
'\nThis is the intended default behaviour.')
|
'\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():
|
for widget in frame.winfo_children():
|
||||||
widget.pack(side="top", padx=3, pady=3, fill="x")
|
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):
|
def create_resolution_frame(container):
|
||||||
|
@ -141,24 +204,24 @@ 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",
|
"name": config["name"].get(),
|
||||||
|
"slug": config["slug"].get(),
|
||||||
"resolution_x": int(config["resolution_x"].get()),
|
"resolution_x": int(config["resolution_x"].get()),
|
||||||
"resolution_y": int(config["resolution_y"].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"]:
|
if config_values["name"] != "Sunken Tapes":
|
||||||
mod_name = "Sunken Tapes"
|
note = f'\n\nThis is a custom version and is named {config_values["name"]} to differentiate it from ' \
|
||||||
note = ""
|
+ '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:
|
else:
|
||||||
mod_name = "Sunken Tapez"
|
note = ""
|
||||||
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'{mod_name} was successfully installed to:'
|
message=f'{config_values["name"]} was successfully installed to:'
|
||||||
f'\n{config["installdir"].get()}'
|
f'\n\n{config_values["installdir"]}/Mods/{config_values["slug"]}'
|
||||||
f'\n\nThis installer will now close.'
|
f'\n\nThis installer will now close.'
|
||||||
f'{note}')
|
f'{note}')
|
||||||
|
|
||||||
|
@ -246,19 +309,22 @@ def create_main_window():
|
||||||
root.title('Sunken Tapes')
|
root.title('Sunken Tapes')
|
||||||
middle_frame = ttk.Frame(root)
|
middle_frame = ttk.Frame(root)
|
||||||
|
|
||||||
|
name_frame, name, slug = create_name_frame(root)
|
||||||
install_frame, install_dir = create_install_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)
|
resolution_frame, width, height = create_resolution_frame(middle_frame)
|
||||||
|
|
||||||
config = {"installdir": install_dir,
|
config = {"installdir": install_dir,
|
||||||
"use_ita": use_ita,
|
"use_ita": use_ita,
|
||||||
"buffs": buffs,
|
"buffs": buffs,
|
||||||
"override_workshop": override_workshop,
|
"name": name,
|
||||||
|
"slug": slug,
|
||||||
"resolution_x": width,
|
"resolution_x": width,
|
||||||
"resolution_y": height}
|
"resolution_y": height}
|
||||||
|
|
||||||
deploy_frame = create_deploy_frame(root, config)
|
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)
|
install_frame.pack(side="top", fill="x", pady=3, padx=3)
|
||||||
options_frame.pack(side="left", fill="y", 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)
|
resolution_frame.pack(side="left", fill="both", pady=3, padx=3, expand=True)
|
||||||
|
|
|
@ -1,38 +1,39 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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">
|
{% 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 %}
|
||||||
<Item file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes.xml" />
|
<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">
|
||||||
<UIStyle file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sunken_tapes_style.xml" />
|
<Item file="Mods/{{ config['slug'] }}/{{ config['slug'] }}.xml" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" />
|
<UIStyle file="Mods/{{ config['slug'] }}/{{ config['slug'] }}_style.xml" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/covers.png" />
|
<None file="Mods/{{ config['slug'] }}/icons.png" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/boombox.png" />
|
<None file="Mods/{{ config['slug'] }}/covers.png" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/08080_canyons_joyride.ogg" />
|
<None file="Mods/{{ config['slug'] }}/boombox.png" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/08080_minor_threat.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/08080_canyons_joyride.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/bedouin.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/08080_minor_threat.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/biosphere.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/bedouin.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/ddt.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/biosphere.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dm.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/ddt.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dmx.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/dm.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/dmxcut.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/dmx.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/hardbass.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/dmxcut.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/ira.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/hardbass.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/immigrantsong.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/ira.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/java.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/immigrantsong.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/nazare.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/java.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rainbowstalin.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/nazare.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/redoctober.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/rainbowstalin.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rum.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/redoctober.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/rusija.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/rum.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/schritte.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/rusija.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/schritte_08080.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/schritte.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shanty1.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/schritte_08080.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shanty2.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/shanty1.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/shoegazeprincessa.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/shanty2.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/sigma.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/shoegazeprincessa.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/swgd.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/sigma.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/tha.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/swgd.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/urfaust.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/tha.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/music/wacky_tape.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/urfaust.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_insert_cassette.ogg" />
|
<None file="Mods/{{ config['slug'] }}/music/wacky_tape.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/boombox_play_cassette.ogg" />
|
<None file="Mods/{{ config['slug'] }}/sound_effects/boombox_insert_cassette.ogg" />
|
||||||
<None file="Mods/Sunken Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/sound_effects/cassette_drop.ogg" />
|
<None file="Mods/{{ config['slug'] }}/sound_effects/boombox_play_cassette.ogg" />
|
||||||
|
<None file="Mods/{{ config['slug'] }}/sound_effects/cassette_drop.ogg" />
|
||||||
</contentpackage>
|
</contentpackage>
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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>
|
<Override>
|
||||||
<style>
|
<style>
|
||||||
<!--
|
<!--
|
||||||
|
@ -179,9 +180,9 @@
|
||||||
</Sprite>
|
</Sprite>
|
||||||
</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">
|
<{{ config['slug'] }}_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"/>
|
<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"/>
|
||||||
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
</{{ config['slug'] }}_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">
|
||||||
<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"/>
|
<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"/>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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>
|
<Override>
|
||||||
<style>
|
<style>
|
||||||
<!--
|
<!--
|
||||||
|
@ -181,9 +182,9 @@
|
||||||
</Sprite>
|
</Sprite>
|
||||||
</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">
|
<{{ config['slug'] }}_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"/>
|
<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"/>
|
||||||
</sunken_tapes_cover_{{ tape.identifier }}>{% endfor %}
|
</{{ config['slug'] }}_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">
|
||||||
<Sprite texture="Content/UI/InnerGlow.png" sourcerect="0,0,512,384" slice="128,128,384,256" />
|
<Sprite texture="Content/UI/InnerGlow.png" sourcerect="0,0,512,384" slice="128,128,384,256" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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>
|
<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="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="abandonedcrewcab" spawnprobability="0.1"/>
|
||||||
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
|
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
|
||||||
|
@ -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 Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" sourcerect="0,0,64,64" 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/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" />
|
<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" />
|
<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 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>
|
||||||
<!--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 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 />
|
<Use />
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
</TickBox>
|
</TickBox>
|
||||||
|
@ -109,16 +109,16 @@
|
||||||
<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 Tape{% if config['override_workshop'] %}s{% else %}z{% endif %}/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" 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/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" />
|
<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" />
|
<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 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>
|
</StatusEffect>
|
||||||
</Throwable>
|
</Throwable>
|
||||||
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
|
<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>
|
</CustomInterface>
|
||||||
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
|
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
|
||||||
<StatusEffect type="OnNotContained" targettype="Contained">
|
<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" />
|
<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 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>{% 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' % (tape.buff_multiplier*(delta + 0.1)) }}" />{% else %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (tape.buff_multiplier*(delta*4 + 1)) }}" />{% endif %}{% endfor %}
|
{% 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 %}
|
||||||
|
|
Loading…
Reference in New Issue