mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
More vr sleeper work and map fix
This commit is contained in:
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
13
code/modules/tgui/states/default_contained.dm
Normal file
13
code/modules/tgui/states/default_contained.dm
Normal 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 ..()
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user