using singleton for playername now
This commit is contained in:
16
player_variables.cs
Normal file
16
player_variables.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
public partial class player_variables : Node
|
||||
{
|
||||
public static string PlayerName = "Yannik";
|
||||
|
||||
public static void ClearPlayerName() //normal getter setter crashes for some reason
|
||||
{
|
||||
PlayerName = Regex.Replace(PlayerName, @"\[[^]]+\]", "");
|
||||
PlayerName = Regex.Replace(PlayerName, @"<[^>]*>", "");
|
||||
if (PlayerName.Length > 12)
|
||||
PlayerName = PlayerName.Substring(0, 12);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user