diff --git a/pets-gd/scenes/world.tscn b/pets-gd/scenes/world.tscn index 8800ab16..06074143 100644 --- a/pets-gd/scenes/world.tscn +++ b/pets-gd/scenes/world.tscn @@ -102,10 +102,6 @@ libraries = { "": SubResource("AnimationLibrary_fv7du") } -[node name="InteractionManager" parent="." instance=ExtResource("2_uh12s")] -unique_name_in_owner = true -visible = false - [node name="BattleLayer" type="CanvasLayer" parent="."] [node name="YSort" type="Node2D" parent="."] @@ -126,8 +122,21 @@ script = ExtResource("4_jple0") [node name="Room" parent="YSort" instance=ExtResource("10_kug7e")] +[node name="InteractionManager" parent="." instance=ExtResource("2_uh12s")] +unique_name_in_owner = true + [node name="UILayer" type="CanvasLayer" parent="."] +[node name="Inventory" parent="UILayer" instance=ExtResource("3_jwkdy")] +unique_name_in_owner = true +visible = false + +[node name="DialogBox" parent="UILayer" instance=ExtResource("2_lgtmm")] +offset_left = -704.0 +offset_right = 704.0 + +[node name="WorldMenu" parent="UILayer" instance=ExtResource("2_6orff")] + [node name="BeaconFade" type="ColorRect" parent="UILayer"] unique_name_in_owner = true top_level = true @@ -137,14 +146,6 @@ offset_bottom = 1080.0 color = Color(0, 0, 0, 1) metadata/_edit_lock_ = true -[node name="Inventory" parent="UILayer" instance=ExtResource("3_jwkdy")] -unique_name_in_owner = true -visible = false - -[node name="DialogBox" parent="UILayer" instance=ExtResource("2_lgtmm")] - -[node name="WorldMenu" parent="UILayer" instance=ExtResource("2_6orff")] - [node name="Quests" type="Node" parent="."] process_mode = 4 diff --git a/pets-gd/scenes/world_menu.tscn b/pets-gd/scenes/world_menu.tscn index 5c1887f9..aa083f83 100644 --- a/pets-gd/scenes/world_menu.tscn +++ b/pets-gd/scenes/world_menu.tscn @@ -115,5 +115,5 @@ offset_right = 328.0 offset_bottom = 128.0 theme_override_fonts/normal_font = ExtResource("2_iwgvb") theme_override_font_sizes/normal_font_size = 90 -text = "09/01/2037" +text = "Date" fit_content = true diff --git a/pets-lib/src/util/mod.rs b/pets-lib/src/util/mod.rs index 3ee5859b..8e66d0b1 100644 --- a/pets-lib/src/util/mod.rs +++ b/pets-lib/src/util/mod.rs @@ -20,6 +20,24 @@ use crate::prelude::*; use godot::engine::{Engine, GDScript, SceneTreeTimer}; use godot::prelude::*; +pub fn month_string_3letter(month: u32) -> &'static str { + match month { + 1 => "Jan", + 2 => "Feb", + 3 => "Mar", + 4 => "Apr", + 5 => "May", + 6 => "Jun", + 7 => "Jul", + 8 => "Aug", + 9 => "Sep", + 10 => "Oct", + 11 => "Nov", + 12 => "Dec", + _ => panic!("Invalid month"), + } +} + // this is a macro so we can easily expand it and delete the definition // when `gdext` adds new methods for allowing zero vectors pub use crate::normalized; diff --git a/pets-lib/src/world/menu.rs b/pets-lib/src/world/menu.rs index 6a63b97a..6dc470c3 100644 --- a/pets-lib/src/world/menu.rs +++ b/pets-lib/src/world/menu.rs @@ -25,7 +25,12 @@ pub struct WorldMenu { #[godot_api] impl WorldMenu { fn set_date_txt(&self, date: NaiveDate) { - let txt = date.to_string().replace("-", "/"); + let txt = format!( + "{} {}, {}", + month_string_3letter(date.month()), + date.day(), + date.year() + ); self.base() .get_node_as::("%DatePanel/RichTextLabel") @@ -37,6 +42,8 @@ impl WorldMenu { } fn open_or_close(&mut self, open: bool) { + self.set_date_txt(si().bind().save.date); + self.opened = open; self.anim_player().play_animation_forwards("open", open);