Static communicators (#9032)

* commstatic

* further work
This commit is contained in:
Greenjoe12345
2023-03-13 23:49:06 -08:00
committed by GitHub
parent 01d7833f13
commit fa3434f7cf
7 changed files with 146 additions and 23 deletions
@@ -150,9 +150,12 @@
if(..())
return 1
if(href_list["rename"])
var/new_name = sanitizeSafe(input(usr,"Please enter your name.","Communicator",usr.name) )
if(new_name)
register_device(new_name)
if(!can_rename)
to_chat(usr, "Renaming forbidden on this device.")
else
var/new_name = sanitizeSafe(input(usr,"Please enter your name.","Communicator",usr.name) )
if(new_name)
register_device(new_name)
if(href_list["toggle_visibility"])
switch(network_visibility)
@@ -73,6 +73,8 @@ var/global/list/obj/item/communicator/all_communicators = list()
var/list/communicating = list()
var/update_ticks = 0
var/newsfeed_channel = 0
var/static_name = null
var/can_rename = 1
// Proc: New()
// Parameters: None
@@ -95,6 +97,9 @@ var/global/list/obj/item/communicator/all_communicators = list()
// Parameters: None
// Description: Tries to register ourselves to the mob that we've presumably spawned in. Not the most amazing way of doing this.
/obj/item/communicator/proc/register_to_holder()
if(static_name)
register_device(static_name)
initialize_exonet(loc)
if(ismob(loc))
register_device(loc.name)
initialize_exonet(loc)
@@ -279,7 +284,10 @@ var/global/list/obj/item/communicator/all_communicators = list()
return
owner = new_name
name = "[new_name]'s [initial(name)]"
if(static_name)
name = "[new_name]"
else
name = "[new_name]'s [initial(name)]"
if(camera)
camera.name = name
camera.c_tag = name
@@ -0,0 +1,27 @@
/obj/item/communicator/desktop
name = "desktop communicator"
desc = "A static communicator unit, seen in homes, offices and the receptions of businesses across the galaxy."
icon_state = "commstatic"
anchored = 1
static_name = "fixed communicator"
can_rename = 0
/obj/item/communicator/desktop/attack_hand(mob/user)
return attack_self(user)
/obj/item/communicator/desktop/initialize_exonet(mob/user)
if(!static_name)
return
if(!exonet)
exonet = new(src)
if(!exonet.address)
exonet.make_address("communicator-[static_name]")
if(!node)
node = get_exonet_node()
populate_known_devices()
/obj/item/communicator/desktop/register_to_holder()
if(!static_name)
return ..()
register_device(static_name)
initialize_exonet()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 100 KiB

+49 -9
View File
@@ -10617,12 +10617,19 @@
id = "BrigFoyer";
layer = 2.9;
name = "Foyer Doors";
pixel_x = 6;
pixel_y = 6
},
/obj/item/sticky_pad/random{
pixel_x = 8;
pixel_y = -1
},
/obj/item/communicator/desktop{
occupation = "security";
pixel_x = -9;
pixel_y = 5;
static_name = "security lobby communicator"
},
/turf/simulated/floor/tiled/dark,
/area/surface/station/security/lobby)
"eNB" = (
@@ -40535,11 +40542,13 @@
id = "MedbayFoyer";
layer = 2.9;
name = "Foyer Door";
pixel_x = 6;
pixel_y = 5
},
/obj/item/radio/phone/medbay{
name = "Reception Emergency Phone";
pixel_y = -6
/obj/item/communicator/desktop{
occupation = "medical";
pixel_x = -8;
static_name = "medical lobby communicator"
},
/turf/simulated/floor/tiled/neutral,
/area/surface/station/medical/reception)
@@ -50572,6 +50581,19 @@
},
/turf/simulated/floor/tiled/steel_grid,
/area/surface/station/security/lobby)
"wCp" = (
/obj/structure/table/marble,
/obj/machinery/door/blast/gate/thin{
dir = 2;
id = "kitchen";
layer = 3.3
},
/obj/item/communicator/desktop{
occupation = "kitchen";
static_name = "kitchen communicator"
},
/turf/simulated/floor/tiled/eris/cafe,
/area/surface/station/crew_quarters/kitchen)
"wCF" = (
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
dir = 4
@@ -51400,9 +51422,14 @@
/obj/structure/window/reinforced,
/obj/machinery/recharger,
/obj/item/sticky_pad/random{
pixel_x = 8;
pixel_x = -8;
pixel_y = -1
},
/obj/item/communicator/desktop{
occupation = "engineering";
pixel_x = 14;
static_name = "engineering lobby communicator"
},
/turf/simulated/floor/tiled,
/area/surface/station/engineering/engineering_monitoring)
"wRM" = (
@@ -53064,11 +53091,24 @@
/area/surface/station/hydroponics)
"xHq" = (
/obj/structure/table/marble,
/obj/item/reagent_containers/food/drinks/flask/barflask,
/obj/item/reagent_containers/food/drinks/flask/vacuumflask,
/obj/item/flame/lighter/zippo,
/obj/item/reagent_containers/glass/rag,
/obj/item/reagent_containers/food/drinks/flask/barflask{
pixel_x = 6
},
/obj/item/reagent_containers/food/drinks/flask/vacuumflask{
pixel_x = 6
},
/obj/item/flame/lighter/zippo{
pixel_x = 6
},
/obj/item/reagent_containers/glass/rag{
pixel_x = 5
},
/obj/item/deskbell,
/obj/item/communicator/desktop{
occupation = "bar";
pixel_x = -12;
static_name = "bar communicator"
},
/turf/simulated/floor/lino,
/area/surface/station/crew_quarters/bar)
"xHy" = (
@@ -88832,7 +88872,7 @@ sfZ
xuZ
xod
epo
cKX
wCp
msM
qzQ
msM
+54 -10
View File
@@ -2167,16 +2167,29 @@
/area/surface/station/engineering/atmos/monitoring)
"bzc" = (
/obj/structure/table/glass,
/obj/item/paper_bin,
/obj/item/clipboard,
/obj/item/folder/white,
/obj/item/pen,
/obj/item/paper_bin{
pixel_x = -14
},
/obj/item/clipboard{
pixel_x = -14
},
/obj/item/folder/white{
pixel_x = -14
},
/obj/item/pen{
pixel_x = -12
},
/obj/effect/floor_decal/borderfloorwhite{
dir = 6
},
/obj/effect/floor_decal/corner/purple/border{
dir = 6
},
/obj/item/communicator/desktop{
occupation = "research";
pixel_x = 3;
static_name = "research lobby communicator"
},
/turf/simulated/floor/tiled/white,
/area/surface/station/rnd/lab)
"bzL" = (
@@ -5964,6 +5977,12 @@
/obj/effect/floor_decal/corner/brown/border{
dir = 1
},
/obj/item/communicator/desktop{
occupation = "cargo";
pixel_x = -16;
pixel_y = 6;
static_name = "cargo lobby communicator"
},
/turf/simulated/floor/tiled,
/area/surface/station/quartermaster/office)
"dUz" = (
@@ -6622,12 +6641,21 @@
pixel_x = -21
},
/obj/item/material/ashtray/glass,
/obj/item/flashlight/lamp/green,
/obj/item/flashlight/lamp/green{
pixel_x = 12;
pixel_y = 10
},
/obj/item/sticky_pad/random{
pixel_x = 8;
pixel_x = 16;
pixel_y = -1
},
/obj/effect/zone_divider,
/obj/item/communicator/desktop{
occupation = "internal affairs";
pixel_x = -3;
pixel_y = 4;
static_name = "internal affairs office communicator"
},
/turf/simulated/floor/wood,
/area/surface/station/command/internalaffairs)
"esP" = (
@@ -26743,11 +26771,20 @@
/area/surface/station/hallway/primary/secondfloor/west)
"rwU" = (
/obj/structure/table/wooden_reinforced,
/obj/item/melee/chainofcommand,
/obj/item/hand_tele,
/obj/item/melee/chainofcommand{
pixel_y = 9
},
/obj/item/hand_tele{
pixel_y = 9
},
/obj/structure/sign/calendar{
pixel_x = -32
},
/obj/item/communicator/desktop{
occupation = "site manager";
pixel_y = -12;
static_name = "site manager's office communicator"
},
/turf/simulated/floor/wood,
/area/surface/station/crew_quarters/captain)
"rwZ" = (
@@ -27358,7 +27395,10 @@
/area/surface/station/rnd/research)
"rSN" = (
/obj/structure/table/standard,
/obj/item/sticky_pad/random,
/obj/item/communicator/desktop{
occupation = "public";
static_name = "public communicator"
},
/turf/simulated/floor/tiled/dark,
/area/surface/station/hallway/secondary/secondfloor/dormhallway)
"rSS" = (
@@ -31669,7 +31709,7 @@
dir = 4
},
/obj/item/toy/desk/fan{
pixel_y = 19
pixel_y = 18
},
/obj/structure/sign/clock{
pixel_y = -32
@@ -37774,6 +37814,10 @@
"yjT" = (
/obj/structure/table/standard,
/obj/item/toy/plushie/corgi,
/obj/item/sticky_pad/random{
pixel_x = 4;
pixel_y = 8
},
/turf/simulated/floor/tiled/dark,
/area/surface/station/hallway/secondary/secondfloor/dormhallway)
"yka" = (
+1
View File
@@ -1002,6 +1002,7 @@
#include "code\game\objects\items\devices\violin.dm"
#include "code\game\objects\items\devices\whistle.dm"
#include "code\game\objects\items\devices\communicator\communicator.dm"
#include "code\game\objects\items\devices\communicator\desktop.dm"
#include "code\game\objects\items\devices\communicator\helper.dm"
#include "code\game\objects\items\devices\communicator\integrated.dm"
#include "code\game\objects\items\devices\communicator\messaging.dm"