mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-09 10:39:46 -10:00
toast_add: ask for main's new socialInteractions tutorial hint too
Merging main brought Hint::SocialInteractions (#9796); Hint::name was no longer exhaustive. The first-server hint is now asked like the others, and is still spent when cancelled, as vanilla sets joinedFirstServer either way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
65326a0d84
commit
6fa2c99334
3 files changed
+9
-4
No files matched your search
@@ -6086,7 +6086,7 @@ impl Game<'_> {
|
||||
/// is `advancement`, `recipe`, `tutorial`, `system` or `now_playing`;
|
||||
/// `id` is the advancement id, the first recipe id, the tutorial hint
|
||||
/// (`move`, `look`, `find_tree`, `punch_tree`, `open_inventory`,
|
||||
/// `craft_planks`), the system toast's id (`narrator_toggle`,
|
||||
/// `craft_planks`, `socialInteractions`), the system toast's id (`narrator_toggle`,
|
||||
/// `pack_load_failure`, `pack_download`, `low_disk_space`,
|
||||
/// `chunk_load_failure`, `chunk_save_failure`), or empty for
|
||||
/// `now_playing`. An update to a toast already queued or shown is not an
|
||||
|
||||
@@ -44,6 +44,7 @@ impl Hint {
|
||||
Hint::PunchTree => "punch_tree",
|
||||
Hint::OpenInventory => "open_inventory",
|
||||
Hint::CraftPlanks => "craft_planks",
|
||||
Hint::SocialInteractions => "socialInteractions",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,8 +275,12 @@ impl super::Game<'_> {
|
||||
if !self.settings.file.bool("joinedFirstServer")
|
||||
&& (!self.has_singleplayer_server() || self.is_published())
|
||||
{
|
||||
let toast = self.tutorial_toast(Hint::SocialInteractions, Some(0.0));
|
||||
self.tutorial_toasts.push(toast);
|
||||
// ToastManager.addToast: a mod may cancel it; the hint is still
|
||||
// spent (`joinedFirstServer`), as vanilla sets it either way.
|
||||
if self.toast_allowed("tutorial", Hint::SocialInteractions.name()) {
|
||||
let toast = self.tutorial_toast(Hint::SocialInteractions, Some(0.0));
|
||||
self.tutorial_toasts.push(toast);
|
||||
}
|
||||
self.settings.file.set(
|
||||
"joinedFirstServer",
|
||||
horizon_client::options_file::V::Bool(true),
|
||||
|
||||
+1
-1
@@ -2886,7 +2886,7 @@ before it is queued, so a mod can drop recipe toasts, tutorial hints or the adva
|
||||
and `id` say which:
|
||||
|
||||
- `advancement`: the advancement id; `recipe`: the first recipe id of the toast;
|
||||
- `tutorial`: the hint, `move`, `look`, `find_tree`, `punch_tree`, `open_inventory` or `craft_planks`;
|
||||
- `tutorial`: the hint, `move`, `look`, `find_tree`, `punch_tree`, `open_inventory`, `craft_planks` or `socialInteractions`;
|
||||
- `system`: `narrator_toggle`, `pack_load_failure`, `pack_download` (a server pack batch's progress), `low_disk_space`,
|
||||
`chunk_load_failure` or `chunk_save_failure`;
|
||||
- `now_playing`: an empty id, each time the music toast shows a new song.
|
||||
|
||||
Reference in new issue
Block a user