mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] cleans up the storage defines properly (#11537)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6d3a215506
commit
77f4b3d10f
@@ -270,8 +270,9 @@ var/list/toxic_reagents = list(TOXIN_PATH)
|
|||||||
var/atom/bumped = args[2]
|
var/atom/bumped = args[2]
|
||||||
var/warn = FALSE
|
var/warn = FALSE
|
||||||
for(var/datum/artifact_effect/my_effect in my_effects)
|
for(var/datum/artifact_effect/my_effect in my_effects)
|
||||||
if(istype(bumped,/obj))
|
if(isitem(bumped))
|
||||||
if(bumped:throwforce >= 10)
|
var/obj/item/bumped_item = bumped
|
||||||
|
if(bumped_item.throwforce >= 10)
|
||||||
if(my_effect.trigger == TRIGGER_FORCE)
|
if(my_effect.trigger == TRIGGER_FORCE)
|
||||||
my_effect.ToggleActivate()
|
my_effect.ToggleActivate()
|
||||||
|
|
||||||
@@ -293,8 +294,9 @@ var/list/toxic_reagents = list(TOXIN_PATH)
|
|||||||
var/atom/movable/M = args[2]
|
var/atom/movable/M = args[2]
|
||||||
var/warn = FALSE
|
var/warn = FALSE
|
||||||
for(var/datum/artifact_effect/my_effect in my_effects)
|
for(var/datum/artifact_effect/my_effect in my_effects)
|
||||||
if(istype(M,/obj))
|
if(isitem(M))
|
||||||
if(M:throwforce >= 10)
|
var/obj/item/bumped_item = M
|
||||||
|
if(bumped_item.throwforce >= 10)
|
||||||
if(my_effect.trigger == TRIGGER_FORCE)
|
if(my_effect.trigger == TRIGGER_FORCE)
|
||||||
my_effect.ToggleActivate()
|
my_effect.ToggleActivate()
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,7 @@ export const IMPL_HUB_STORAGE = 1;
|
|||||||
|
|
||||||
type StorageImplementation = typeof IMPL_MEMORY | typeof IMPL_HUB_STORAGE;
|
type StorageImplementation = typeof IMPL_MEMORY | typeof IMPL_HUB_STORAGE;
|
||||||
|
|
||||||
const INDEXED_DB_VERSION = 1;
|
const KEY_NAME = 'chomp'; // CHOMPEdit - CHOMPStation Localstore
|
||||||
const INDEXED_DB_NAME = 'chomp'; // CHOMPEdit - CHOMPStation Localstore
|
|
||||||
const INDEXED_DB_STORE_NAME = 'storage-v1';
|
|
||||||
|
|
||||||
const READ_ONLY = 'readonly';
|
|
||||||
const READ_WRITE = 'readwrite';
|
|
||||||
|
|
||||||
type StorageBackend = {
|
type StorageBackend = {
|
||||||
impl: StorageImplementation;
|
impl: StorageImplementation;
|
||||||
@@ -46,7 +41,7 @@ class HubStorageBackend implements StorageBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async get(key: string): Promise<any> {
|
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') {
|
if (typeof value === 'string') {
|
||||||
return JSON.parse(value);
|
return JSON.parse(value);
|
||||||
}
|
}
|
||||||
@@ -54,11 +49,11 @@ class HubStorageBackend implements StorageBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async set(key: string, value: any): Promise<void> {
|
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> {
|
async remove(key: string): Promise<void> {
|
||||||
window.hubStorage.removeItem(`chomp-${key}`); // CHOMPEdit
|
window.hubStorage.removeItem(`${KEY_NAME}-${key}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clear(): Promise<void> {
|
async clear(): Promise<void> {
|
||||||
|
|||||||
@@ -78,7 +78,13 @@ export const CharacterPreferenceWindow = (props) => {
|
|||||||
{category}
|
{category}
|
||||||
</Button>
|
</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>
|
||||||
<Box position="absolute" top={0} right={0}>
|
<Box position="absolute" top={0} right={0}>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user