Use names with spaces for items in property grids.

This commit is contained in:
UnknownShadow200 2016-08-17 19:14:46 +10:00
parent 6ef8517829
commit 2f683c4dbd
4 changed files with 50 additions and 8 deletions

View File

@ -31,30 +31,36 @@ namespace MCGalaxy.Gui {
[Description("Message shown to users when they join this level.")]
[Category("General")]
[DisplayName("MOTD")]
public string MOTD { get { return lvl.motd; } set { lvl.motd = value == "" ? "ignore" : value; } }
[Description("Whether this map automatically loads when the server is started.")]
[Category("General")]
[DisplayName("Load on startup")]
public bool AutoLoad { get { return GetAutoload(); } set { SetAutoload(value); } }
[Description("Whether if a player uses /goto on this map and this map is not " +
"loaded, the server then automatically loads this map.")]
[Category("General")]
[DisplayName("Load on /goto")]
public bool LoadOnGoto { get { return lvl.loadOnGoto; } set { lvl.loadOnGoto = value; } }
[Description("Whether this level should be automatically unloaded " +
"if there are no players on it anymore.")]
[Category("General")]
[DisplayName("Unload when empty")]
public bool UnloadWhenEmpty { get { return lvl.unload; } set { lvl.unload = value; } }
[Description("Whether chat on this level is only shown to players in the level," +
"and not to any other levels or IRC (if enabled).")]
[Category("General")]
[DisplayName("Level only chat")]
public bool LevelOnlyChat { get { return !lvl.worldChat; } set { lvl.worldChat = !value; } }
[Description("If this is 0 then physics is disabled. If this is 5 then only door physics are used." +
"Values between 1-4 are varying levels of physics.")]
[Category("General")]
[DisplayName("Physics level")]
public int PhysicsLevel { get { return lvl.physics; }
set { lvl.physics = Math.Min(Math.Max(value, 0), 5); }
}
@ -62,52 +68,64 @@ namespace MCGalaxy.Gui {
[Description("If physics is active, whether liquids spread infinitely or not.")]
[Category("Physics")]
[DisplayName("Finite liquids")]
public bool FiniteLiquids { get { return lvl.finite; } set { lvl.finite = value; } }
[Description("If physics is active, whether saplings should randomly grow into trees.")]
[Category("Physics")]
[DisplayName("Tree growing")]
public bool TreeGrowing { get { return lvl.growTrees; } set { lvl.growTrees = value; } }
[Description("If physics is active, whether leaf blocks not connected to trees should decay.")]
[Category("Physics")]
[DisplayName("Leaf decay")]
public bool LeafDecay { get { return lvl.leafDecay; } set { lvl.leafDecay = value; } }
[Description("If physics is active, whether spreading liquids randomly pick a direction to flow in." +
"Otherwise, spreads in all directions.")]
[Category("Physics")]
[DisplayName("Random flow")]
public bool RandomFlow { get { return lvl.randomFlow; } set { lvl.randomFlow = value; } }
[Description("If physics is active, water flows from the map edges into the world.")]
[Category("Physics")]
[DisplayName("Edge water")]
public bool EdgeWater { get { return lvl.edgeWater; } set { lvl.edgeWater = value; } }
[Description("If physics is active, whether 'animal' (bird, fish, etc) blocks " +
"should move towards the nearest player.")]
[Category("Physics")]
[DisplayName("Animal hunt AI")]
public bool AnimalHuntAI { get { return lvl.ai; } set { lvl.ai = value; } }
[Description("If physics is active, whether dirt grows into grass.")]
[Description("Whether dirt grows into grass.")]
[Category("Physics")]
[DisplayName("Grass growth")]
public bool GrassGrowth { get { return lvl.GrassGrow; } set { lvl.GrassGrow = value; } }
[Description("Whether gun usage is allowed.")]
[Category("Survival")]
[DisplayName("Guns")]
public bool Guns { get { return lvl.guns; } set { lvl.guns = value; } }
[Description("Whether certain blocks can kill players.")]
[Category("Survival")]
[DisplayName("Killer blocks")]
public bool KillerBlocks { get { return lvl.Killer; } set { lvl.Killer = value; } }
[Description("Whether players can die from drowning and falling from too high.")]
[Category("Survival")]
[DisplayName("Survival death")]
public bool SurvivalDeath { get { return lvl.Death; } set { lvl.Death = value; } }
[Description("Time taken before players drown, in tenths of a second.")]
[Category("Survival")]
[DisplayName("Drown time")]
public int DrownTime { get { return lvl.drown; } set { lvl.drown = value; } }
[Description("Falling more than this number of blocks results in death.")]
[Category("Survival")]
[DisplayName("Fall height")]
public int FallHeight { get { return lvl.fall; } set { lvl.fall = value; } }

View File

@ -1331,7 +1331,7 @@ namespace MCGalaxy.Gui
this.chkWorld.Name = "chkWorld";
this.chkWorld.Size = new System.Drawing.Size(78, 17);
this.chkWorld.TabIndex = 4;
this.chkWorld.Text = "World chat";
this.chkWorld.Text = "Server-wide chat";
this.toolTip.SetToolTip(this.chkWorld, "If disabled, every map has isolated chat.\nIf enabled, every map is able to commun" +
"icate without special letters.");
this.chkWorld.UseVisualStyleBackColor = true;

View File

@ -433,7 +433,7 @@ namespace MCGalaxy.Gui {
case "no-respawning-during-zombie":
zSettings.Respawning = value.ToLower() != "true"; break;
case "no-level-saving-during-zombie":
zSettings.SaveZombieLevelChanges = value.ToLower() != "true"; break;
zSettings.SaveLevelChanges = value.ToLower() != "true"; break;
case "no-pillaring-during-zombie":
zSettings.Pillaring = value.ToLower() != "true"; break;
case "zombie-name-while-infected":
@ -447,7 +447,7 @@ namespace MCGalaxy.Gui {
case "zombie-levels-list":
zSettings.LevelsList = value.Replace(" ", ""); break;
case "zombie-save-blockchanges":
zSettings.SaveZombieLevelChanges = value.ToLower() == "true"; break;
zSettings.SaveLevelChanges = value.ToLower() == "true"; break;
case "zombie-hitbox-precision":
zSettings.HitboxPrecision = int.Parse(value); break;
case "zombie-maxmove-distance":

View File

@ -27,119 +27,143 @@ namespace MCGalaxy.Gui {
[Description("Whether at the end of each round, different levels are randomly picked for the next round. " +
"You should generallly leave this as true.")]
[Category("Levels settings")]
[DisplayName("Change levels")]
public bool ChangeLevels { get; set; }
[Description("Whether worlds with a '+' in their name (i.e. from /os map add) are ignored " +
"when choosing levels for zombie survival.")]
[Category("Levels settings")]
[DisplayName("Ignore personal worlds")]
public bool IgnorePersonalWorlds { get; set; }
[Description("Comma separated list of levels that are never chosen for zombie survival. (e.g. main,spawn)")]
[Category("Levels settings")]
[DisplayName("Ignored level list")]
public string IgnoredLevelsList { get; set; }
[Description("Comma separated list of levels to use for zombie survival. (e.g. map1,map2,map3) " +
"If this is left blank, then all levels are used.")]
[Category("Levels settings")]
[DisplayName("Levels list")]
public string LevelsList { get; set; }
[Description("Whether changes made to a map during a round of zombie survival are permanently saved. " +
"It is HIGHLY recommended that you leave this as false.")]
[Category("Levels settings")]
public bool SaveZombieLevelChanges { get; set; }
[DisplayName("Save level changes")]
public bool SaveLevelChanges { get; set; }
[Description("Whether players are allowed to pillar in zombie survival. " +
"Note this can be overriden for specific maps using /mset.")]
[Category("General settings")]
[DisplayName("Pillaring allowed")]
public bool Pillaring { get; set; }
[Description("Whether players are allowed to use /spawn in zombie survival. " +
"You should generallly leave this as false.")]
[Category("Levels settings")]
[DisplayName("Respawning allowed")]
public bool Respawning { get; set; }
[Description("Whether the main/spawn level is always set to the current level of zombie survival. " +
"You should set this to true if the server is purely for zombie survival. ")]
[Category("General settings")]
[DisplayName("Set main level")]
public bool SetMainLevel { get; set; }
[Description("Whether zombie survival should start when the server starts.")]
[Category("General settings")]
[DisplayName("Start immediately")]
public bool StartImmediately { get; set; }
[Description("Whether awards should be given for various events/actions in zombie survival. ")]
[Category("General settings")]
[DisplayName("Use awards")]
public bool UseAwards { get; set; }
[Description("Max distance players are allowed to move between packets (for speedhack detection). " +
"32 units equals one block.")]
[Category("Other settings")]
[DisplayName("Max move distance")]
public int MaxMoveDistance { get; set; }
[Description("Distance between players before they are considered to have 'collided'. (for infecting). " +
"32 units equals one block.")]
[Category("Other settings")]
[DisplayName("Hitbox precision")]
public int 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 durations")]
public int InvisibilityDuration { get; set; }
[Description("Maximum number of invisibility potions a human is allowed to buy in a round.")]
[Category("Human settings")]
[Category("Human settings")]
[DisplayName("Invisibility potions")]
public int InvisibilityPotions { 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; }
[Description("Message shown when using /buy revive and the seconds since being infected is more than 'ExpiryTime'.")]
[Category("Revive settings")]
[DisplayName("Expiry time message")]
public string ExpiryTimeMessage { get; set; }
[Description("Message shown when a player uses /buy revive, and it actually disinfects them.")]
[Category("Revive settings")]
[DisplayName("Success message")]
public string SuccessMessage { get; set; }
[Description("Message shown when a player uses /buy revive, but does not disinfect them.")]
[Category("Revive settings")]
[DisplayName("Failure message")]
public string FailureMessage { get; set; }
public void LoadFromServer() {
ChangeLevels = ZombieGame.ChangeLevels;
IgnoredLevelsList = String.Join(",", ZombieGame.IgnoredLevelList);
LevelsList = String.Join(",", ZombieGame.LevelList);
SaveZombieLevelChanges = ZombieGame.SaveLevelBlockchanges;
SaveLevelChanges = ZombieGame.SaveLevelBlockchanges;
IgnorePersonalWorlds = ZombieGame.IgnorePersonalWorlds;
Pillaring = !ZombieGame.noPillaring;
@ -175,7 +199,7 @@ namespace MCGalaxy.Gui {
list = LevelsList.Replace(" ", "");
if (list == "") ZombieGame.LevelList = new List<string>();
else ZombieGame.LevelList = new List<string>(list.Replace(" ", "").Split(','));
ZombieGame.SaveLevelBlockchanges = SaveZombieLevelChanges;
ZombieGame.SaveLevelBlockchanges = SaveLevelChanges;
ZombieGame.IgnorePersonalWorlds = IgnorePersonalWorlds;
ZombieGame.noPillaring = !Pillaring;