mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
[MIRROR] MultiZ camera console actions (#1093)
* MultiZ camera console actions (#54043) This adds an action button to camera consoles to move up or down a floor. * MultiZ camera console actions Co-authored-by: NightRed <nightred@gmail.com>
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
var/list/networks = list("ss13")
|
||||
var/datum/action/innate/camera_off/off_action = new
|
||||
var/datum/action/innate/camera_jump/jump_action = new
|
||||
///Camera action button to move up a Z level
|
||||
var/datum/action/innate/camera_multiz_up/move_up_action = new
|
||||
///Camera action button to move down a Z level
|
||||
var/datum/action/innate/camera_multiz_down/move_down_action = new
|
||||
var/list/actions = list()
|
||||
///Should we supress any view changes?
|
||||
var/should_supress_view_changes = TRUE
|
||||
@@ -57,6 +61,16 @@
|
||||
jump_action.Grant(user)
|
||||
actions += jump_action
|
||||
|
||||
if(move_up_action)
|
||||
move_up_action.target = user
|
||||
move_up_action.Grant(user)
|
||||
actions += move_up_action
|
||||
|
||||
if(move_down_action)
|
||||
move_down_action.target = user
|
||||
move_down_action.Grant(user)
|
||||
actions += move_down_action
|
||||
|
||||
/obj/machinery/proc/remove_eye_control(mob/living/user)
|
||||
CRASH("[type] does not implement ai eye handling")
|
||||
|
||||
@@ -74,12 +88,12 @@
|
||||
user.reset_perspective(null)
|
||||
if(eyeobj.visible_icon && user.client)
|
||||
user.client.images -= eyeobj.user_image
|
||||
user.client.view_size.unsupress()
|
||||
|
||||
eyeobj.eye_user = null
|
||||
user.remote_control = null
|
||||
|
||||
current_user = null
|
||||
user.unset_machine()
|
||||
user.client.view_size.unsupress()
|
||||
playsound(src, 'sound/machines/terminal_off.ogg', 25, FALSE)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/check_eye(mob/user)
|
||||
@@ -195,6 +209,12 @@
|
||||
return eye_user.client
|
||||
return null
|
||||
|
||||
/mob/camera/ai_eye/remote/xenobio/canZMove(direction, turf/target)
|
||||
var/area/new_area = get_area(target)
|
||||
if(new_area && new_area.name == allowed_area || new_area && (new_area.area_flags & XENOBIOLOGY_COMPATIBLE))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/camera/ai_eye/remote/setLoc(T)
|
||||
if(eye_user)
|
||||
T = get_turf(T)
|
||||
@@ -282,3 +302,32 @@
|
||||
else
|
||||
playsound(origin, 'sound/machines/terminal_prompt_deny.ogg', 25, FALSE)
|
||||
|
||||
/datum/action/innate/camera_multiz_up
|
||||
name = "Move up a floor"
|
||||
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
|
||||
button_icon_state = "move_up"
|
||||
|
||||
/datum/action/innate/camera_multiz_up/Activate()
|
||||
if(!target || !isliving(target))
|
||||
return
|
||||
var/mob/living/user_mob = target
|
||||
var/mob/camera/ai_eye/remote/remote_eye = user_mob.remote_control
|
||||
if(remote_eye.zMove(UP, FALSE))
|
||||
to_chat(user_mob, "<span class='notice'>You move upwards.</span>")
|
||||
else
|
||||
to_chat(user_mob, "<span class='notice'>You couldn't move upwards!</span>")
|
||||
|
||||
/datum/action/innate/camera_multiz_down
|
||||
name = "Move down a floor"
|
||||
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
|
||||
button_icon_state = "move_down"
|
||||
|
||||
/datum/action/innate/camera_multiz_down/Activate()
|
||||
if(!target || !isliving(target))
|
||||
return
|
||||
var/mob/living/user_mob = target
|
||||
var/mob/camera/ai_eye/remote/remote_eye = user_mob.remote_control
|
||||
if(remote_eye.zMove(DOWN, FALSE))
|
||||
to_chat(user_mob, "<span class='notice'>You move downwards.</span>")
|
||||
else
|
||||
to_chat(user_mob, "<span class='notice'>You couldn't move downwards!</span>")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 9.7 KiB |
Reference in New Issue
Block a user