Merge pull request #15953 from SandPoot/fix-pen-tablet
Fixes the tablet pen buttons
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
to_chat(usr, "<span class='notice'>You slide \the [pen] into \the [src]'s pen slot.</span>")
|
to_chat(usr, "<span class='notice'>You slide \the [pen] into \the [src]'s pen slot.</span>")
|
||||||
inserted_item = pen
|
inserted_item = pen
|
||||||
playsound(src, 'sound/machines/button.ogg', 50, 1)
|
playsound(src, 'sound/machines/button.ogg', 50, 1)
|
||||||
|
SStgui.update_uis(src)
|
||||||
|
|
||||||
/obj/item/modular_computer/tablet/proc/remove_pen()
|
/obj/item/modular_computer/tablet/proc/remove_pen()
|
||||||
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
usr.put_in_hands(inserted_item)
|
usr.put_in_hands(inserted_item)
|
||||||
to_chat(usr, "<span class='notice'>You remove [inserted_item] from \the [src]'s pen slot.</span>")
|
to_chat(usr, "<span class='notice'>You remove [inserted_item] from \the [src]'s pen slot.</span>")
|
||||||
inserted_item = null
|
inserted_item = null
|
||||||
|
SStgui.update_uis(src)
|
||||||
else
|
else
|
||||||
to_chat(usr, "<span class='warning'>\The [src] does not have a pen in it!</span>")
|
to_chat(usr, "<span class='warning'>\The [src] does not have a pen in it!</span>")
|
||||||
|
|
||||||
@@ -78,9 +80,21 @@
|
|||||||
QDEL_NULL(inserted_item)
|
QDEL_NULL(inserted_item)
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
/obj/item/modular_computer/tablet/ui_act(action, params)
|
||||||
|
. = ..()
|
||||||
|
if(.)
|
||||||
|
return
|
||||||
|
if(action == "TABLET_eject_pen")
|
||||||
|
if(istype(src, /obj/item/modular_computer/tablet))
|
||||||
|
var/obj/item/modular_computer/tablet/self = src
|
||||||
|
if(self.can_have_pen)
|
||||||
|
self.remove_pen()
|
||||||
|
return TRUE
|
||||||
|
|
||||||
/obj/item/modular_computer/tablet/ui_data(mob/user)
|
/obj/item/modular_computer/tablet/ui_data(mob/user)
|
||||||
. = ..()
|
. = ..()
|
||||||
.["PC_showpeneject"] = inserted_item ? 1 : 0
|
.["TABLET_show_pen_eject"] = inserted_item ? 1 : 0
|
||||||
|
|
||||||
/obj/item/modular_computer/tablet/update_icon_state()
|
/obj/item/modular_computer/tablet/update_icon_state()
|
||||||
if(has_variants)
|
if(has_variants)
|
||||||
if(!finish_color)
|
if(!finish_color)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const NtosWindow = (props, context) => {
|
|||||||
PC_stationtime,
|
PC_stationtime,
|
||||||
PC_programheaders = [],
|
PC_programheaders = [],
|
||||||
PC_showexitprogram,
|
PC_showexitprogram,
|
||||||
PC_showpeneject,
|
TABLET_show_pen_eject,
|
||||||
} = data;
|
} = data;
|
||||||
return (
|
return (
|
||||||
<Window
|
<Window
|
||||||
@@ -79,7 +79,7 @@ export const NtosWindow = (props, context) => {
|
|||||||
src={resolveAsset(PC_apclinkicon)} />
|
src={resolveAsset(PC_apclinkicon)} />
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{!!PC_showpeneject && (
|
{!!TABLET_show_pen_eject && (
|
||||||
<Button
|
<Button
|
||||||
width="26px"
|
width="26px"
|
||||||
lineHeight="22px"
|
lineHeight="22px"
|
||||||
@@ -88,7 +88,7 @@ export const NtosWindow = (props, context) => {
|
|||||||
icon="pen-alt"
|
icon="pen-alt"
|
||||||
tooltip="Eject pen"
|
tooltip="Eject pen"
|
||||||
tooltipPosition="bottom-end"
|
tooltipPosition="bottom-end"
|
||||||
onClick={() => act('eject_pen')} />
|
onClick={() => act('TABLET_eject_pen')} />
|
||||||
)}
|
)}
|
||||||
{!!PC_showexitprogram && (
|
{!!PC_showexitprogram && (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user