Skip to content

Commit

Permalink
some more recipes and pref sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Sep 10, 2024
1 parent 5a14bc9 commit 18d5630
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)

/// If set to TRUE, will update character_profiles on the next ui_data tick.
var/tainted_character_profiles = FALSE
///have we finished loading
var/loaded = FALSE

/datum/preferences/Destroy(force)
QDEL_NULL(character_preview_view)
Expand Down Expand Up @@ -129,8 +131,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
parent.set_macros()

if(!loaded_preferences_successfully)
stack_trace("[parent]'s preferences failed to load! Attempting a reload of preferences.")
if(load_preferences())
if(load_character())
return
stack_trace("[parent]'s preferences failed to load a second time! This means their keybindings and other non character settings may be lost.")
message_admins("[parent]'s prefs failed to load twice! Their keybindings and tokens may have been lost please check on this.")
save_preferences()
save_character() //let's save this new random character so it doesn't keep generating new ones.
loaded = TRUE

/datum/preferences/ui_interact(mob/user, datum/tgui/ui)
// There used to be code here that readded the preview view if you "rejoined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@
list(CHEWIN_ADD_REAGENT, /datum/reagent/consumable/soysauce, 3, base=3),
list(CHEWIN_USE_STOVE, J_HI, 5 SECONDS , finish_text = "You can smell fried rice!"),
)

/datum/chewin_cooking/recipe/ikareis
cooking_container = PAN
food_category = CAT_STOVETOP
product_type = /obj/item/food/salad/ikareis
recipe_guide = "Add boiled rice to pan, some squid ink, add vegetables and sausage, cook for 20 seconds on high."
step_builder = list(
list(CHEWIN_ADD_ITEM, /obj/item/food/boiledrice, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/canned/squid_ink, qmod=0.5),
list(CHEWIN_ADD_PRODUCE, /obj/item/food/grown/bell_pepper, qmod=0.5),
list(CHEWIN_ADD_ITEM, /obj/item/food/sausage, qmod=0.5),

list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/onion_slice, qmod=0.5),
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/pineappleslice, qmod=0.5, prod_desc = "Extra sweet!"),
list(CHEWIN_ADD_ITEM_OPTIONAL, /obj/item/food/grown/chili, qmod=0.5, prod_desc = "Extra spicy!"),

list(CHEWIN_USE_STOVE, J_HI, 20 SECONDS , finish_text = "You can smell ikareis!"),
)
2 changes: 2 additions & 0 deletions monkestation/code/modules/client/verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ GLOBAL_LIST_INIT(antag_token_config, load_antag_token_config())
to_chat(src, span_notice("NOTE: You will be spawned where ever your ghost is when approved, so becareful where you are."))

if(!client_token_holder)
if(!client.prefs?.loaded)

Check failure on line 22 in monkestation/code/modules/client/verbs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "client"

Check warning on line 22 in monkestation/code/modules/client/verbs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "prefs"

Check warning on line 22 in monkestation/code/modules/client/verbs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "loaded"

Check failure on line 22 in monkestation/code/modules/client/verbs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0404: Unknown identifier "client"
CRASH("Tried to load client_token's before prefs were loaded how the fuck?")
client_token_holder = new(src)

var/tier = tgui_input_list(src, "High: [client_token_holder.total_high_threat_tokens] | \
Expand Down
2 changes: 2 additions & 0 deletions monkestation/code/modules/mob/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
client?.twitch = new(client)

if(QDELETED(client?.client_token_holder))
if(!client?.prefs.loaded)
CRASH("Tried to load client_token's on a logging in mob but prefs haven't loaded.")
client?.client_token_holder = new(client)

0 comments on commit 18d5630

Please sign in to comment.