mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] cleans up some left over things (#10168)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
90e86a173a
commit
9ffe6f5fcb
@@ -91,7 +91,6 @@ The "dust" will damage the hull of the station causin minor hull breaches.
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/space_dust/Bump(atom/A)
|
||||
spawn(0)
|
||||
if(prob(50))
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !isAI(M))
|
||||
|
||||
@@ -485,7 +485,7 @@
|
||||
name = "Diskette Box"
|
||||
icon_state = "disk_kit"
|
||||
|
||||
/obj/item/storage/box/Initialize()
|
||||
/obj/item/storage/box/disks/Initialize()
|
||||
. = ..()
|
||||
new /obj/item/disk/body_record(src)
|
||||
new /obj/item/disk/body_record(src)
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
dropped.density = FALSE
|
||||
dropped.opacity = FALSE
|
||||
animate(dropped, pixel_y = initial_y, pixel_x = initial_x , time = 7)
|
||||
spawn(7)
|
||||
dropped.end_fall(crushing)
|
||||
addtimer(CALLBACK(dropped, TYPE_PROC_REF(/atom/movable,end_fall), crushing), 0.7 SECONDS)
|
||||
qdel(src)
|
||||
|
||||
/atom/movable/proc/end_fall(var/crushing = FALSE)
|
||||
|
||||
@@ -512,8 +512,7 @@
|
||||
playsound(src, 'sound/effects/explosionfar.ogg', 50, 0, 0)
|
||||
for(var/mob/M in range(10, src)) // Checks range
|
||||
if(!M.stat && !isAI(M)) // Checks to make sure whoever's getting shaken is alive/not the AI
|
||||
sleep(2) // Short delay to match up with the explosion sound
|
||||
shake_camera(M, 2, 1)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(shake_camera), M, 2, 1), 0.2 SECONDS)
|
||||
else
|
||||
to_chat(user, span_warning("Nothing happens."))
|
||||
|
||||
|
||||
@@ -437,8 +437,14 @@
|
||||
|
||||
if(ticker < burst)
|
||||
addtimer(CALLBACK(src, PROC_REF(handle_gunfire),target, user, clickparams, pointblank, reflex, ++ticker, TRUE), burst_delay, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
|
||||
if(ticker == burst)
|
||||
if(muzzle_flash)
|
||||
if(gun_light)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light),light_brightness), burst_delay, TIMER_DELETE_ME)
|
||||
else
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light),0), burst_delay, TIMER_DELETE_ME)
|
||||
|
||||
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
|
||||
/obj/item/gun/proc/Fire_userless(atom/target)
|
||||
@@ -594,7 +600,6 @@
|
||||
to_chat(user, span_warning("You struggle to hold \the [src] steady!"))
|
||||
|
||||
if(recoil)
|
||||
spawn()
|
||||
shake_camera(user, recoil+1, recoil)
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
/obj/item/projectile/meteor
|
||||
name = "meteor"
|
||||
icon = 'icons/obj/meteor.dmi'
|
||||
icon_state = "smallf"
|
||||
icon_state = "small"
|
||||
damage = 0
|
||||
damage_type = BRUTE
|
||||
nodamage = 1
|
||||
@@ -121,8 +121,6 @@
|
||||
loc = A.loc
|
||||
return
|
||||
|
||||
sleep(-1) //Might not be important enough for a sleep(-1) but the sleep/spawn itself is necessary thanks to explosions and metoerhits
|
||||
|
||||
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
|
||||
if(A)
|
||||
|
||||
|
||||
@@ -41,11 +41,14 @@
|
||||
for(var/area/A in shuttle_area)
|
||||
for(var/mob/living/L in A)
|
||||
victims += L
|
||||
spawn(0)
|
||||
shake_camera(L,2 SECONDS,4)
|
||||
|
||||
//SHAKA SHAKA SHAKA
|
||||
sleep(2 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(after_crash), victims, target), 2 SECONDS)
|
||||
|
||||
/datum/shuttle/proc/after_crash(var/list/victims, var/obj/effect/shuttle_landmark/target)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
|
||||
// Move the shuttle
|
||||
if (!attempt_move(target))
|
||||
|
||||
@@ -330,7 +330,6 @@
|
||||
TA.ChangeTurf(get_base_turf_by_area(TA), 1, 1)
|
||||
if(knockdown)
|
||||
for(var/mob/living/M in A)
|
||||
spawn(0)
|
||||
if(M.buckled)
|
||||
to_chat(M, span_red("Sudden acceleration presses you into \the [M.buckled]!"))
|
||||
shake_camera(M, 3, 1)
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
/datum/tgui_say/proc/load()
|
||||
window_open = FALSE
|
||||
|
||||
var/minimumHeight = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_height) || 1
|
||||
var/minimumWidth = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_width) || 1
|
||||
var/minimum_height = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_height) || 1
|
||||
var/minimu_width = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_width) || 1
|
||||
winset(client, "tgui_say", "pos=410,400;size=360,30;is-visible=0;")
|
||||
|
||||
window.send_message("props", list(
|
||||
lightMode = client?.prefs?.read_preference(/datum/preference/toggle/tgui_say_light),
|
||||
minimumHeight = minimumHeight,
|
||||
minimumWidth = minimumWidth,
|
||||
minimumHeight = minimum_height,
|
||||
minimumWidth = minimu_width,
|
||||
maxLength = max_length,
|
||||
))
|
||||
|
||||
|
||||
@@ -61,7 +61,17 @@ class HubStorageBackend {
|
||||
class StorageProxy {
|
||||
constructor() {
|
||||
this.backendPromise = (async () => {
|
||||
if (!Byond.TRIDENT && testHubStorage()) {
|
||||
if (!Byond.TRIDENT) {
|
||||
if (!testHubStorage()) {
|
||||
return new Promise((resolve) => {
|
||||
const listener = () => {
|
||||
document.removeEventListener('byondstorageupdated', listener);
|
||||
resolve(new HubStorageBackend());
|
||||
};
|
||||
|
||||
document.addEventListener('byondstorageupdated', listener);
|
||||
});
|
||||
}
|
||||
return new HubStorageBackend();
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -130,7 +130,7 @@ export function TguiSay() {
|
||||
const prefix = currentPrefix ?? '';
|
||||
const grunt = iterator.isSay() ? prefix + value : value;
|
||||
|
||||
messages.current.forceSayMsg(grunt, iterator.current());
|
||||
messages.current.forceSayMsg(grunt);
|
||||
unloadChat();
|
||||
}
|
||||
|
||||
@@ -140,10 +140,26 @@ export function TguiSay() {
|
||||
iterator.next();
|
||||
setButtonContent(iterator.current());
|
||||
setCurrentPrefix(null);
|
||||
messages.current.channelIncrementMsg(iterator.isVisible());
|
||||
messages.current.channelIncrementMsg(
|
||||
iterator.isVisible(),
|
||||
iterator.current(),
|
||||
);
|
||||
}
|
||||
|
||||
function handleDecrementChannel() {
|
||||
const iterator = channelIterator.current;
|
||||
|
||||
iterator.prev();
|
||||
setButtonContent(iterator.current());
|
||||
setCurrentPrefix(null);
|
||||
messages.current.channelIncrementMsg(
|
||||
iterator.isVisible(),
|
||||
iterator.current(),
|
||||
);
|
||||
}
|
||||
|
||||
function handleInput(event: FormEvent<HTMLTextAreaElement>): void {
|
||||
const iterator = channelIterator.current;
|
||||
let newValue = event.currentTarget.value;
|
||||
|
||||
let newPrefix = getPrefix(newValue) || currentPrefix;
|
||||
@@ -160,7 +176,7 @@ export function TguiSay() {
|
||||
|
||||
// Handles typing indicators
|
||||
if (channelIterator.current.isVisible() && newPrefix !== ',b ') {
|
||||
messages.current.typingMsg();
|
||||
messages.current.typingMsg(iterator.current());
|
||||
}
|
||||
|
||||
setValue(newValue);
|
||||
@@ -236,6 +252,10 @@ export function TguiSay() {
|
||||
|
||||
case KEY.Tab:
|
||||
event.preventDefault();
|
||||
if (event.shiftKey) {
|
||||
handleDecrementChannel();
|
||||
break;
|
||||
}
|
||||
handleIncrementChannel();
|
||||
break;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ function setWindowVisibility(visible: boolean): void {
|
||||
});
|
||||
}
|
||||
|
||||
const CHANNEL_REGEX = /^[:.]|,b\w\s/;
|
||||
const CHANNEL_REGEX = /^[:.]\w|,b\s/;
|
||||
|
||||
/** Tests for a channel prefix, returning it or none */
|
||||
export function getPrefix(
|
||||
|
||||
@@ -8,15 +8,18 @@ const SECONDS = 1000;
|
||||
export const byondMessages = {
|
||||
// Debounce: Prevents spamming the server
|
||||
channelIncrementMsg: debounce(
|
||||
(visible: boolean) => Byond.sendMessage('thinking', { visible }),
|
||||
(visible: boolean, channel: Channel) =>
|
||||
Byond.sendMessage('thinking', { visible, channel }),
|
||||
0.4 * SECONDS,
|
||||
),
|
||||
forceSayMsg: debounce(
|
||||
(entry: string, channel: Channel) =>
|
||||
Byond.sendMessage('force', { entry, channel }),
|
||||
(entry: string) => Byond.sendMessage('force', { entry, channel: 'Say' }),
|
||||
1 * SECONDS,
|
||||
true,
|
||||
),
|
||||
// Throttle: Prevents spamming the server
|
||||
typingMsg: throttle(() => Byond.sendMessage('typing'), 4 * SECONDS),
|
||||
typingMsg: throttle(
|
||||
(channel: string) => Byond.sendMessage('typing', { channel }),
|
||||
4 * SECONDS,
|
||||
),
|
||||
} as const;
|
||||
|
||||
@@ -311,43 +311,6 @@ export const useBackend = <TData>() => {
|
||||
*/
|
||||
type StateWithSetter<T> = [T, (nextState: T) => void];
|
||||
|
||||
/**
|
||||
* Allocates state on Redux store without sharing it with other clients.
|
||||
*
|
||||
* Use it when you want to have a stateful variable in your component
|
||||
* that persists between renders, but will be forgotten after you close
|
||||
* the UI.
|
||||
*
|
||||
* It is a lot more performant than `setSharedState`.
|
||||
*
|
||||
* @param context React context.
|
||||
* @param key Key which uniquely identifies this state in Redux store.
|
||||
* @param initialState Initializes your global variable with this value.
|
||||
* @deprecated Use useState and useEffect when you can. Pass the state as a prop.
|
||||
*/
|
||||
export const useLocalState = <T>(
|
||||
key: string,
|
||||
initialState: T,
|
||||
): StateWithSetter<T> => {
|
||||
const state = globalStore?.getState()?.backend;
|
||||
const sharedStates = state?.shared ?? {};
|
||||
const sharedState = key in sharedStates ? sharedStates[key] : initialState;
|
||||
return [
|
||||
sharedState,
|
||||
(nextState) => {
|
||||
globalStore.dispatch(
|
||||
backendSetSharedState({
|
||||
key,
|
||||
nextState:
|
||||
typeof nextState === 'function'
|
||||
? nextState(sharedState)
|
||||
: nextState,
|
||||
}),
|
||||
);
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
* Allocates state on Redux store, and **shares** it with other clients
|
||||
* in the game.
|
||||
|
||||
Reference in New Issue
Block a user