Ejemplo n.º 1
0
        public override void Help(Player p, string message)
        {
            if (message.CaselessEq("variable") || message.CaselessEq("variables"))
            {
                p.Message("%HVariables: &f{0}", EnvOptions.Options.Join(o => o.Name));
                p.Message("%HUse %T/Help env [variable] %Hto see details for that variable");
                return;
            }
            else if (message.CaselessEq("presets"))
            {
                MessagePresets(p); return;
            }

            EnvOption opt = EnvOptions.Find(message);

            if (opt != null)
            {
                p.Message("%T/Env {0} [value]", opt.Name);
                p.Message(opt.Help);
                p.Message("%HUse 'normal' for [value] to reset to default");
            }
            else
            {
                p.Message("%WUnrecognised property \"{0}\"", message);
            }
        }
Ejemplo n.º 2
0
        internal static bool Handle(Player p, Level lvl, string type, string value, EnvConfig cfg, string area)
        {
            if (type.CaselessEq("preset"))
            {
                EnvPreset preset = FindPreset(value);
                if (preset == null)
                {
                    MessagePresets(p); return(false);
                }

                cfg.SkyColor    = preset.Sky;
                cfg.CloudColor  = preset.Clouds;
                cfg.FogColor    = preset.Fog;
                cfg.ShadowColor = preset.Shadow;
                cfg.LightColor  = preset.Sun;
            }
            else if (type.CaselessEq("normal"))
            {
                cfg.ResetEnv();
                p.Message("Reset environment for {0} %Sto normal", area);
            }
            else
            {
                EnvOption opt = EnvOptions.Find(type);
                if (opt == null)
                {
                    return(false);
                }
                opt.SetFunc(p, area, cfg, value);
            }

            if (lvl == null)
            {
                Player[] players = PlayerInfo.Online.Items;
                foreach (Player pl in players)
                {
                    pl.SendCurrentEnv();
                }
                SrvProperties.Save();
            }
            else
            {
                SendEnv(lvl);
                lvl.SaveSettings();
            }
            return(true);
        }