示例#1
0
        public void Execute(Engine engine, WDCScript currentScript, frmDeveloperConsole console, object arg)
        {
            if (engine.CheatEnabled && currentScript is GarbageClassificationScript)
            {
                string[] arr = arg as string[];
                if (arr.Count() == 1)
                {
                    console.Print("Invalid Parameters");
                    return;
                }

                int mode = int.Parse(arr[1].ToString());
                if (mode == 0)
                {
                    (currentScript as GarbageClassificationScript).HideCurrentAnswer();
                }
                else if (mode == 1)
                {
                    (currentScript as GarbageClassificationScript).ShowCurrentAnswer();
                }
                console.Print("Done");
            }
            else
            {
                console.Print("You need to enable cheat mode first!");
            }
        }
示例#2
0
 public void Execute(Engine engine, WDCScript currentScript, frmDeveloperConsole console, object arg)
 {
     foreach (var kpl in ConsoleCommandManager.Instance.AvaiableConsoleCommands)
     {
         console.Print(kpl.Key);
     }
 }
示例#3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (scriptList.SelectedItem == null)
            {
                MessageBox.Show("Please choose a avaiable script to launch!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else if (cmbLanguages.SelectedItem == null)
            {
                MessageBox.Show("Please choose a avaiable language to launch!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else if (cmbResolutionList.SelectedItem == null)
            {
                MessageBox.Show("Please choose a avaiable reolution to launch!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            WDCScript selectedScript = ScriptManager.Instance.scripts[scriptList.SelectedItem.ToString()];

            Config = new GameConfig();
            Config.CurrentSelectedScript = selectedScript;
            Config.CurrentSelectedLocate = LocateTableManager.Instance.ConvertDisplayStrToID(cmbLanguages.SelectedItem.ToString());
            Config.Resolution            = cmbResolutionList.SelectedItem.ToString();

            DialogResult = DialogResult.OK;
            Hide();
        }
示例#4
0
        public void InitScripts()
        {
            string currentScriptFullPath = Path.Combine(Environment.CurrentDirectory, "Scripts");

            if (!Directory.Exists(currentScriptFullPath))
            {
                Directory.CreateDirectory(currentScriptFullPath);
            }

            DirectoryInfo di    = new DirectoryInfo(currentScriptFullPath);
            var           files = di.EnumerateFiles();

            foreach (var file in files)
            {
                if (file.Extension == ".dll")
                {
                    Assembly assembly = Assembly.LoadFrom(file.FullName);
                    var      types    = assembly.GetExportedTypes();
                    foreach (var type in types)
                    {
                        var scriptType = type.GetInterface("WDCScript");
                        if (scriptType != null)
                        {
                            WDCScript script = (WDCScript)Activator.CreateInstance(type);
                            scripts.Add(Path.GetFileNameWithoutExtension(file.Name), script);
                        }
                    }
                }
            }
        }
示例#5
0
 public frmDeveloperConsole(Engine engine, WDCScript currentScript)
 {
     InitializeComponent();
     Deactivate        += FrmDeveloperConsole_Deactivate;
     this.engine        = engine;
     this.currentScript = currentScript;
 }
示例#6
0
        public void Init(GameConfig config)
        {
            script = config.CurrentSelectedScript;
            LocateTableManager.Instance.Init(config.CurrentSelectedLocate);

            renderResolution = new Point();
            string[] tokens = config.Resolution.Split('x');
            renderResolution.X = int.Parse(tokens[0]);
            renderResolution.Y = int.Parse(tokens[1]);

            renderer = new GDIRenderer();
            renderer.ChangeResolution(renderResolution);

            script.BeforeRunScript();
        }
        public void Execute(Engine engine, WDCScript script, frmDeveloperConsole consoleForm, object arg)
        {
            string[] arr = arg as string[];
            if (arr.Count() == 1)
            {
                consoleForm.Print("Invalid Parameters");
                return;
            }

            int mode = int.Parse(arr[1].ToString());

            if (mode == 0)
            {
                engine.DisableCheat();
                consoleForm.Print("Cheat Disabled!");
            }
            else if (mode == 1)
            {
                engine.EnableCheat();
                consoleForm.Print("Cheat Enabled!");
            }
        }