Add commit hash label
This commit is contained in:
parent
33fbeb4c99
commit
c67f1fc83e
@ -1,29 +1,12 @@
|
|||||||
[gd_scene format=3 uid="uid://lahirbqfppvw"]
|
[gd_scene format=3 uid="uid://lahirbqfppvw"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bbmc2gmy7g8ag" path="res://scenes/player/menu_player.tscn" id="1_o5qli"]
|
[ext_resource type="PackedScene" uid="uid://bbmc2gmy7g8ag" path="res://scenes/player/menu_player.tscn" id="1_o5qli"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dsxu0y8pjbw3k" path="res://scenes/ui/credits.tscn" id="1_sugp2"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://n3u0jr4wiib1" path="res://scenes/ui/settings.tscn" id="2_0wfyh"]
|
[ext_resource type="PackedScene" uid="uid://n3u0jr4wiib1" path="res://scenes/ui/settings.tscn" id="2_0wfyh"]
|
||||||
[ext_resource type="Theme" uid="uid://drydbnrcdv4pk" path="res://default_theme.tres" id="3_jscy8"]
|
[ext_resource type="Theme" uid="uid://drydbnrcdv4pk" path="res://default_theme.tres" id="3_jscy8"]
|
||||||
[ext_resource type="Texture2D" uid="uid://3gpd2qpyw5eq" path="res://assets/title.png" id="4_pm3ni"]
|
[ext_resource type="Texture2D" uid="uid://3gpd2qpyw5eq" path="res://assets/title.png" id="4_pm3ni"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c62c5iq0w72ka" path="res://maps/precipice/precipice_static.scn" id="6_tefeu"]
|
[ext_resource type="PackedScene" uid="uid://c62c5iq0w72ka" path="res://maps/precipice/precipice_static.scn" id="6_tefeu"]
|
||||||
|
|
||||||
[node name="menu" type="MainMenu" unique_id=2036763876 node_paths=PackedStringArray("camera", "main_position", "host_position", "main_panel", "host_panel", "join_panel", "host_port", "join_addr", "join_port", "recent_servers_button", "popup_panel", "popup_title", "popup_text", "popup_button", "open_replay_dialog")]
|
[node name="menu" type="Node3D" unique_id=2036763876]
|
||||||
camera = NodePath("camera_3d")
|
|
||||||
main_position = NodePath("main_pos")
|
|
||||||
host_position = NodePath("host_pos")
|
|
||||||
main_panel = NodePath("menus/main_panel")
|
|
||||||
host_panel = NodePath("menus/host_panel")
|
|
||||||
join_panel = NodePath("menus/join_panel")
|
|
||||||
host_port = NodePath("menus/host_panel/v_box_container/host_port")
|
|
||||||
join_addr = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/address_text")
|
|
||||||
join_port = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/port_text")
|
|
||||||
recent_servers_button = NodePath("menus/join_panel/v_box_container/margin_container/v_box_container/recent_servers")
|
|
||||||
popup_panel = NodePath("menus/popup_panel")
|
|
||||||
popup_title = NodePath("menus/popup_panel/v_box_container/title")
|
|
||||||
popup_text = NodePath("menus/popup_panel/v_box_container/text")
|
|
||||||
popup_button = NodePath("menus/popup_panel/v_box_container/ok")
|
|
||||||
credits = ExtResource("1_sugp2")
|
|
||||||
open_replay_dialog = NodePath("open_replay_dialog")
|
|
||||||
|
|
||||||
[node name="camera_3d" type="Camera3D" parent="." unique_id=1513321931]
|
[node name="camera_3d" type="Camera3D" parent="." unique_id=1513321931]
|
||||||
transform = Transform3D(0.98629165, -0.031186381, 0.16203775, -1.4054481e-08, 0.981978, 0.1889952, -0.16501158, -0.18640438, 0.9685167, 1.0974052, 1.7166122, 1.4909106)
|
transform = Transform3D(0.98629165, -0.031186381, 0.16203775, -1.4054481e-08, 0.981978, 0.1889952, -0.16501158, -0.18640438, 0.9685167, 1.0974052, 1.7166122, 1.4909106)
|
||||||
@ -149,6 +132,10 @@ layout_mode = 2
|
|||||||
text = "Quit"
|
text = "Quit"
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="label" type="CommitHashLabel" parent="menus/main_panel/v_box_container/margin_container/v_box_container" unique_id=1742881725]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Checksum: 33fbeb"
|
||||||
|
|
||||||
[node name="host_panel" type="Panel" parent="menus" unique_id=1633876079]
|
[node name="host_panel" type="Panel" parent="menus" unique_id=1633876079]
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
@ -349,5 +336,4 @@ text = "Ok"
|
|||||||
[connection signal="pressed" from="menus/host_panel/v_box_container/back" to="." method="go_to_main_menu"]
|
[connection signal="pressed" from="menus/host_panel/v_box_container/back" to="." method="go_to_main_menu"]
|
||||||
[connection signal="pressed" from="menus/join_panel/v_box_container/join" to="." method="join_game"]
|
[connection signal="pressed" from="menus/join_panel/v_box_container/join" to="." method="join_game"]
|
||||||
[connection signal="pressed" from="menus/join_panel/v_box_container/back" to="." method="go_to_main_menu"]
|
[connection signal="pressed" from="menus/join_panel/v_box_container/back" to="." method="go_to_main_menu"]
|
||||||
[connection signal="on_close" from="menus/settings" to="." method="focus_next"]
|
|
||||||
[connection signal="pressed" from="menus/popup_panel/v_box_container/ok" to="." method="hide_popup"]
|
[connection signal="pressed" from="menus/popup_panel/v_box_container/ok" to="." method="hide_popup"]
|
||||||
|
|||||||
22
rust/src/ui/commit_hash_label.rs
Normal file
22
rust/src/ui/commit_hash_label.rs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
use godot::{
|
||||||
|
classes::{ILabel, Label},
|
||||||
|
prelude::*,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(GodotClass)]
|
||||||
|
#[class(base=Label, tool, init)]
|
||||||
|
pub struct CommitHashLabel {
|
||||||
|
base: Base<Label>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[godot_api]
|
||||||
|
impl ILabel for CommitHashLabel {
|
||||||
|
fn ready(&mut self) {
|
||||||
|
let hash = env!("GIT_HASH")
|
||||||
|
.to_string()
|
||||||
|
.chars()
|
||||||
|
.take(6)
|
||||||
|
.collect::<String>();
|
||||||
|
self.base_mut().set_text(&format!("Checksum: {}", hash));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
pub mod chatbox;
|
pub mod chatbox;
|
||||||
pub mod cli;
|
pub mod cli;
|
||||||
|
pub mod commit_hash_label;
|
||||||
pub mod cooldown_icon;
|
pub mod cooldown_icon;
|
||||||
pub mod credits;
|
pub mod credits;
|
||||||
pub mod game_finished_screen;
|
pub mod game_finished_screen;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user