More testmerge fixes

This commit is contained in:
Artur
2020-07-03 15:16:02 +03:00
parent 0d9609af29
commit 6c4e733a38
8 changed files with 67 additions and 39 deletions

View File

@@ -2,10 +2,14 @@
name = "airlock electronics"
req_access = list(ACCESS_MAINT_TUNNELS)
custom_price = PRICE_CHEAP
/// A list of all granted accesses
var/list/accesses = list()
/// If the airlock should require ALL or only ONE of the listed accesses
var/one_access = 0
var/unres_sides = 0 //unrestricted sides, or sides of the airlock that will open regardless of access
/// Unrestricted sides, or sides of the airlock that will open regardless of access
var/unres_sides = 0
/// A holder of the electronics, in case of them working as an integrated part
var/holder
/obj/item/electronics/airlock/examine(mob/user)
. = ..()
@@ -13,31 +17,37 @@
/obj/item/electronics/airlock/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "AirlockElectronics", name, 420, 485, master_ui, state)
ui.open()
/obj/item/electronics/airlock/ui_data()
/obj/item/electronics/airlock/ui_static_data(mob/user)
var/list/data = list()
var/list/regions = list()
for(var/i in 1 to 7)
var/list/region = list()
var/list/accesses = list()
for(var/j in get_region_accesses(i))
var/list/access = list()
access["name"] = get_access_desc(j)
access["id"] = j
access["req"] = (j in src.accesses)
accesses[++accesses.len] = access
region["name"] = get_region_accesses_name(i)
region["accesses"] = accesses
regions[++regions.len] = region
for(var/access in get_region_accesses(i))
if (get_access_desc(access))
accesses += list(list(
"desc" = replacetext(get_access_desc(access), "&nbsp", " "),
"ref" = access,
))
regions += list(list(
"name" = get_region_accesses_name(i),
"regid" = i,
"accesses" = accesses
))
data["regions"] = regions
return data
/obj/item/electronics/airlock/ui_data()
var/list/data = list()
data["accesses"] = accesses
data["oneAccess"] = one_access
data["unres_direction"] = unres_sides
return data
/obj/item/electronics/airlock/ui_act(action, params)
@@ -48,12 +58,12 @@
accesses = list()
one_access = 0
. = TRUE
if("one_access")
one_access = !one_access
. = TRUE
if("grant_all")
accesses = get_all_accesses()
. = TRUE
if("one_access")
one_access = !one_access
. = TRUE
if("set")
var/access = text2num(params["access"])
if (!(access in accesses))
@@ -65,3 +75,20 @@
var/unres_direction = text2num(params["unres_direction"])
unres_sides ^= unres_direction //XOR, toggles only the bit that was clicked
. = TRUE
if("grant_region")
var/region = text2num(params["region"])
if(isnull(region))
return
accesses |= get_region_accesses(region)
. = TRUE
if("deny_region")
var/region = text2num(params["region"])
if(isnull(region))
return
accesses -= get_region_accesses(region)
. = TRUE
/obj/item/electronics/airlock/ui_host()
if(holder)
return holder
return src

View File

@@ -76,7 +76,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
// Variable window height, depending on how many GPS units there are
// to show, clamped to relatively safe range.
var/gps_window_height = clamp(325 + GLOB.GPS_list.len * 14, 325, 700)
ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
ui = new(user, src, ui_key, "Gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)

View File

@@ -261,6 +261,19 @@
if(S.invokers_required > 1)
data["invokers"] = "Invokers: [S.invokers_required]"
.["rec_binds"] = list()
for(var/i in 1 to maximum_quickbound)
if(GLOB.ratvar_awakens)
return
if(LAZYLEN(quickbound) < i || !quickbound[i])
.["rec_binds"] += list(list())
else
var/datum/clockwork_scripture/quickbind_slot = quickbound[i]
.["rec_binds"] += list(list(
"name" = initial(quickbind_slot.name),
"color" = get_component_color_bright(initial(quickbind_slot.primary_component))
))
.["scripture"][S.tier] += list(data)
/obj/item/clockwork/slab/ui_static_data(mob/user)
@@ -290,18 +303,6 @@
list("name" = "Power", "desc" = "The power system that certain objects use to function."),
list("name" = "Conversion", "desc" = "Converting the crew, cyborgs, and very walls to your cause.")
)
.["rec_binds"] = list()
for(var/i in 1 to maximum_quickbound)
if(GLOB.ratvar_awakens)
return
if(LAZYLEN(quickbound) < i || !quickbound[i])
.["rec_binds"] += list(list())
else
var/datum/clockwork_scripture/quickbind_slot = quickbound[i]
.["rec_binds"] += list(list(
"name" = initial(quickbind_slot.name),
"color" = get_component_color_bright(initial(quickbind_slot.primary_component))
))
// .["rec_section"]["title"] //this is here if ever we decided to return these back.
// .["rec_section"]["info"]// wall of info for the thing

View File

@@ -191,7 +191,7 @@
terminal = new/obj/machinery/power/terminal(T)
terminal.setDir(get_dir(T,src))
terminal.master = src
machine_stat &= ~BROKEN
stat &= ~BROKEN
/obj/machinery/power/smes/disconnect_terminal()
if(terminal)

View File

@@ -34,14 +34,14 @@ export const AirlockElectronics = (props, context) => {
})} />
<Button
icon={unres_direction & 2 ? 'check-square-o' : 'square-o'}
content="East"
content="South"
selected={unres_direction & 2}
onClick={() => act('direc_set', {
unres_direction: '2',
})} />
<Button
icon={unres_direction & 4 ? 'check-square-o' : 'square-o'}
content="South"
content="East"
selected={unres_direction & 4}
onClick={() => act('direc_set', {
unres_direction: '4',

View File

@@ -177,7 +177,7 @@ export const TelecommsMonitor = (props, context) => {
.find(channel => channel.freq === thing);
return (
(valid) ? (
<Box as="span" style={`color: ${valid.color}`}>
<Box as="span" color={valid.color}>
{`[${thing}] (${valid.name}) `}
</Box>
) : (

View File

@@ -268,7 +268,7 @@ export const TeleLogs = (props, context) => {
icon="sync"
onClick={() => act('refresh')}
/>
<Button
<Button.Confirm
content="Delete All Logs"
icon="trash"
disabled={!log_to_use || !(log_to_use && log_to_use.length)}

File diff suppressed because one or more lines are too long