More vr sleeper work and map fix

This commit is contained in:
Artur
2020-06-09 11:06:16 +03:00
parent 19949b842b
commit 094a1b6f62
6 changed files with 32 additions and 14 deletions

View File

@@ -12649,7 +12649,6 @@
/turf/open/floor/plasteel/dark,
/area/ai_monitored/nuke_storage)
"aBZ" = (
/obj/machinery/gateway,
/obj/structure/cable{
icon_state = "0-2"
},

View File

@@ -82,8 +82,9 @@
if(user.lying || !iscarbon(target) || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE, TRUE, NO_TK))
return
close_machine(target)
ui_interact(user)
/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_contained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "VrSleeper", "VR Sleeper", 475, 340, master_ui, state)
@@ -118,6 +119,7 @@
if(!occupant || usr == occupant)
if(vr_mob)
cleanup_vr_mob()
SStgui.update_user_uis(occupant, src)
else
to_chat(usr, "<span class='warning'>The VR Sleeper's safeties prevent you from doing that.</span>")
. = TRUE

View File

@@ -0,0 +1,13 @@
/**
* tgui state: default_contained
*
* Basically default and contained combined, allowing for both
*/
GLOBAL_DATUM_INIT(default_contained_state, /datum/ui_state/default/contained, new)
/datum/ui_state/default/contained/can_use_topic(atom/src_object, mob/user)
if(src_object.contains(user))
return UI_INTERACTIVE
return ..()

View File

@@ -3265,6 +3265,7 @@
#include "code\modules\tgui\states\contained.dm"
#include "code\modules\tgui\states\deep_inventory.dm"
#include "code\modules\tgui\states\default.dm"
#include "code\modules\tgui\states\default_contained.dm"
#include "code\modules\tgui\states\hands.dm"
#include "code\modules\tgui\states\human_adjacent.dm"
#include "code\modules\tgui\states\inventory.dm"

View File

@@ -34,22 +34,25 @@ export const VrSleeper = (props, context) => {
)
}
<Section
title="VR Commands">
<Button
title="VR Commands">
<Button
content={data.toggle_open
? 'Open VR Sleeper'
: 'Close VR Sleeper'}
? 'Close VR Sleeper'
: 'Open VR Sleeper'}
icon={data.toggle_open ? 'unlock' : 'lock'}
disabled={data.stored < data.max}
onClick={() => act('toggle_open')} />
<Section>
<Section>
{!!data.isoccupant && (
<Button
color={'blue'}
content={'Connect to VR'}
onClick={() => act('vr_connect')}
icon={'unlock'} />
)
<Button.Confirm
color={'blue'}
content={'Connect to VR'}
onClick={() => {
act('vr_connect');
act('tgui:close');
}}
icon={'unlock'} />
)
|| ("You need to be inside the VR sleeper to connect to VR")}
</Section>
{!!data.vr_avatar && (

File diff suppressed because one or more lines are too long