コード例 #1
0
        //================================================================================
        public MainForm()
        {
            InitializeComponent();

            aWaitMessages = new string[] {
                "Finding the mirror recipe.",
                "Searching 50% of buffs.",
                "Solving P vs NP TY GL HF problem.",
                "Studying Alkaizers playlist.",
                "Making the new Diablo-like game.",
                "Sustaining T16 maps.",
                "Porting PoE to HTML5."
            };

            //app start:
            CajApp.start(this);

            //ggpk path:
            String s = CajApp.config.read(CajConfig.keyGGPKPath);

            if (s != "")
            {
                txtGgpkPath.Text = s;
            }

            //make good options:
            makeGoodTrack.Maximum = 6;
            makeGoodTrack.Value   = CajApp.config.readInt(CajConfig.keyMakeGoodValue, 2);

            //wait label. must have:
            lblWait.Visible = false;
            generateNewWaitMessage();
        }
コード例 #2
0
 //================================================================================
 void LstResSelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstRes.SelectedIndex == -1)
     {
         txtValue.Text       = "";
         mnuFile.Enabled     = false;
         txtStatusLabel.Text = "Found: " + foundItems.ToString();
     }
     else
     {
         string selName = lstRes.SelectedItem.ToString();
         string key     = keyPrefix + selName;
         if (selName.ToLowerInvariant().EndsWith(".dds", StringComparison.InvariantCulture))
         {
             setTxtValueText("[brotli texture]");
         }
         else
         {
             setTxtValueText(CajApp.getValueOfNode(key));
         }
         txtValue.SelectionStart = 0;
         txtValue.ScrollToCaret();
         mnuFile.Enabled     = true;
         txtStatusLabel.Text = "Found: " + foundItems.ToString() +
                               ". Selected: " + lstRes.SelectedItem.ToString();
         txtStatusLabel.Text = lstRes.SelectedItem.ToString();
     }
 }
コード例 #3
0
        //================================================================================
        private void startQuery()
        {
            string s = txtQuery.Text;

            if (!mnuQueryRegExp.Checked)
            {
                s = s.Trim();
                s = s.Replace("/", "\\");
                s = s.ToLower(System.Globalization.CultureInfo.InvariantCulture);
            }
            if (s == "")
            {
                return;
            }

            txtValue.Text       = "";
            foundItems          = 0;
            txtStatusLabel.Text = "in process, please wait...";
            lstRes.Items.Clear();
            mnuFile.Enabled           = false;
            mnuQueryExportAll.Enabled = false;
            lastQuery = s;

            lstRes.BeginUpdate();
            CajApp.searchInGgpk(s, mnuQueryRegExp.Checked, onQueryFoundItem);
            lstRes.EndUpdate();

            txtStatusLabel.Text = "Found: " + foundItems.ToString();
            if (foundItems > 0)
            {
                mnuQueryExportAll.Enabled = true;
            }
        }
コード例 #4
0
 //================================================================================
 void onLoadDirConfirm(string s)
 {
     if (s != "")
     {
         CajApp.loadDir(s);
     }
 }
コード例 #5
0
        //================================================================================
        public void createHotkey(string switchHotkey)
        {
            //RegisterHotKey() notes:
            //prevents key press in current target app.
            //doesn't work if PoE was run by admin and this app wasn't.
            //requires windows handle.

            removeHotkey();

            if (switchHotkey == "")
            {
                return;
            }
            try {
                registeredHotkey = (int)Enum.Parse(typeof(Keys), switchHotkey);
                if (registeredHotkey > 0)
                {
                    bool isOk = RegisterHotKey(this.Handle, switchHotkeyId, 0, registeredHotkey);
                    lastRegisteredHotkey = switchHotkey;
                    CajApp.trace("hotkey set: " + registeredHotkey.ToString() + " " +
                                 ((Keys)registeredHotkey).ToString() + ", " + isOk.ToString());
                }
                else
                {
                    CajApp.trace("no hotkey: " + registeredHotkey.ToString() + " " + switchHotkey);
                }
            } catch (Exception ex) {
                CajApp.trace("createHotkey hotkey (" + switchHotkey + ") ex: " + ex.Message);
            }
        }
コード例 #6
0
        //================================================================================
        private void lstResults_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            if (e == null)
            {
                Debug.WriteLine("RetrieveVirtualItemEventArgs is null");
                e.Item = new ListViewItem("?");
                return;
            }

            if (e.ItemIndex < 0 || e.ItemIndex >= aResults.Count)
            {
                Debug.WriteLine("incorrect ItemIndex = " + e.ItemIndex);
                e.Item = new ListViewItem("?");
                return;
            }

            try {
                var res = aResults[e.ItemIndex];
                e.Item = new ListViewItem(res);
            } catch (Exception ex) {
                Debug.WriteLine(ex);
                e.Item = new ListViewItem("?");
                CajApp.addLog("search: " + ex.Message);
            }
        }
コード例 #7
0
        //================================================================================
        private void ExportAllFoundFilesToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (foundItems == 0)
            {
                return;
            }
            if (lastQuery == "")
            {
                return;
            }

            if (foundItems > 1000)
            {
                string text = "Do you really want to export " +
                              foundItems.ToString() + " files?\r\nIt can be slow.";
                const string caption = "Export All";
                if (MessageBox.Show(text, caption, MessageBoxButtons.YesNo) != DialogResult.Yes)
                {
                    return;
                }
            }

            exportDlg.FileName = "backup";
            if (exportDlg.ShowDialog() == DialogResult.OK)
            {
                CajApp.exportAll(lastQuery, mnuQueryRegExp.Checked, exportDlg.FileName);
                txtStatusLabel.Text = "Saved: " + foundItems.ToString();
            }
        }
コード例 #8
0
 //================================================================================
 private void hideSafe()
 {
     stopThread(thSearch);
     stopThread(thDdsConvert);
     CajApp.stopExportAllThread();
     this.Hide();
 }
コード例 #9
0
        //================================================================================
        private void ButOkClick(object sender, EventArgs e)
        {
            int    type = 0;
            string text = "";

            if (optAll.Checked)
            {
                type = CajApp.NULL_TYPE_ALL;
                text = "";
            }
            else if (optAllExcept.Checked)
            {
                type = CajApp.NULL_TYPE_ALL_EXCEPT;
                text = txtList.Text;
            }
            else if (optOnly.Checked)
            {
                type = CajApp.NULL_TYPE_ONLY;
                text = txtList.Text;
            }

            int numKeepEmitters = CajApp.config.readInt(CajConfig.keyKeepEmitters, 0);

            this.Hide();

            CajApp.nullEffectsButtonAction(type, text, numKeepEmitters);
        }
コード例 #10
0
        //================================================================================
        private ListViewItem getItemView(string item)
        {
            if (aParticleFilePaths == null)
            {
                Debug.WriteLine("getItemView.aTabCheckResults == null");
                return(defaultCheckListItem);
            }
            var    res = new string[2];
            string sEmitters;
            var    node = CajApp.getNode(item);

            if (node != null)
            {
                //getting cache value, it's fast:
                int iEmitters = CajApp.recordsChanger.getEmittersNumber(node);
                sEmitters = iEmitters.ToString();
            }
            else
            {
                Debug.WriteLine("getItemView.node == null: " +
                                item + ", " + aParticleFilePaths.Count);
                sEmitters = "?";
            }
            res[0] = sEmitters;
            res[1] = item;
            return(new ListViewItem(res));
        }
コード例 #11
0
        //================================================================================
        void ButOkClick(object sender, EventArgs e)
        {
            int    type = 0;
            string text = "";

            if (optAll.Checked)
            {
                type = CajApp.NULL_TYPE_ALL;
                text = "";
            }
            else if (optAllExcept.Checked)
            {
                type = CajApp.NULL_TYPE_ALL_EXCEPT;
                text = txtList.Text;
            }
            else if (optOnly.Checked)
            {
                type = CajApp.NULL_TYPE_ONLY;
                text = txtList.Text;
            }

            int    numKeepEmitters = 0;
            String s = CajApp.config.read(CajConfig.keyKeepEmitters);

            if (s != "")
            {
                numKeepEmitters = int.Parse(s);
            }

            CajApp.nullEffects(type, text, numKeepEmitters);

            this.Hide();
        }
コード例 #12
0
 //================================================================================
 private void onLoadDirConfirm(string s)
 {
     if (s != "")
     {
         CajApp.loadDirButtonAction(s);
     }
 }
コード例 #13
0
 //================================================================================
 void MainFormResize(object sender, EventArgs e)
 {
     if (this.WindowState == FormWindowState.Minimized)
     {
         CajApp.trace("minimized");
         //removeHotkey(); //no.
     }
 }
コード例 #14
0
 //================================================================================
 private void closeForm()
 {
     isWorking = false;
     CajApp.onExit();
     //anyway don't abort alive writing threads to prevent .ggpk corrupting.
     //don't use tasks, check DevNotes.
     //use volatile flag to stop thread loops, it's safe.
 }
コード例 #15
0
 //================================================================================
 private void ButSavePetsClick(object sender, EventArgs e)
 {
     if (saveBackupDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         string savePath = saveBackupDlg.FileName;
         CajApp.saveParticlesBackupButtonAction(savePath);
     }
 }
コード例 #16
0
 //================================================================================
 void butLoadBackupClick(object sender, EventArgs e)
 {
     if (loadBackupDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         string loadPath = loadBackupDlg.FileName;
         CajApp.loadBackup(loadPath);
     }
 }
コード例 #17
0
 //================================================================================
 void OptAllExceptCheckedChanged(object sender, EventArgs e)
 {
     if (optAllExcept.Checked)
     {
         onMethodChange();
         loadList(CajApp.getAppPath() + CajApp.effectsListFileAllExcept);
     }
 }
コード例 #18
0
ファイル: Program.cs プロジェクト: ajaxvs/poeNavigator
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm frm = CajApp.start();

            Application.Run(frm);
        }
コード例 #19
0
 //================================================================================
 void ButSaveMiscClick(object sender, EventArgs e)
 {
     if (saveBackupDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         string savePath = saveBackupDlg.FileName;
         CajApp.saveMisc(savePath);
     }
 }
コード例 #20
0
 //================================================================================
 void OptOnlyCheckedChanged(object sender, EventArgs e)
 {
     if (optOnly.Checked)
     {
         onMethodChange();
         loadList(CajApp.getAppPath() + CajApp.effectsListFileOnly);
     }
 }
コード例 #21
0
        //================================================================================
        void ButOpenGgpkClick(object sender, EventArgs e)
        {
            butOpenGgpk.Enabled = false;
            txtLog.Focus();
            enableActions(false);
            CajApp.openGgpk(onOpenedGgpk);

            CajApp.config.write(CajConfig.keyGGPKPath, txtGgpkPath.Text);
        }
コード例 #22
0
 //================================================================================
 void loadList(string filePath)
 {
     try {
         txtList.Text = System.IO.File.ReadAllText(filePath);
         //lblLog.Text = CajApp.getCurrentTimeFormat() + ". loaded list."; //debug.
     } catch (Exception ex) {
         lblLog.Text  = CajApp.getCurrentTimeFormat() + ". Error loading list: " + ex.Message;
         txtList.Text = "";
     }
 }
コード例 #23
0
        //================================================================================
        private void searchThread()
        {
            CajApp.searchInGgpk(lastQuery, isLastQueryRegExp, onQueryFoundItem);

            aResults.Sort();

            Invoke(new Action(() => {
                updateUiResults();
            }));
        }
コード例 #24
0
        //================================================================================
        private void LstCheckListDoubleClick(object sender, EventArgs e)
        {
            string name;

            if (!vlstCheckList.getFirstSelectedItem(out name))
            {
                return;
            }

            CajApp.showSearchInGgpkForm(name);
        }
コード例 #25
0
 //================================================================================
 void NotifyIcon1MouseDoubleClick(object sender, MouseEventArgs e)
 {
     /*
      * //show overlay:
      * this.WindowState = FormWindowState.Normal;
      * onMin();
      * this.Show();
      */
     //options:
     CajApp.showOptions();
 }
コード例 #26
0
ファイル: frmOptions.cs プロジェクト: ajaxvs/poeNavigator
        //================================================================================
        public void onFirstLaunch()
        {
            string poeFolder = CajFuns.findPoeFolder();

            if (poeFolder != "")
            {
                txtPoeFolder.Text = poeFolder;
                CajApp.onOptionsChange(poeFolder, cbHotkey.Text);
            }
            txtPoeFolder.Focus();             //select it, so user can notice and correct it.
        }
コード例 #27
0
ファイル: CajApp.cs プロジェクト: ajaxvs/Unity_Arkanoid
    //========================================
    private void Awake()
    {
        instance = this;

        CameraAspectKeeper cameraController = FindObjectOfType <CameraAspectKeeper>();

        if (cameraController != null)
        {
            cameraController.setResizeListener(this.onResize);
        }
    }
コード例 #28
0
        //================================================================================
        private void openGgpk(bool isFromDisk)
        {
            mnuDontOpen.Enabled = false;

            butOpenGgpk.Enabled = false;
            txtLog.Focus();
            enableActions(false);
            CajApp.openGgpk(isFromDisk, onOpenedGgpk);

            CajApp.config.write(CajConfig.keyGGPKPath, txtGgpkPath.Text);
        }
コード例 #29
0
 //================================================================================
 private void onFilterQueryEnd()
 {
     if (aParticleFilePaths == null)
     {
         Debug.WriteLine("onFilterQueryEnd.updateCheckList == null");
     }
     else
     {
         CajApp.addLog("records found: " + aParticleFilePaths.Count);
         vlstCheckList.onQueryStart();
         vlstCheckList.onQueryEnd(aParticleFilePaths);
     }
 }
コード例 #30
0
        //================================================================================
        public void removeHotkey()
        {
            if (registeredHotkey == 0)
            {
                return;
            }

            try {
                UnregisterHotKey(this.Handle, switchHotkeyId);
            } catch (Exception ex) {
                CajApp.trace("removeHotkey hotkey ex: " + ex.Message);
            }
        }