static void HandleEnv(Player p, string type, string value)
        {
            Level lvl = p.level;

            if (CmdEnvironment.Handle(p, lvl, type, value, lvl.Config, lvl.ColoredName))
            {
                return;
            }
            p.MessageLines(envHelp);
        }
Esempio n. 2
0
        static void HandleEnv(Player p, string type, string value)
        {
            string arg = value.Length == 0 ? "normal" : value;

            if (CmdEnvironment.Handle(p, type.ToLower(), arg))
            {
                return;
            }
            Player.MessageLines(p, envHelp);
        }
Esempio n. 3
0
        void SetZoneProp(Player p, string[] args, Zone zone)
        {
            ColorDesc desc = default(ColorDesc);

            if (args.Length < 4)
            {
                p.Message("No value provided. See %T/Help zone properties");
                return;
            }

            string             opt = args[2], value = args[3];
            Predicate <Player> selector = pl => pl.ZoneIn == zone;

            if (opt.CaselessEq("alpha"))
            {
                float alpha = 0;
                if (!CommandParser.GetReal(p, value, "Alpha", ref alpha, 0, 1))
                {
                    return;
                }

                zone.UnshowAll(p.level);
                zone.Config.ShowAlpha = (byte)(alpha * 255);
                zone.ShowAll(p.level);
            }
            else if (opt.CaselessEq("col"))
            {
                if (!CommandParser.GetHex(p, value, ref desc))
                {
                    return;
                }

                zone.Config.ShowColor = value;
                zone.ShowAll(p.level);
            }
            else if (opt.CaselessEq("motd"))
            {
                zone.Config.MOTD = value;
                OnChangedZone(zone);
            }
            else if (CmdEnvironment.Handle(p, selector, opt, value, zone.Config, "zone " + zone.ColoredName))
            {
                OnChangedZone(zone);
            }
            else
            {
                Help(p, "properties"); return;
            }
            p.level.Save(true);
        }
        static void HandleEnv(Player p, string type, string value)
        {
            type = type.ToLower();
            if (type == "preset")
            {
                UseCommand(p, "Environment", "preset " + value); return;
            }

            Level  lvl = p.level;
            string arg = value.Length == 0 ? "normal" : value;

            if (CmdEnvironment.Handle(p, lvl, type, arg, lvl.Config, lvl.ColoredName))
            {
                return;
            }
            p.MessageLines(envHelp);
        }
Esempio n. 5
0
        void SetZoneProp(Player p, string[] args, Zone zone)
        {
            ColorDesc desc = default(ColorDesc);

            if (args.Length < 4)
            {
                p.Message("No value provided. See &T/Help zone properties");
                return;
            }

            string opt = args[2], value = args[3];

            if (opt.CaselessEq("alpha"))
            {
                float alpha = 0;
                if (!CommandParser.GetReal(p, value, "Alpha", ref alpha, 0, 1))
                {
                    return;
                }

                zone.UnshowAll(p.level);
                zone.Config.ShowAlpha = (byte)(alpha * 255);
                zone.ShowAll(p.level);
            }
            else if (opt.CaselessEq("col"))
            {
                if (!CommandParser.GetHex(p, value, ref desc))
                {
                    return;
                }

                zone.Config.ShowColor = value;
                zone.ShowAll(p.level);
            }
            else if (opt.CaselessEq("motd"))
            {
                zone.Config.MOTD = value;
                OnChangedZone(zone);
            }
            else if (opt.CaselessEq("text"))
            {
                if (value == "null")
                {
                    zone.Config.Text = "";
                }
                else
                {
                    bool allCmds = HasExtraPerm(p, "MB", p.Rank, 1);
                    if (!MessageBlock.Validate(p, value, allCmds))
                    {
                        return;
                    }
                    zone.Config.Text = value;
                    OnChangedZone(zone);
                }
            }
            else if (CmdEnvironment.Handle(p, p.level, opt, value, zone.Config, "zone " + zone.ColoredName))
            {
                OnChangedZone(zone);
            }
            else
            {
                Help(p, "properties"); return;
            }
            p.level.Save(true);
        }