forked from Puppet/berry-dash-godot-remake
Finished the outdated version menu
Now I can make any version either not be able to access the servers or not be playable at all. So thats good.
This commit is contained in:
1 parent
62de4bd400
commit
0f1d574da3
4 files changed
+19
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dggreseg0i3de"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dggreseg0i3de"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://5tcka2u0ra0u" path="res://Scripts/OutdatedVersionLogic.cs" id="1_1ejpl"]
|
||||
[ext_resource type="FontFile" uid="uid://dq7nkk7n7wrq4" path="res://Fonts/Lexend.ttf" id="1_4oqe8"]
|
||||
[ext_resource type="Script" uid="uid://bc4miccifwrk0" path="res://Scripts/SceneSwitcher.cs" id="2_1ejpl"]
|
||||
|
||||
@@ -23,6 +24,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_1ejpl")
|
||||
|
||||
[node name="Header" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class OutdatedVersionLogic : Control {
|
||||
public override void _Ready() {
|
||||
if (Globals.AccessLevel == "client") {
|
||||
GetNode<Label>("Header/SecondaryText").Text = "You can not access the servers!";
|
||||
} else if (Globals.AccessLevel == "none") {
|
||||
GetNode<Button>("Buttons/ContinueButton").Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://5tcka2u0ra0u
|
||||
@@ -40,7 +40,9 @@ public partial class VersionChecker : Control {
|
||||
|
||||
Globals.VersionChecked = true;
|
||||
|
||||
if (Globals.AccessLevel != "all") {
|
||||
string GameVersion = ProjectSettings.GetSetting("application/config/version").AsString();
|
||||
|
||||
if (Globals.AccessLevel != "all" || GameVersion != Globals.LatestVersion) {
|
||||
var error = GetTree().ChangeSceneToFile("res://Scenes/OutdatedVersion.tscn");
|
||||
|
||||
if (error != Error.Ok) {
|
||||
|
||||
Reference in new issue
Block a user