TTV TGUI, VR sleeper work.

This commit is contained in:
Artur
2020-06-08 12:28:16 +03:00
parent 4fe9e788ac
commit 33c5dfb28e
6 changed files with 26 additions and 66 deletions

View File

@@ -7,14 +7,14 @@
righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi' righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi'
desc = "Regulates the transfer of air between two tanks." desc = "Regulates the transfer of air between two tanks."
w_class = WEIGHT_CLASS_BULKY w_class = WEIGHT_CLASS_BULKY
var/ui_x = 310
var/ui_y = 320
var/obj/item/tank/tank_one var/obj/item/tank/tank_one
var/obj/item/tank/tank_two var/obj/item/tank/tank_two
var/obj/item/assembly/attached_device var/obj/item/assembly/attached_device
var/mob/attacher = null var/mob/attacher = null
var/valve_open = FALSE var/valve_open = FALSE
var/toggle = 1 var/toggle = TRUE
var/ui_x = 310
var/ui_y = 320
/obj/item/transfer_valve/IsAssemblyHolder() /obj/item/transfer_valve/IsAssemblyHolder()
return TRUE return TRUE
@@ -59,7 +59,7 @@
attacher = user attacher = user
return return
//Attached device memes //These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/Move() /obj/item/transfer_valve/Move()
. = ..() . = ..()
if(attached_device) if(attached_device)
@@ -79,58 +79,14 @@
if(attached_device) if(attached_device)
attached_device.Crossed(AM) attached_device.Crossed(AM)
/obj/item/transfer_valve/attack_hand()//Triggers mousetraps //Triggers mousetraps
/obj/item/transfer_valve/attack_hand()
. = ..() . = ..()
if(.) if(.)
return return
if(attached_device) if(attached_device)
attached_device.attack_hand() attached_device.attack_hand()
//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/attack_self(mob/user)
user.set_machine(src)
var/dat = {"<B> Valve properties: </B>
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=[REF(src)];tankone=1'>Remove</A>" : ""]
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=[REF(src)];tanktwo=1'>Remove</A>" : ""]
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=[REF(src)];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=[REF(src)];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=[REF(src)];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=[REF(src)];open=1'>Open</A>"]"}
var/datum/browser/popup = new(user, "trans_valve", name)
popup.set_content(dat)
popup.open()
return
/obj/item/transfer_valve/Topic(href, href_list)
..()
if(!usr.canUseTopic(src))
return
if(tank_one && href_list["tankone"])
split_gases()
valve_open = FALSE
tank_one.forceMove(drop_location())
tank_one = null
update_icon()
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
update_icon()
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.on_detach()
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
attack_self(usr)
add_fingerprint(usr)
/obj/item/transfer_valve/proc/process_activation(obj/item/D) /obj/item/transfer_valve/proc/process_activation(obj/item/D)
if(toggle) if(toggle)
toggle = FALSE toggle = FALSE
@@ -142,7 +98,6 @@
/obj/item/transfer_valve/update_icon() /obj/item/transfer_valve/update_icon()
cut_overlays() cut_overlays()
underlays = null
if(!tank_one && !tank_two && !attached_device) if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1" icon_state = "valve_1"
@@ -152,9 +107,13 @@
if(tank_one) if(tank_one)
add_overlay("[tank_one.icon_state]") add_overlay("[tank_one.icon_state]")
if(tank_two) if(tank_two)
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]") var/mutable_appearance/J = mutable_appearance(icon, icon_state = "[tank_two.icon_state]")
J.Shift(WEST, 13) var/matrix/T = matrix()
underlays += J T.Translate(-13, 0)
J.transform = T
underlays = list(J)
else
underlays = null
if(attached_device) if(attached_device)
add_overlay("device") add_overlay("device")
if(istype(attached_device, /obj/item/assembly/infra)) if(istype(attached_device, /obj/item/assembly/infra))
@@ -192,7 +151,6 @@
Exadv1: I know this isn't how it's going to work, but this was just to check Exadv1: I know this isn't how it's going to work, but this was just to check
it explodes properly when it gets a signal (and it does). it explodes properly when it gets a signal (and it does).
*/ */
/obj/item/transfer_valve/proc/toggle_valve() /obj/item/transfer_valve/proc/toggle_valve()
if(!valve_open && tank_one && tank_two) if(!valve_open && tank_one && tank_two)
valve_open = TRUE valve_open = TRUE
@@ -218,7 +176,6 @@
admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]" admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]"
bomber_message = " - Last touched by: [key_name_admin(bomber)]" bomber_message = " - Last touched by: [key_name_admin(bomber)]"
var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]" var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]"
GLOB.bombers += admin_bomb_message GLOB.bombers += admin_bomb_message
message_admins(admin_bomb_message, 0, 1) message_admins(admin_bomb_message, 0, 1)
@@ -232,9 +189,10 @@
split_gases() split_gases()
valve_open = FALSE valve_open = FALSE
update_icon() update_icon()
/*
// this doesn't do anything but the timer etc. expects it to be here This doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
*/
/obj/item/transfer_valve/proc/c_state() /obj/item/transfer_valve/proc/c_state()
return return

View File

@@ -113,10 +113,12 @@
to_chat(occupant, "<span class='warning'>The virtual world does not support the creation of new virtual avatars, aborting transfer</span>") to_chat(occupant, "<span class='warning'>The virtual world does not support the creation of new virtual avatars, aborting transfer</span>")
else else
to_chat(vr_mob, "<span class='notice'>Transfer successful! You are now playing as [vr_mob] in VR!</span>") to_chat(vr_mob, "<span class='notice'>Transfer successful! You are now playing as [vr_mob] in VR!</span>")
M.ui_close(M) //The UI can get stuck open while in VR, which can be annoying
. = TRUE . = TRUE
if("delete_avatar") if("delete_avatar")
if(!occupant || usr == occupant) if(!occupant || usr == occupant)
if(vr_mob) if(vr_mob)
SStgui.try_update_ui(occupant, src)
cleanup_vr_mob() cleanup_vr_mob()
else else
to_chat(usr, "<span class='warning'>The VR Sleeper's safeties prevent you from doing that.</span>") to_chat(usr, "<span class='warning'>The VR Sleeper's safeties prevent you from doing that.</span>")

View File

@@ -303,7 +303,7 @@ MINIMUM_SECBORG_ALERT 3
#ROUNDSTART_AWAY #ROUNDSTART_AWAY
## Uncomment to load one of the virtual reality levels from vr_config at roundstart. ## Uncomment to load one of the virtual reality levels from vr_config at roundstart.
#ROUNDSTART_VR ROUNDSTART_VR
## How long the delay is before the Away Mission gate opens. Default is half an hour. ## How long the delay is before the Away Mission gate opens. Default is half an hour.
## 600 is one minute. ## 600 is one minute.

View File

@@ -8,6 +8,6 @@
#Do NOT tick the maps during compile -- the game uses this list to decide which map to load. Ticking the maps will result in them ALL being loaded at once. #Do NOT tick the maps during compile -- the game uses this list to decide which map to load. Ticking the maps will result in them ALL being loaded at once.
#DO tick the associated code file for the virtual reality levels you are enabling. Otherwise, the map will be trying to reference objects which do not exist, which will cause runtime errors! #DO tick the associated code file for the virtual reality levels you are enabling. Otherwise, the map will be trying to reference objects which do not exist, which will cause runtime errors!
#_maps/RandomZLevels/VR/murderdome.dmm _maps/RandomZLevels/VR/murderdome.dmm
#_maps/RandomZLevels/VR/snowdin_VR.dmm _maps/RandomZLevels/VR/snowdin_VR.dmm
#_maps/RandomZLevels/VR/syndicate_trainer.dmm _maps/RandomZLevels/VR/syndicate_trainer.dmm

View File

@@ -303,7 +303,7 @@ const ContractsTab = (props, context) => {
return ( return (
<Fragment> <Fragment>
<Section <Section
title="Availible Contracts" title="Available Contracts"
buttons={( buttons={(
<Button <Button
content="Call Extraction" content="Call Extraction"

View File

@@ -14,7 +14,7 @@ export const VrSleeper = (props, context) => {
</Box> </Box>
</Section> </Section>
)} )}
{...!!data.vr_avatar && ( {data.vr_avatar && (
<Section title={"Virtual Avatar"}> <Section title={"Virtual Avatar"}>
<ProgressBar <ProgressBar
title={"Avatar Status: "} title={"Avatar Status: "}
@@ -52,7 +52,7 @@ export const VrSleeper = (props, context) => {
) )
|| ("You need to be inside the VR sleeper to connect to VR")} || ("You need to be inside the VR sleeper to connect to VR")}
</Section> </Section>
{!!data.vr_avatar && ( {data.can_delete_avatar && (
<Button <Button
content={"Delete VR avatar"} content={"Delete VR avatar"}
icon={'recycle'} icon={'recycle'}