Skip to content

Commit

Permalink
bugfix: radio, airalarm, refresh tgui (ss220-space#5387)
Browse files Browse the repository at this point in the history
  • Loading branch information
ROdenFL authored Jul 8, 2024
1 parent 4b3bb91 commit d55c25d
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 13 deletions.
17 changes: 16 additions & 1 deletion code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,21 @@
if("thermostat_state")
thermostat_state = !thermostat_state


/obj/machinery/alarm/ui_state(mob/user)
if(isAI(user))
var/mob/living/silicon/ai/AI = user
if(!AI.lacks_power() || AI.apc_override)
return GLOB.always_state

else if(ishuman(user))
for(var/obj/machinery/computer/atmoscontrol/AC in range(1, user))
if(!AC.stat)
return GLOB.always_state

return GLOB.default_state


/obj/machinery/alarm/emag_act(mob/user)
if(!emagged)
emagged = TRUE
Expand All @@ -962,8 +977,8 @@
playsound(src.loc, 'sound/effects/sparks4.ogg', 50, TRUE)
return

/obj/machinery/alarm/attackby(obj/item/I, mob/user, params)

/obj/machinery/alarm/attackby(obj/item/I, mob/user, params)
switch(buildstage)
if(AIR_ALARM_READY)
if(I.GetID() || is_pda(I)) // trying to unlock the interface
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
if(freqlock)
return
var/freq = params["ichannel"]
if(has_channel_access(usr, freq))
set_frequency(text2num(freq))
if(has_channel_access(usr, num2text(freq)))
set_frequency(freq)
if("listen")
listening = !listening
if("broadcast")
Expand Down
23 changes: 23 additions & 0 deletions code/modules/client/preference/preferences_toggles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,26 @@
prefs.toggles2 ^= PREFTOGGLE_2_MC_TABS
prefs.save_preferences(src)
to_chat(src, "You will [(prefs.toggles2 & PREFTOGGLE_2_MC_TABS) ? "now" : "no longer"] see the MC tabs on the top right.")



/// Delete after tgui panel
/client/verb/refresh_tgui()
set name = "Refresh TGUI"
set category = "Special Verbs"

var/choice = alert(usr,
"Use it ONLY if you have trouble with TGUI window.\
That's UI's with EYE on top-left corner.\
Otherwise, you can get a white window that will only close when you restart the game!", "Refresh TGUI", "Refresh", "Cancel")
if(choice != "Refresh")
return
var/refreshed_count = 0
for(var/window_id in tgui_windows)
var/datum/tgui_window/window = tgui_windows[window_id]
if(!window.locked)
window.acquire_lock()
continue
window.reinitialize()
refreshed_count++
to_chat(usr, "<span class='notice'>TGUI windows refreshed - [refreshed_count].<br>If you have blank window - restart the game, or open previous TGUI window.</span>")
6 changes: 2 additions & 4 deletions code/modules/paperwork/photocopier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@
else
P.forceMove(loc)

P.update_icon()

P.icon_state = "paper_words"
P.update_appearance(UPDATE_ICON|UPDATE_DESC)
P.name = bundle.name
P.pixel_y = rand(-8, 8)
P.pixel_x = rand(-9, 9)
Expand Down Expand Up @@ -613,7 +611,7 @@
default_unfasten_wrench(user, I)

/obj/machinery/photocopier/obj_break(damage_flag)
if(!(flags & NODECONSTRUCT))
if(!(obj_flags & NODECONSTRUCT))
if(toner > 0)
new /obj/effect/decal/cleanable/blood/oil(get_turf(src))
toner = 0
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/BluespaceRiftServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const BluespaceRiftServer = (props, context) => {
};

return (
<Window width={570} heigth={400}>
<Window width={570} height={400}>
<Window.Content scrollable>
{goals && goals.map((goalData) => goal(goalData))}
<Section title="Сканеры в сети">
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/ChemDispenser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ChemDispenser = (props, context) => {
const { act, data } = useBackend(context);
const { chemicals } = data;
return (
<Window width={400} height={400 + chemicals.length * 8}>
<Window width={460} height={400 + chemicals.length * 8}>
<Window.Content>
<Stack fill vertical>
<ChemDispenserSettings />
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/CryopodConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const CryopodConsole = (props, context) => {
const { account_name, allow_items } = data;

return (
<Window title="Cryopod Console">
<Window width={450} height={530}>
<Window.Content>
<Section title={`Hello, ${account_name || '[REDACTED]'}!`}>
This automated cryogenic freezing unit will safely store your
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/VampireSpecMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Window } from '../layouts';

export const VampireSpecMenu = (props, context) => {
return (
<Window width={1500} heigth={820} theme="nologo">
<Window width={1500} height={820} theme="nologo">
<Window.Content>
<Stack fill>
<HemoMenu />
Expand Down
4 changes: 2 additions & 2 deletions tgui/public/tgui.bundle.js

Large diffs are not rendered by default.

0 comments on commit d55c25d

Please sign in to comment.