コード例 #1
0
        public override void onSelect(string id, string text)
        {
            // Attempt to keep the same resolution settings:
            GuiPopUpMenuCtrl resMenu =
                ((OptionsDlg)"OptionsDlg").findObjectByInternalName("OptGraphicsResolutionMenu", true);
            string currRes = resMenu.getText();

            // If its empty the use the current.
            if (currRes == "")
            {
                currRes = OptionsDlg._makePrettyResString(((GuiCanvas)"Canvas").getVideoMode());
            }

            // Fill the resolution list.
            ((OptionsDlg)"optionsDlg").initResMenu();
            // Try to select the previous settings:

            int selId = resMenu.findText(currRes);

            if (selId == -1)
            {
                selId = 0;
            }
            resMenu.setSelected(selId);

            ((OptionsDlg)"optionsDlg")._updateApplyState();

            sGlobal["$pref::Video::displayDevice"] = this.getText();
        }
コード例 #2
0
        public static void redoMapping(string device, string action, string cmd, int oldIndex, int newIndex)
        {
            ((ActionMap)"moveMap").bind(device, action, cmd);

            GuiTextListCtrl remapList = ((OptRemapInputCtrl)"OptRemapInputCtrl").findObjectByInternalName("OptRemapList", true);

            remapList.setRowById(oldIndex, OptionsDlg.buildFullMapString(oldIndex));
            remapList.setRowById(newIndex, OptionsDlg.buildFullMapString(newIndex));
        }
コード例 #3
0
        public override void Setup()
        {
            base.Setup();

            fBase = new BaseWindowMock();

            fDialog = new OptionsDlg(AppHost.Instance);
            fDialog.Show();
        }
コード例 #4
0
        private void OnBatchReplaceOperation(object sender, EventArgs e)
        {
            BatchOptionBase <ReplaceOption> bo = ObjSerializer.Load <BatchOptionBase <ReplaceOption> >(BatchConfigFile);

            _batchOptDlg = new OptionsDlg();
            _batchOptDlg.AddOption(bo);

            if (_batchOptDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            ObjSerializer.Save(BatchConfigFile, bo);
            BatchTextReplacer batchPro = new BatchTextReplacer(bo);

            batchPro.Start();
        }
コード例 #5
0
        private void OnBatchTextMining(object sender, EventArgs e)
        {
            OptionsDlg       batchOptDlg = new OptionsDlg();
            BatchInOutOption fileOptions = new BatchInOutOption();

            batchOptDlg.AddOption(fileOptions);

            if (batchOptDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BatchTextCounter batchPro = new BatchTextCounter(fileOptions);

            batchPro.Start();

            _toolStripStatusLabel.Text = "Total# of words: " + batchPro.Result.Count;
            UpdateOutputDataGrid(batchPro.Result);
        }
コード例 #6
0
        private void OnReplace(object sender, EventArgs e)
        {
            if (_procOpt == null)
            {
                _procOpt = new ReplaceOption();
                _optDlg  = new OptionsDlg();
                _optDlg.AddOption(_procOpt);
            }

            if (_optDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            StrStreamProvider provider  = new StrStreamProvider(_textBoxInput.Text);
            MemoryStream      memstrm   = new MemoryStream();
            TextReplacer      processor = new TextReplacer((new StreamWriter(memstrm)), _procOpt);

            TextDispatcher dispatcher = new TextDispatcher(provider, processor);

            dispatcher.Run();
            UpdateOutputTextBox(Encoding.Default.GetString(memstrm.GetBuffer()));
        }
コード例 #7
0
        public override void onInputEvent(string device, string action, bool state)
        {
            //error( "** onInputEvent called - device = " @ %device @ ", action = " @ %action @ " **" );
            ((GuiCanvas)"Canvas").popDialog("RemapDlg");

            // Test for the reserved keystrokes:
            if (device == "keyboard")
            {
                //Cancel
                if (action == "escape")
                {
                    //do Nothing
                    return;
                }
            }

            string cmd = sGlobal["$RemapCmd[" + this["index"] + "]"];

            cmd = sGlobal["$RemapName[" + this["index"] + "]"];

            // Grab the friendly display name for this action
            // which we'll use when prompting the user below.

            string mapName = OptionsDlg.getMapDisplayName(device, action);

            string prevMap = ((ActionMap)"MoveMap").getCommand(device, action);

            // If nothing was mapped to the previous command

            // mapping then it's easy... just bind it.
            OptionsDlg optionsDlg = "optionsDlg";

            if (prevMap == "")
            {
                unbindExtraActions(cmd, 1);
                ((ActionMap)"moveMap").bind(device, action, cmd);
                ((GuiTextListCtrl)optionsDlg.findObjectByInternalName("OptRemapList", true)).setRowById(this["index"].AsInt(), OptionsDlg.buildFullMapString(this["index"].AsInt()));
                return;
            }

            // If the previous command is the same as the
            // current then they hit the same input as what
            // was already assigned.

            if (prevMap == cmd)
            {
                unbindExtraActions(cmd, 0);
                ((ActionMap)"moveMap").bind(cmd, action, cmd);
                ((GuiTextListCtrl)optionsDlg.findObjectByInternalName("OptRemapList", true)).setRowById(this["index"].AsInt(), OptionsDlg.buildFullMapString(this["index"].AsInt()));
                return;
            }
            // Look for the index of the previous mapping.
            int prevMapIndex = findRemapCmdIndex(prevMap);

            // If we get a negative index then the previous
            // mapping was to an item that isn't included in
            // the mapping list... so we cannot unmap it.

            if (prevMapIndex == -1)
            {
                messageBox.MessageBoxOK("Remap Failed", "\"" + mapName + "\" is already bound to a non-remappable command!", "");
                return;
            }

            // Setup the forced remapping callback command.
            string callback = "redoMapping(" + device + ",\"" + action + "\",\"" + cmd + "\", " + prevMapIndex + ", " + this["index"] + ");";
            // Warn that we're about to remove the old mapping and
            // replace it with another.
            string prevCmdName = sGlobal["$RemapName[" + prevMapIndex + "];"];

            messageBox.MessageBoxYesNo("Warning", "\"" + mapName + "\" is already bound to \"" + prevCmdName + "\"!\nDo you wish to replace this mapping?", callback, "");
        }
コード例 #8
0
ファイル: init.cs プロジェクト: Dwarf-King/OmniEngine.Net
        public static void initClient()
        {
            omni.console.print("\n--------- Initializing " + omni.sGlobal["$appName"] + ": Client Scripts ---------");

            // Make sure this variable reflects the correct state.
            omni.bGlobal["$Server::Dedicated"] = false;

            // Game information used to query the master server
            omni.sGlobal["$Client::GameTypeQuery"]    = omni.sGlobal["$appName"];
            omni.sGlobal["$Client::MissionTypeQuery"] = "Any";


            // These should be game specific GuiProfiles.  Custom profiles are saved out
            // from the Gui Editor.  Either of these may override any that already exist.

            defaultGameProfiles.Initialize();
            customProfiles.Initialize();
            // The common module provides basic client functionality
            client.initBaseClient();

            // Use our prefs to configure our Canvas/Window
            canvas.configureCanvas();

            // Load up the Game GUIs
            //omni.Util.exec("art/gui/PlayGui.gui", false, false);
            playGui.initialize();


            //omni.Util.exec("art/gui/playerList.gui", false, false);


            //omni.Util.exec("art/gui/hudlessGui.gui", false, false);
            hudlessGui.initialize();

            // Load up the shell GUIs

            //omni.Util.exec("art/gui/mainMenuGui.gui", false, false);
            mainMenuGui.initialize();

            //omni.Util.exec("art/gui/joinServerDlg.gui", false, false);
            JoinServerDlg.initialize();

            //omni.Util.exec("art/gui/endGameGui.gui", false, false);
            endGameGui.initialize();

            //omni.Util.exec("art/gui/StartupGui.gui", false, false);
            startupGui.initialize();

            //omni.Util.exec("art/gui/chooseLevelDlg.gui", false, false);
            //chooseLevelDlg.Initialize();

            //omni.Util.exec("art/gui/loadingGui.gui", false, false);
            loadingGui.initialize();

            //omni.Util.exec("art/gui/optionsDlg.gui", false, false);
            OptionsDlg.initialize();

            ToolsDlg.initialize();

            CBObjectRenameCtrl.initialize();

            ContentBrowserGui.initialize();

            //omni.Util.exec("art/gui/remapDlg.gui", false, false);
            RemapDlg.initialize();



            //omni.Util.exec("scripts/gui/optionsDlg.cs", false, false);
            Misc.initialize();

            // Client scripts
            missionDownload.initialize();
            // Load useful Materials
            shaders.initialize_CustomShaders();

            // Default player key bindings
            defaultBind.initialize();

            if (omni.Util.isFile("scripts/client/config.cs"))
            {
                omni.Util.exec("scripts/client/config.cs", false, false);
            }



            //string[] files = Directory.GetFiles( System.IO.Path.Combine( AppDomain.CurrentDomain.BaseDirectory,@"art\gui"), "*.png", SearchOption.AllDirectories);
            //foreach (string file in files)
            //    {
            //    ObjectCreator oc_Newobject1 = new ObjectCreator("GuiBitMapCtrl", "");
            //    oc_Newobject1["Enabled"] = "1";
            //    oc_Newobject1["isContainer"] = "0";
            //    oc_Newobject1["Profile"] = "GuiDefaultProfile";
            //    oc_Newobject1["HorizSizing"] = "right";
            //    oc_Newobject1["VertSizing"] = "bottom";
            //    oc_Newobject1["position"] = "10 31";
            //    oc_Newobject1["Extent"] = "400 300";
            //    oc_Newobject1["MinExtent"] = "8 2";
            //    oc_Newobject1["canSave"] = "1";
            //    oc_Newobject1["Visible"] = "1";
            //    oc_Newobject1["tooltipprofile"] = "GuiToolTipProfile";
            //    oc_Newobject1["hovertime"] = "1000";
            //    oc_Newobject1["bitmap"] = file;
            //    oc_Newobject1["wrap"] = "0";
            //    oc_Newobject1.Create();
            //    }



            core.loadMaterials();

            // Really shouldn't be starting the networking unless we are
            // going to connect to a remote server, or host a multi-player
            // game.

            omni.Util.setNetPort(0, false);

            omni.console.Call("setDefaultFov", new[] { omni.sGlobal["$pref::Player::defaultFov"] });
            omni.console.Call("setZoomSpeed", new[] { omni.sGlobal["$pref::Player::zoomSpeed"] });
            audioData.initialize();

            // Start up the main menu... this is separated out into a
            // method for easier mod override

            if (omni.bGlobal["$startWorldEditor"] || omni.bGlobal["$startGUIEditor"])
            {
                // Editor GUI's will start up in the primary main.cs once
                // engine is initialized.
                return;
            }

            if (omni.sGlobal["$JoinGameAddress"] != "")
            {
                init.loadLoadingGui("loadLoadingGui");
                missionDownload.connect(omni.sGlobal["$JoinGameAddress"]);
            }
            else
            {
                // Otherwise go to the splash screen.
                ((GuiCanvas)"canvas").setCursor("DefaultCursor");
                startupGui.loadStartup();
                //omni.console.Call("loadStartup");
            }
        }