Modular PDA tweaks and bugfixes (#10440)

rscadd: "Handheld modular computers now use flashlights as a light source. They may be turned on/off via a button in the PC header, and have their brightness adjusted in Hardware Configuration."
    tweak: Message notifications should be much larger.
    tweak: "Chat messages are now logged to the NTNet Monitoring program."
    bugfix: "IDs are now unregistered from computers when the computer is destroyed."
    bugfix: "Fix Eject Battery having a global view range."
    bugfix: "Chat Clients are no longer set to 'silent' by default."
    backend: "Added a new slider component for VueUIs."

Closes #10439
This commit is contained in:
JohnWildkins
2020-11-10 01:12:51 -05:00
committed by GitHub
parent 566b624d53
commit 44664fc90d
30 changed files with 351 additions and 69 deletions

View File

@@ -44,6 +44,8 @@
VUEUI_SET_CHECK(data["card_slot"], computer.card_slot, ., data)
if(computer.registered_id)
VUEUI_SET_CHECK(data["registered"], computer.registered_id.registered_name, ., data)
else
VUEUI_SET_CHECK(data["registered"], 0, ., data)
if(!computer.battery_module)
VUEUI_SET_CHECK(data["battery"], 0, ., data)
else
@@ -51,6 +53,14 @@
VUEUI_SET_CHECK(data["battery"]["rating"], computer.battery_module.battery.maxcharge, ., data)
VUEUI_SET_CHECK(data["battery"]["percent"], round(computer.battery_module.battery.percent()), ., data)
if(computer.flashlight)
var/brightness = Clamp(0, round(computer.flashlight.power) * 10, 10)
VUEUI_SET_CHECK_IFNOTSET(data["brightness"], brightness, ., data)
if(data["brightness"])
var/new_brightness = Clamp(0, data["brightness"]/10, 1)
computer.flashlight.tweak_brightness(new_brightness)
LAZYINITLIST(data["hardware"])
for(var/obj/item/computer_hardware/H in hardware)
LAZYINITLIST(data["hardware"][H.name])