- Fixed the song not playing when checkbox is pressed and the tape is changed

- Removed the need for the song control item.
- Changed the light component to glow green and not flicker
- Fixed the item pickup messages.
- Changed the item pickup to select.
master
Jaka Perovšek 2021-11-28 19:05:46 +01:00
parent ee7adf0f63
commit 3f3ada8d56
1 changed files with 31 additions and 39 deletions

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 %}
<Items>
<Item name="Boombox" cargocontaineridentifier="metalcrate" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}boombox" category="Equipment" Tags="mediumitem,boombox,sunken-tapes-player" 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,sunken-tapes-player" scale="0.5" description="" price="850" impactsoundtag="impact_metal_light" isshootable="true" HideConditionBar="true">
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.1"/>
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
<Price baseprice="500" soldeverywhere="false">
@ -15,28 +15,28 @@
<InventoryIcon texture="Mods/{{ config['name'] }}/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
<Sprite texture="Mods/{{ config['name'] }}/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 LightColor="0.0,0.85,0.0,0.7" range="4" powerconsumption="0" blinkfrequency="0" IsOn="false" canbeselected="false">
</LightComponent>
<CustomInterface canbeselected="true" drawhudwhenequipped="true" allowuioverlap="true">
<GuiFrame relativesize="0.10,0.07" anchor="CenterLeft" pivot="BottomLeft" relativeoffset="0.006,-0.05" style="ItemUI" />
<TickBox text="Play">
<StatusEffect type="OnUse" targettype="This" IsOn="true">
<Conditional IsOn="false" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<RequiredItem items="cassette" type="Contained" />
<SpawnItem identifiers="song-control-play" spawnposition="ContainedInventory" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="300" volume="1.0" />
</StatusEffect>
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
<Conditional IsOn="true" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="300" volume="1.0" />
<Use />
</StatusEffect>
</TickBox>
</CustomInterface>
<Holdable slots="RightHand,LeftHand" selectkey="Select" pickkey="Use" attachable="false" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,30" handle1="0,30" handle2="0,30" swingamount="25,7" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickUpUse">
<Holdable slots="RightHand,LeftHand" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,30" handle1="0,30" handle2="0,30" swingamount="25,7" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickupSelect">
<StatusEffect type="OnBroken" target="This">
<Remove />
</StatusEffect>
</Holdable>
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79">
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79" >
<StatusEffect type="OnUse" targettype="Contained" >
<Use />
</StatusEffect>
@ -45,7 +45,7 @@
</ItemContainer>
</Item>
<Item name="Walkman" cargocontaineridentifier="metalcrate" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}walkman" category="Equipment" Tags="smallitem,walkman,sunken-tapes-player" scale="0.5" description="" price="450" impactsoundtag="impact_metal_light" isshootable="true">
<Item name="Walkman" cargocontaineridentifier="metalcrate" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}walkman" category="Equipment" Tags="smallitem,walkman,sunken-tapes-player" scale="0.5" description="" price="450" impactsoundtag="impact_metal_light" isshootable="true" HideConditionBar="true">
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.1"/>
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
<Price baseprice="450" soldeverywhere="false">
@ -59,28 +59,28 @@
<InventoryIcon texture="Mods/{{ config['name'] }}/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
<Sprite texture="Mods/{{ config['name'] }}/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 LightColor="0.0,0.85,0.0,0.7" range="4" powerconsumption="0" blinkfrequency="0" IsOn="false" canbeselected="false">
</LightComponent>
<CustomInterface canbeselected="true" drawhudwhenequipped="true" allowuioverlap="true">
<GuiFrame relativesize="0.10,0.07" anchor="CenterLeft" pivot="BottomLeft" relativeoffset="0.006,-0.05" style="ItemUI" />
<TickBox text="Play">
<StatusEffect type="OnUse" targettype="This" IsOn="true">
<Conditional IsOn="false" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<RequiredItem items="cassette" type="Contained" />
<SpawnItem identifiers="song-control-play" spawnposition="ContainedInventory" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="300" volume="1.0" />
</StatusEffect>
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
<Conditional IsOn="true" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<RequiredItem items="cassette" type="Contained" />
<SpawnItem identifiers="song-control-stop" spawnposition="ContainedInventory" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="300" volume="1.0" />
<Use />
</StatusEffect>
</TickBox>
</CustomInterface>
<Holdable slots="RightHand,LeftHand,Any" selectkey="Use" pickkey="Select" attachable="false" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,-65" handle1="0,30" handle2="0,30" swingamount="25,8" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickUpUse">
<Holdable slots="RightHand,LeftHand,Any" holdpos="5,-65" holdangle="0" aimpos="5,-65" handle1="0,30" handle2="0,30" swingamount="25,8" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickupSelect">
<StatusEffect type="OnBroken" target="This">
<Remove />
</StatusEffect>
</Holdable>
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79">
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79" >
<StatusEffect type="OnUse" targettype="Contained" >
<Use />
</StatusEffect>
@ -89,23 +89,10 @@
</ItemContainer>
</Item>
<!-- SONGS CONTROL -->
<Item name="Song Control Play" identifier="song-control-play" Tags="song-control-play" 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" />
<ItemComponent>
<StatusEffect type="OnContained" targettype="This">
<Remove />
</StatusEffect>
</ItemComponent>
</Item>
<!-- Cassette Tapes -->
{% for tape in tapes %}
<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">
<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"] %}
@ -122,7 +109,7 @@
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
<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="2" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true" showcontainedstateindicator="false">
<StatusEffect type="OnNotContained" targettype="Contained">
<Use />
</StatusEffect>
@ -130,15 +117,20 @@
<Conditional hastag="!eq sunken-tapes-player" targetcontainer="true" />
<Use />
</StatusEffect>
<StatusEffect type="OnContained" targettype="This" comparison="And">
<Conditional hastag="boombox" targetcontainer="true" />
<Conditional IsOn="true" targetcontainer="true" />
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" spawnposition="ThisInventory" />
</StatusEffect>
<StatusEffect type="OnContained" targettype="This" comparison="And">
<Conditional hastag="walkman" targetcontainer="true" />
<Conditional IsOn="true" targetcontainer="true" />
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-walkman-{{ tape.identifier }}" spawnposition="ThisInventory" />
</StatusEffect>
<StatusEffect type="OnUse" targettype="Contained">
<Use />
</StatusEffect>
<Containable items="song" />
<Containable items="song-control-play">
<StatusEffect type="OnContaining" targettype="This">
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" spawnposition="ThisInventory" />
</StatusEffect>
</Containable>
</ItemContainer>
<Holdable slots="Any,RightHand,LeftHand" msg="ItemMsgPickUpSelect" >
<StatusEffect type="OnBroken" target="This">