Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // On Working Monitor
            this.Location = Screen.AllScreens[0].WorkingArea.Location;
            CenterToScreen();
            this.TopMost = true;
            zoneName     = "?";
            actString    = "?";

            currentDirectory = Application.StartupPath;

            bool bRet = ReadDirectionHelperData();

            if (bRet == false)
            {
                this.Close();
                Environment.Exit(0);
            }

            /*
             * [DIRECTIONHELPER]
             * POELOGPATH="SET"
             */

            string    strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            string strPath = "";

            try
            {
                strPath             = parser.GetSetting("DIRECTIONHELPER", "POELOGPATH");
                zoneName            = parser.GetSetting("INITPART", "zoneName");
                actString           = parser.GetSetting("INITPART", "actString");
                this.noteLabel.Text = "";
                string strLastPart = parser.GetSetting("INITPART", "LASTPART");
                if (strLastPart == "1")
                {
                    partTwo = false;
                }
                else if (strLastPart == "2")
                {
                    partTwo = true;
                }

                /*
                 * [LOCATION]
                 * LEFT=1385
                 * TOP=941
                 * ISMIN=N
                 */
                string sLeft = parser.GetSetting("LOCATION", "LEFT");
                string sTop  = parser.GetSetting("LOCATION", "TOP");
                string sMin  = parser.GetSetting("LOCATION", "ISMIN");

                if (sLeft != "CENTER" && sTop != "CENTER")
                {
                    this.StartPosition = FormStartPosition.Manual;
                    this.Left          = Int32.Parse(sLeft);
                    this.Top           = Int32.Parse(sTop);
                }
            }
            catch
            {
                MSGForm frmMSG = new MSGForm();
                frmMSG.lbMsg.Text = "환경 파일을 읽을 수 없습니다.\r\n\r\nini 파일이 손상되었거나 삭제되었습니다.";
                frmMSG.ShowDialog();
                this.Close();
                Environment.Exit(0);
            }

            if (File.Exists(strPath))
            {
                try
                {
                    fileStream = File.Open(strPath, mode: FileMode.Open, access: FileAccess.Read, share: FileShare.ReadWrite);
                    logStream  = new StreamReader(fileStream);
                }
                catch
                {
                    MSGForm frmMSG = new MSGForm();
                    frmMSG.lbMsg.Text = "패스 오브 엑자일 로그파일을 읽는 도중 오류가 발생했습니다. ‼‼‼";
                    frmMSG.ShowDialog();
                    this.Close();
                    Environment.Exit(0);
                }

                if (actString == "?")
                {
                    actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
                }

                if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
                {
                    parser.AddSetting("INITPART", "LASTPART", "1");
                    noteLabel.Text = "마을입니다.";
                }
                else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "마을입니다.";
                }
                else if (actString == "O")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "액트 클리어를 축하드립니다.";
                }
                else if (actString == "Z")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "지도의 대가 자나를 만나보세요.";
                }
                else if (actString == "H")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "멋진 은신처군요~!";
                }
                else
                {
                    parser.AddSetting("INITPART", "LASTPART", "3");
                    noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
                }
                parser.AddSetting("INITPART", "zoneName", zoneName);
                parser.AddSetting("INITPART", "actString", actString);
                parser.SaveSettings();

                btnLangText  = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
                btnLang.Text = btnLangText;

                Check_UILanguageWrapping();

                // Move to the end of the file
                fileStream.Seek(-512, SeekOrigin.End);

                // Start watching client log file
                zoneWatcher.Enabled = true;
            }
            else
            {
                MSGForm frmMSG = new MSGForm();
                frmMSG.lbMsg.Text = "패스 오브 엑자일 경로가 맞지 않습니다.\r\n경로를 설정해주세요.";
                frmMSG.ShowDialog();
                FolderBrowserDialog dlgFolder = new FolderBrowserDialog();
                DialogResult        dr        = dlgFolder.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    if (strMainFromKAKAOUSER == "YES")
                    {
                        strPath = String.Format("{0}\\{1}", dlgFolder.SelectedPath, "logs\\KakaoClient.txt");
                    }
                    else
                    {
                        strPath = String.Format("{0}\\{1}", dlgFolder.SelectedPath, "logs\\Client.txt");
                    }
                }
                else
                {
                    this.Close();
                    Environment.Exit(0);
                }

                // Set Ini.
                parser.AddSetting("DIRECTIONHELPER", "POELOGPATH", strPath);
                parser.SaveSettings();

                try
                {
                    fileStream = File.Open(strPath, mode: FileMode.Open, access: FileAccess.Read, share: FileShare.ReadWrite);
                    logStream  = new StreamReader(fileStream);
                }
                catch
                {
                    MSGForm frmMSG2 = new MSGForm();
                    frmMSG2.lbMsg.Text = "패스 오브 엑자일 로그파일을 읽는 도중 오류가 발생했습니다. ‼‼‼";
                    frmMSG2.ShowDialog();
                    this.Close();
                    Environment.Exit(0);
                }

                if (actString == "?")
                {
                    actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
                }

                if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
                {
                    parser.AddSetting("INITPART", "LASTPART", "1");
                    noteLabel.Text = "마을입니다.";
                }
                else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "마을입니다.";
                }
                else if (actString == "O")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "액트 클리어를 축하드립니다.";
                }
                else if (actString == "Z")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "지도의 대가 자나를 만나보세요.";
                }
                else if (actString == "H")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "멋진 은신처군요~!";
                }
                else
                {
                    parser.AddSetting("INITPART", "LASTPART", "3");
                    noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
                }
                parser.AddSetting("INITPART", "zoneName", zoneName);
                parser.AddSetting("INITPART", "actString", actString);
                parser.SaveSettings();

                btnLangText  = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
                btnLang.Text = btnLangText;

                Check_UILanguageWrapping();

                // Move to the end of the file
                fileStream.Seek(-512, SeekOrigin.End);

                // Start watching client log file
                zoneWatcher.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void ReadNewLines_Timer(object sender, EventArgs e)
        {
            // Read new line every 100 ms and detect zone...
            string line  = logStream.ReadToEnd();
            string image = null;

            Match mRemains = RegExMonsterRemains.Match(line);

            if (mRemains.Success)
            {
                string strRemains = "?";

                strRemains = mRemains.Groups[1].ToString();
                if (strRemains.Contains("More"))
                {
                    strRemains = "50+";
                }

                RemainingForm formMonster = new RemainingForm();
                formMonster.lbRemain.Text = strRemains;
                formMonster.Show();
            }

            Match mRemainsKORMore = null;

            if (g_strUILang == "KOR")
            {
                mRemainsKORMore = RegExMonsterRemainsKORMore.Match(line);
            }
            else if (g_strUILang == "ENG")
            {
                mRemainsKORMore = RegExMonsterRemainsENGMore.Match(line);
            }

            if (mRemainsKORMore.Success)
            {
                string strRemainsMore = "50+";

                RemainingForm formMonster = new RemainingForm();
                formMonster.lbRemain.Text = strRemainsMore;
                formMonster.Show();
            }

            Match m = RegExZoneEntered.Match(line);

            if (m.Success)
            {
                // New zone has been entered - update graphics.
                zoneName  = m.Groups[1].ToString();
                actString = "?";

                bSeedFound = false;

                PictureBox[] picBox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4 };
                image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");

                InitMapImage(); // Clear Map Image

                // Attempt to find a corresponding zoneName
                var seedList = FindZoneName(zoneName);
                int nIndex   = 0;
                if (seedList.Item2.Length > 0)
                {
                    foreach (var seed in seedList.Item2) // region.Region (ACT), zone.ZoneSeed (Image), zone.Note (Explain Text)
                    {
                        actString = seedList.Item1;
                        string[] actROMA = actString.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);
                        actString = actROMA[0];
                        image     = String.Format("{0}\\Overlays\\{1}\\{2}.png", currentDirectory, seedList.Item1, seed);

                        // IMAGE
                        picBox[nIndex].Load(image);
                        picBox[nIndex].SizeMode = PictureBoxSizeMode.StretchImage;

                        // TEXT
                        noteLabel.Text = seedList.Item3;
                        bSeedFound     = true;

                        nIndex++;
                    }
                }

                string    strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
                IniParser parser     = new IniParser(strINIPath);
                if (actString == "?")
                {
                    actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
                }

                if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
                {
                    parser.AddSetting("INITPART", "LASTPART", "1");
                    if (!bSeedFound)
                    {
                        noteLabel.Text = "마을입니다.";
                    }
                }
                else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    if (!bSeedFound)
                    {
                        noteLabel.Text = "마을입니다.";
                    }
                }
                else if (actString == "O")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "액트 클리어를 축하드립니다.";
                }
                else if (actString == "Z")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "지도의 대가 자나를 만나보세요.";
                }
                else if (actString == "H")
                {
                    parser.AddSetting("INITPART", "LASTPART", "2");
                    noteLabel.Text = "멋진 은신처군요~!";
                }
                else
                {
                    parser.AddSetting("INITPART", "LASTPART", "3");
                    noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
                }
                parser.AddSetting("INITPART", "zoneName", zoneName);
                parser.AddSetting("INITPART", "actString", actString);
                parser.SaveSettings();

                btnLangText  = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
                btnLang.Text = btnLangText;
            }
        }
Ejemplo n.º 3
0
        public void DrawPartTwoImage()
        {
            bSeedFound = false;

            string image = null;

            PictureBox[] picBox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4 };
            image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");

            var seedList = FindZoneName(zoneName);
            int nIndex   = 0;

            if (seedList.Item2.Length > 0)
            {
                foreach (var seed in seedList.Item2) // region.Region (ACT), zone.ZoneSeed (Image), zone.Note (Explain Text)
                {
                    actString = seedList.Item1;
                    string[] actROMA = actString.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);
                    actString = actROMA[0];
                    image     = String.Format("{0}\\Overlays\\{1}\\{2}.png", currentDirectory, seedList.Item1, seed);

                    // IMAGE
                    picBox[nIndex].Load(image);
                    picBox[nIndex].SizeMode = PictureBoxSizeMode.StretchImage;

                    // TEXT
                    noteLabel.Text = seedList.Item3;
                    bSeedFound     = true;

                    nIndex++;
                }
            }

            string    strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            if (actString == "?")
            {
                actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
            }

            if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
            {
                parser.AddSetting("INITPART", "LASTPART", "1");
                if (!bSeedFound)
                {
                    noteLabel.Text = "마을입니다.";
                }
            }
            else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
            {
                parser.AddSetting("INITPART", "LASTPART", "2");
                if (!bSeedFound)
                {
                    noteLabel.Text = "마을입니다.";
                }
            }
            else if (actString == "O")
            {
                parser.AddSetting("INITPART", "LASTPART", "2");
                noteLabel.Text = "액트 클리어를 축하드립니다.";
            }
            else if (actString == "Z")
            {
                parser.AddSetting("INITPART", "LASTPART", "2");
                noteLabel.Text = "지도의 대가 자나를 만나보세요.";
            }
            else if (actString == "H")
            {
                parser.AddSetting("INITPART", "LASTPART", "2");
                noteLabel.Text = "멋진 은신처군요~!";
            }
            else
            {
                parser.AddSetting("INITPART", "LASTPART", "3");
                noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
            }
            parser.AddSetting("INITPART", "zoneName", zoneName);
            parser.AddSetting("INITPART", "actString", actString);
            parser.SaveSettings();

            btnLangText  = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
            btnLang.Text = btnLangText;
        }
Ejemplo n.º 4
0
        private void Init_Controls()
        {
            // btnClose
            btnClose.FlatStyle = FlatStyle.Flat;
            btnClose.BackColor = Color.Transparent;
            btnClose.FlatAppearance.MouseDownBackColor = Color.Transparent;
            btnClose.FlatAppearance.MouseOverBackColor = Color.Transparent;
            btnClose.FlatAppearance.BorderColor        = Color.FromArgb(0, 255, 255, 255);
            btnClose.FlatAppearance.BorderSize         = 0;
            btnClose.TabStop = false;

            // btnClose2nd
            btnClose2nd.FlatStyle = FlatStyle.Flat;
            btnClose2nd.BackColor = Color.Transparent;
            btnClose2nd.FlatAppearance.MouseDownBackColor = Color.Transparent;
            btnClose2nd.FlatAppearance.MouseOverBackColor = Color.Transparent;
            btnClose2nd.FlatAppearance.BorderColor        = Color.FromArgb(0, 255, 255, 255);
            btnClose2nd.FlatAppearance.BorderSize         = 0;
            btnClose2nd.TabStop = false;

            string    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            string strLeft   = "";
            string strTop    = "";
            string strRight  = "";
            string strBottom = "";

            try
            {
                strLeft   = parser.GetSetting("LOCATIONGRID", "LEFT");
                strTop    = parser.GetSetting("LOCATIONGRID", "TOP");
                strRight  = parser.GetSetting("LOCATIONGRID", "RIGHT");
                strBottom = parser.GetSetting("LOCATIONGRID", "BOTTOM");

                this.Left   = Convert.ToInt32(strLeft);
                this.Top    = Convert.ToInt32(strTop);
                this.Width  = Convert.ToInt32(strRight);
                this.Height = Convert.ToInt32(strBottom);
            }
            catch
            {
                /*
                 * // 4x4로 맞춰본 결과. 특별히 손안대도 맞는 1920*1080 해상도의 기본 위치
                 *  [LOCATIONGRID]
                 *  LEFT=19
                 * TOP=166
                 * BOTTOM=628
                 * RIGHT=628
                 */
                this.Left   = 19;
                this.Top    = 166;
                this.Width  = 628;
                this.Height = 628;
                parser.AddSetting("LOCATIONGRID", "LEFT", this.Left.ToString());
                parser.AddSetting("LOCATIONGRID", "TOP", this.Top.ToString());
                parser.AddSetting("LOCATIONGRID", "RIGHT", this.Width.ToString());
                parser.AddSetting("LOCATIONGRID", "BOTTOM", this.Height.ToString());
                parser.SaveSettings();
            }
        }