[MIRROR] cleans up the storage defines properly (#11537)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-29 19:53:35 -07:00
committed by GitHub
parent 6d3a215506
commit 77f4b3d10f
3 changed files with 17 additions and 14 deletions

View File

@@ -270,8 +270,9 @@ var/list/toxic_reagents = list(TOXIN_PATH)
var/atom/bumped = args[2]
var/warn = FALSE
for(var/datum/artifact_effect/my_effect in my_effects)
if(istype(bumped,/obj))
if(bumped:throwforce >= 10)
if(isitem(bumped))
var/obj/item/bumped_item = bumped
if(bumped_item.throwforce >= 10)
if(my_effect.trigger == TRIGGER_FORCE)
my_effect.ToggleActivate()
@@ -293,8 +294,9 @@ var/list/toxic_reagents = list(TOXIN_PATH)
var/atom/movable/M = args[2]
var/warn = FALSE
for(var/datum/artifact_effect/my_effect in my_effects)
if(istype(M,/obj))
if(M:throwforce >= 10)
if(isitem(M))
var/obj/item/bumped_item = M
if(bumped_item.throwforce >= 10)
if(my_effect.trigger == TRIGGER_FORCE)
my_effect.ToggleActivate()

View File

@@ -11,12 +11,7 @@ export const IMPL_HUB_STORAGE = 1;
type StorageImplementation = typeof IMPL_MEMORY | typeof IMPL_HUB_STORAGE;
const INDEXED_DB_VERSION = 1;
const INDEXED_DB_NAME = 'chomp'; // CHOMPEdit - CHOMPStation Localstore
const INDEXED_DB_STORE_NAME = 'storage-v1';
const READ_ONLY = 'readonly';
const READ_WRITE = 'readwrite';
const KEY_NAME = 'chomp'; // CHOMPEdit - CHOMPStation Localstore
type StorageBackend = {
impl: StorageImplementation;
@@ -46,7 +41,7 @@ class HubStorageBackend implements StorageBackend {
}
async get(key: string): Promise<any> {
const value = await window.hubStorage.getItem(`chomp-${key}`); // CHOMPEdit
const value = await window.hubStorage.getItem(`${KEY_NAME}-${key}`);
if (typeof value === 'string') {
return JSON.parse(value);
}
@@ -54,11 +49,11 @@ class HubStorageBackend implements StorageBackend {
}
async set(key: string, value: any): Promise<void> {
window.hubStorage.setItem(`chomp-${key}`, JSON.stringify(value)); // CHOMPEdit
window.hubStorage.setItem(`${KEY_NAME}-${key}`, JSON.stringify(value));
}
async remove(key: string): Promise<void> {
window.hubStorage.removeItem(`chomp-${key}`); // CHOMPEdit
window.hubStorage.removeItem(`${KEY_NAME}-${key}`);
}
async clear(): Promise<void> {

View File

@@ -78,7 +78,13 @@ export const CharacterPreferenceWindow = (props) => {
{category}
</Button>
))}
<Button onClick={() => act('game_prefs')}>Game Options</Button>
<Button.Confirm
onClick={() => act('game_prefs')}
tooltip="Switches to Game Options, make sure your character is saved before switching."
confirmContent="Confirm? (Discard Unsaved)"
>
Game Options
</Button.Confirm>
</Box>
<Box position="absolute" top={0} right={0}>
<Button