Clean up runtime errors, fix VueUIs opening offscreen (#14025)

* Clean up runtime errors, fix VueUIs opening offscreen

* woops

* myazaki is based
This commit is contained in:
Wildkins
2022-05-20 18:36:14 +02:00
committed by GitHub
parent da0000f7f2
commit 2bb8db37b9
14 changed files with 51 additions and 22 deletions
@@ -126,7 +126,7 @@
return 1
/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
usr.set_machine(src)
user.set_machine(src)
var/list/data = new()
@@ -139,7 +139,7 @@
sanitize_faction()
/datum/category_item/player_setup_item/occupation/content(mob/user, limit = 16, list/splitJobs = list("Chief Engineer", "Head of Security"))
if (SSjobs.init_state != SS_INITSTATE_DONE && SSrecords.init_state != SS_INITSTATE_DONE)
if (SSjobs.init_state != SS_INITSTATE_DONE || SSrecords.init_state != SS_INITSTATE_DONE)
return "<center><large>Jobs controller not initialized yet. Please wait a bit and reload this section.</large></center>"
var/list/dat = list(
@@ -422,6 +422,9 @@
dat += factions.Join(" | ") + "</b>"
var/datum/faction/faction = SSjobs.name_factions[selected_faction]
if(!istype(faction))
to_client_chat(SPAN_DANGER("Invalid faction chosen. Resetting to default."))
selected_faction = SSjobs.default_faction.name
if (selected_faction == pref.faction)
dat += "<br>\[Faction already selected\]"
@@ -7,7 +7,7 @@
maptext_y = 11
/obj/screen/mecha/proc/notify_user(var/mob/user, var/text)
if(user.loc == owner)
if(user && user.loc == owner)
to_chat(user, text)
/obj/screen/mecha/radio
@@ -342,4 +342,4 @@
maptext = "<span style=\"font-family: 'Small Fonts'; color: [main_color]; -dm-text-outline: 1 #242424; font-size: 5px;\">VOLUME</span>"
notify_user(usr, SPAN_NOTICE("You [owner.loudening ? "activate" : "deactivate"] \the [owner]'s integrated megaspeakers."))
#undef BAR_CAP
#undef BAR_CAP
@@ -225,6 +225,9 @@
/datum/preferences/proc/return_chosen_high_job(var/title = FALSE)
var/datum/job/chosenJob
if(SSjobs.init_state < SS_INITSTATE_DONE)
return
if(job_civilian_low & ASSISTANT)
// Assistant is weird, has to be checked first because it overrides
chosenJob = SSjobs.bitflag_to_job["[SERVICE]"]["[job_civilian_low]"]
@@ -147,6 +147,10 @@
var/list/body_markings = prefs.body_markings
for(var/M in body_markings)
var/datum/sprite_accessory/marking/mark_datum = body_marking_styles_list[M]
if(!istype(mark_datum))
to_chat(usr, SPAN_WARNING("Invalid body marking [M] selected! Please re-save your markings, as they may have changed."))
continue
var/mark_color = "[body_markings[M]]"
for(var/BP in mark_datum.body_parts)
+5 -4
View File
@@ -137,11 +137,12 @@
if(isnull(scoped_accuracy))
scoped_accuracy = accuracy
if (!pin && needspin)
pin = /obj/item/device/firing_pin
if(pin && needspin)
if (needspin)
if(!pin)
pin = /obj/item/device/firing_pin
pin = new pin(src)
else
pin = null
if(istype(loc, /obj/item/robot_module))
has_safety = FALSE
+7 -1
View File
@@ -90,7 +90,13 @@ main ui datum.
var/params = "window=[windowid];file=[windowid];titlebar=0;can_resize=0;"
if(width && height)
params += "size=[width]x[height];"
var/winsize = winget(user, "mapwindow", "size")
var/map_size = splittext(winsize, "x")
var/screen_height = text2num(map_size[2])
if(height > screen_height)
params += "size=[width]x[max(screen_height - 100, 240)];"
else
params += "size=[width]x[height];"
send_resources_and_assets(user.client, load_asset)
user << browse(generate_html(load_asset?.css_tag()), params)
winset(user, "mapwindow.map", "focus=true")