Skip to content

Commit

Permalink
Remove most of 'Zombie old' from GUI, since it is now in 'Zombie surv…
Browse files Browse the repository at this point in the history
…ival'
  • Loading branch information
UnknownShadow200 committed Feb 2, 2021
1 parent eeb1baa commit 2d921a5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 136 deletions.
97 changes: 50 additions & 47 deletions GUI/PropertyWindow/PropertyWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions GUI/PropertyWindow/PropertyWindow.Games.cs
Expand Up @@ -92,8 +92,10 @@ public partial class PropertyWindow : Form {
cfg.ReviveChance = (int)zs_numReviveEff.Value;
cfg.ReviveTooSlow = (int)zs_numReviveLimit.Value;

cfg.ZombieName = zs_txtName.Text;
cfg.ZombieModel = zs_txtModel.Text;
cfg.ZombieName = zs_txtName.Text.Trim();
cfg.ZombieModel = zs_txtModel.Text.Trim();
if (cfg.ZombieModel.Length == 0) cfg.ZombieModel = "zombie";

zsHelper.Save();
} catch (Exception ex) {
Logger.LogError("Error saving ZS settings", ex);
Expand Down
87 changes: 0 additions & 87 deletions GUI/Settings/ZombieProperties.cs
Expand Up @@ -40,84 +40,12 @@ public sealed class ZombieProperties {
[DisplayName("Hitbox precision")]
public float HitboxPrecision { get; set; }

[Description("Whether the current map's name is included when a hearbeat is sent. " +
"This means it shows up in the server list as: \"Server name (current map name)\"")]
[Category("Other settings")]
[DisplayName("Include map in heartbeat")]
public bool IncludeMapInHeartbeat { get; set; }


[Description("Name to show above infected players. If this is left blank, then the player's name is used instead.")]
[Category("Zombie settings")]
[DisplayName("Name")]
public string Name { get; set; }

[Description("Model to use for infected players. If this is left blank, then 'zombie' model is used.")]
[Category("Zombie settings")]
[DisplayName("Model")]
public string Model { get; set; }


[Description("How many seconds an invisibility potion bought using /buy invisibility lasts.")]
[Category("Human settings")]
[DisplayName("Invisibility duration")]
public int InvisibilityDuration { get; set; }

[Description("Maximum number of invisibility potions a human is allowed to buy in a round.")]
[Category("Human settings")]
[DisplayName("Invisibility potions")]
public int InvisibilityPotions { get; set; }

[Description("How many seconds an invisibility potion bought using /buy zinvisibility lasts.")]
[Category("Zombie settings")]
[DisplayName("Invisibility duration")]
public int ZInvisibilityDuration { get; set; }

[Description("Maximum number of invisibility potions a zombie is allowed to buy in a round.")]
[Category("Zombie settings")]
[DisplayName("Invisibility potions")]
public int ZInvisibilityPotions { get; set; }


[Description("The percentage chance that a revive potion will actually disinfect a zombie.")]
[Category("Revive settings")]
[DisplayName("Chance")]
public int Chance { get; set; }

[Description("The minimum number of seconds left in a round, below which /buy revive will not work.")]
[Category("Revive settings")]
[DisplayName("Insufficient time")]
public int InsufficientTime { get; set; }

[Description("Message shown when using /buy revive and the seconds left in a round is less than 'InsufficientTime'.")]
[Category("Revive settings")]
[DisplayName("Insufficient time message")]
public string InsufficientTimeMessage { get; set; }

[Description("The maximum number of seconds after a human is infected, after which /buy revive will not work.")]
[Category("Revive settings")]
[DisplayName("Expiry time")]
public int ExpiryTime { get; set; }

public void LoadFromServer() {
ZSConfig cfg = ZSGame.Config;

Pillaring = !cfg.NoPillaring;
MaxMoveDistance = cfg.MaxMoveDist;
HitboxPrecision = cfg.HitboxDist;
IncludeMapInHeartbeat = cfg.MapInHeartbeat;

Name = cfg.ZombieName;
Model = cfg.ZombieModel;
InvisibilityDuration = cfg.InvisibilityDuration;
InvisibilityPotions = cfg.InvisibilityPotions;
ZInvisibilityDuration = cfg.ZombieInvisibilityDuration;
ZInvisibilityPotions = cfg.ZombieInvisibilityPotions;

Chance = cfg.ReviveChance;
InsufficientTime = cfg.ReviveNoTime;
InsufficientTimeMessage = cfg.ReviveNoTimeMessage;
ExpiryTime = cfg.ReviveTooSlow;
}

public void ApplyToServer() {
Expand All @@ -126,21 +54,6 @@ public sealed class ZombieProperties {
cfg.NoPillaring = !Pillaring;
cfg.MaxMoveDist = MaxMoveDistance;
cfg.HitboxDist = HitboxPrecision;
cfg.MapInHeartbeat = IncludeMapInHeartbeat;

cfg.ZombieName = Name.Trim();
cfg.ZombieModel = Model.Trim();
if (cfg.ZombieModel.Length == 0)
cfg.ZombieModel = "zombie";
cfg.InvisibilityDuration = InvisibilityDuration;
cfg.InvisibilityPotions = InvisibilityPotions;
cfg.ZombieInvisibilityDuration = ZInvisibilityDuration;
cfg.ZombieInvisibilityPotions = ZInvisibilityPotions;

cfg.ReviveChance = Chance;
cfg.ReviveNoTime = InsufficientTime;
cfg.ReviveNoTimeMessage = InsufficientTimeMessage;
cfg.ReviveTooSlow = ExpiryTime;
}
}
}

0 comments on commit 2d921a5

Please sign in to comment.