Example #1
0
        private void SomeOneEnteredForm_Load(object sender, EventArgs e)
        {
            Visible = false;

            try
            {
                uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);

                Width = 105;
                labelNickName.Text = strNickName;
                if (!String.IsNullOrEmpty(strLableText))
                {
                    labelNickName.Text = strLableText;
                }
                StartPosition = FormStartPosition.CenterScreen;
                TopMost       = true;
                Top           = Top - 100;
                if (strLableText == "Copied.")
                {
                    labelNOTICE.Text    = strNickName;
                    labelNOTICE.Visible = true;
                }
                Visible = true;

                timer1.Start();
            }
            catch (Exception ex)
            {
                DeadlyLog4Net._log.Error($"catch {MethodBase.GetCurrentMethod().Name}", ex);
            }
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                if (!LauncherForm.g_pinLOCK)
                {
                    // Reverse Style
                    uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                    InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet & ~(WS_EX_LAYERED | WS_EX_TRANSPARENT));
                    Width  = 30;
                    Height = 70;
                }
                else
                {
                    // Set Style : Can't Click (Layered Transparent)
                    uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                    InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);
                    Width  = 30;
                    Height = 70;
                }

                int nPercent = Convert.ToInt32(lnFlaskTimer / lnMaxValue * 100);
                xuiFlatProgressBar1.Text  = lnFlaskTimer.ToString("N1");
                xuiFlatProgressBar1.Value = nPercent; // Convert.ToInt32(lnFlaskTimer);
                xuiFlatProgressBar1.Invalidate();

                // Change opacity
                //pictureFlask.BackColor = Color.Transparent;
                //pictureFlask.Image = AdjustAlpha((Bitmap)Properties.Resources._60px_Atziri_s_Promise_inventory_icon, nPercent);

                panelAlpha.Height = 60 - nPercent;

                //DeadlyLog4Net._log.Info(nPercent.ToString());
                lnFlaskTimer = lnFlaskTimer - 0.1; // 100ms
                if (lnFlaskTimer <= 0.0)
                {
                    #region [[[[[ Remove temporary - Assertion ]]]]]
                    //if (strUseAlertSound == "Y")
                    //    PlayMediaFile(Application.StartupPath + "\\flaskalert.wav");
                    #endregion

                    timer1.Stop();
                    xuiFlatProgressBar1.Dispose();
                    this.BeginInvoke(new MethodInvoker(Close));// Close();
                }
            }
            catch (Exception ex)
            {
                DeadlyLog4Net._log.Error($"catch {MethodBase.GetCurrentMethod().Name}", ex);;
            }
        }
Example #3
0
        private void SomeOneEnteredForm_Load(object sender, EventArgs e)
        {
            Visible = false;

            uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);

            InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);

            Width = 105;
            labelNickName.Text = strNickName;
            if (!String.IsNullOrEmpty(strLableText))
            {
                label1.Text = strLableText;
            }
            StartPosition = FormStartPosition.CenterScreen;
            TopMost       = true;
            Top           = Top - 235;

            Visible = true;

            timer1.Start();
        }
Example #4
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
            if (!LauncherForm.g_pinLOCK)
            {
                // Reverse Style
                uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet & ~(WS_EX_LAYERED | WS_EX_TRANSPARENT));
                Width  = 40;
                Height = 40;
            }
            else
            {
                // Set Style : Can't Click (Layered Transparent)
                uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);
                Width  = 40;
                Height = 40;
            }

            int nPercent = Convert.ToInt32(lnFlaskTimer / lnMaxValue * 100);

            circularProgressBar1.Text  = lnFlaskTimer.ToString("N1");
            circularProgressBar1.Value = nPercent; // Convert.ToInt32(lnFlaskTimer);
            circularProgressBar1.Invalidate();

            lnFlaskTimer = lnFlaskTimer - 0.1; // 100ms
            if (lnFlaskTimer <= 0.0)
            {
                timer1.Stop();

                if (circularProgressBar1 != null)
                {
                    circularProgressBar1.Dispose();
                }
                this.BeginInvoke(new MethodInvoker(Close));// Close();
            }
        }
Example #5
0
        private void SkillTimerForm_Load(object sender, EventArgs e)
        {
            Visible            = false;
            this.StartPosition = FormStartPosition.Manual;

            uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
            uint nRet       = InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);

            #region    Get Information from ConfigPath.ini ⨌⨌
            string    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            try
            {
                /*
                 * [SKILL]
                 * SKILLTIME2=9.5
                 * SKILLTIME5=9.5
                 * TOGGLESKILL3ON=FALSE
                 * TOGGLESKILL1ON=FALSE
                 * SKILLTIME1=9.5
                 * SKILLTIME4=9.5
                 * TOGGLESKILL5ON=FALSE
                 * SKILLTIME3=9.5
                 * TOGGLESKILL2ON=FALSE
                 * TOGGLESKILL4ON=FALSE
                 * SKILL1LEFT=314
                 * SKILL1TOP=1019
                 * SKILL1COLOR=255,0,255
                 * SKILL2LEFT=364
                 * SKILL2TOP=1019
                 * SKILL2COLOR=255,0,255
                 * SKILL3LEFT=404
                 * SKILL3TOP=1019
                 * SKILL3COLOR=255,0,255
                 * SKILL4LEFT=454
                 * SKILL4TOP=1019
                 * SKILL4COLOR=255,0,255
                 * SKILL5LEFT=494
                 * SKILL5TOP=1019
                 * SKILL5COLOR=255,0,255
                 */
                string sLeft  = string.Empty;
                string sTop   = string.Empty;
                string sColor = string.Empty;
                if (nSkillNumber == 1)
                {
                    sLeft  = parser.GetSetting("SKILL", "SKILL1LEFT");
                    sTop   = parser.GetSetting("SKILL", "SKILL1TOP");
                    sColor = parser.GetSetting("SKILL", "SKILL1COLOR");
                }
                else if (nSkillNumber == 2)
                {
                    sLeft  = parser.GetSetting("SKILL", "SKILL2LEFT");
                    sTop   = parser.GetSetting("SKILL", "SKILL2TOP");
                    sColor = parser.GetSetting("SKILL", "SKILL2COLOR");
                }
                else if (nSkillNumber == 3)
                {
                    sLeft  = parser.GetSetting("SKILL", "SKILL3LEFT");
                    sTop   = parser.GetSetting("SKILL", "SKILL3TOP");
                    sColor = parser.GetSetting("SKILL", "SKILL3COLOR");
                }
                else if (nSkillNumber == 4)
                {
                    sLeft  = parser.GetSetting("SKILL", "SKILL4LEFT");
                    sTop   = parser.GetSetting("SKILL", "SKILL4TOP");
                    sColor = parser.GetSetting("SKILL", "SKILL4COLOR");
                }
                else if (nSkillNumber == 5)
                {
                    sLeft  = parser.GetSetting("SKILL", "SKILL5LEFT");
                    sTop   = parser.GetSetting("SKILL", "SKILL5TOP");
                    sColor = parser.GetSetting("SKILL", "SKILL5COLOR");
                }

                Left = Convert.ToInt32(sLeft);
                Top  = Convert.ToInt32(sTop);

                circularProgressBar1.ProgressColor = StringRGBToColor(sColor);
                //circularProgressBar1.ForeColor = Color.Red;
            }
            catch
            {
                MSGForm frmMSG = new MSGForm();
                frmMSG.lbMsg.Text = "Can't Read SKILL configuration.\r\n\r\ncheck your Configpath.ini case by game resolution.";
                frmMSG.ShowDialog();
            }
            #endregion

            lnMaxValue = lnSkillTimer;
            //circularProgressBar1.MaxValue = Convert.ToInt32(lnSkillTimer);
            circularProgressBar1.Maximum = 100; // Convert.ToInt32(lnFlaskTimer);
            circularProgressBar1.Value   = 100;

            BringToFront();

            timer1.Start();
            Visible = true;
        }
Example #6
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                if (!LauncherForm.g_pinLOCK)
                {
                    // Reverse Style
                    uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                    InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet & ~(WS_EX_LAYERED | WS_EX_TRANSPARENT));
                    Width  = 40;
                    Height = 40;
                }
                else
                {
                    // Set Style : Can't Click (Layered Transparent)
                    uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);
                    InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);
                    Width  = 40;
                    Height = 40;
                }

                /*using (Graphics gr = circularProgressBar1.CreateGraphics())
                 * {
                 *  Font f = new Font(FontFamily.GenericSerif, 10);
                 *  SizeF len = gr.MeasureString(lnSkillTimer.ToString("N1"), f);
                 *  Point location = new Point(Convert.ToInt32((circularProgressBar1.Width / 2) - len.Width / 2),
                 *                             Convert.ToInt32((circularProgressBar1.Height / 2) - len.Height / 2));
                 *  gr.DrawString(lnSkillTimer.ToString("N1"), f, Brushes.Red, location);
                 * }*/

                //
                int nPercent = Convert.ToInt32(lnSkillTimer / lnMaxValue * 100);
                circularProgressBar1.Text  = lnSkillTimer.ToString("N1");
                circularProgressBar1.Value = nPercent; // Convert.ToInt32(lnFlaskTimer);
                circularProgressBar1.Invalidate();

                lnSkillTimer = lnSkillTimer - 0.1; // 100ms
                if (lnSkillTimer <= 0.0)
                {
                    /*switch (nSkillNumber)
                     * {
                     *  case 1:
                     *      ControlForm.frmSkillK1 = null;
                     *      break;
                     *  case 2:
                     *      ControlForm.frmSkillK2 = null;
                     *      break;
                     *  case 3:
                     *      ControlForm.frmSkillK3 = null;
                     *      break;
                     *  case 4:
                     *      ControlForm.frmSkillK4 = null;
                     *      break;
                     *  case 5:
                     *      ControlForm.frmSkillK5 = null;
                     *      break;
                     *  default:
                     *      break;
                     * }*/
                    circularProgressBar1.Dispose();
                    circularProgressBar1 = null;
                    //this.Dispose();

                    timer1.Stop();
                    this.BeginInvoke(new MethodInvoker(Close)); // Close();
                }
            }
            catch (Exception ex)
            {
                DeadlyLog4Net._log.Error($"catch {MethodBase.GetCurrentMethod().Name}", ex);;
            }
        }
Example #7
0
        private void FlaskTimerCircleForm_Load(object sender, EventArgs e)
        {
            Visible            = false;
            this.StartPosition = FormStartPosition.Manual;

            uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);

            InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);
            // SetLayeredWindowAttributes(m_hWnd, 0, nAlphaBlend, LWA_ALPHA);

            /* Reverse
             * uint exstyleGet = GetWindowLong(this.Handle, m_nExStyleNum);
             * SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet & ~(WS_EX_LAYERED | WS_EX_TRANSPARENT));
             * // SetLayeredWindowAttributes(m_hWnd, 0, nAlphaBlend, LWA_ALPHA);
             */

            #region    Get Information from ConfigPath.ini ⨌⨌
            string    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            try
            {
                string sLeft  = string.Empty;
                string sTop   = string.Empty;
                string sColor = string.Empty;
                if (nFlaskNumber == 1)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK1LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK1TOP");
                    sColor = parser.GetSetting("MISC", "FLASK1COLOR");
                }
                else if (nFlaskNumber == 2)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK2LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK2TOP");
                    sColor = parser.GetSetting("MISC", "FLASK2COLOR");
                }
                else if (nFlaskNumber == 3)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK3LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK3TOP");
                    sColor = parser.GetSetting("MISC", "FLASK3COLOR");
                }
                else if (nFlaskNumber == 4)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK4LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK4TOP");
                    sColor = parser.GetSetting("MISC", "FLASK4COLOR");
                }
                else if (nFlaskNumber == 5)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK5LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK5TOP");
                    sColor = parser.GetSetting("MISC", "FLASK5COLOR");
                }

                Left = Convert.ToInt32(sLeft);
                Top  = Convert.ToInt32(sTop);

                circularProgressBar1.ProgressColor = StringRGBToColor(sColor);
            }
            catch (Exception ex)
            {
                MSGForm frmMSG = new MSGForm();
                frmMSG.lbMsg.Text = "Can't Read FLASK configuration.\r\n\r\ncheck your Configpath.ini case by game resolution.";
                frmMSG.ShowDialog();

                DeadlyLog4Net._log.Error($"catch {MethodBase.GetCurrentMethod().Name}", ex);
            }
            #endregion

            circularProgressBar1.Maximum = 100; // Convert.ToInt32(lnFlaskTimer);
            circularProgressBar1.Value   = 100;
            lnMaxValue = lnFlaskTimer;

            BringToFront();

            timer1.Start();
            Visible = true;
        }
Example #8
0
        private void FlaskICONTimer_Load(object sender, EventArgs e)
        {
            Visible            = false;
            this.StartPosition = FormStartPosition.Manual;

            uint exstyleGet = InteropCommon.GetWindowLong(this.Handle, m_nExStyleNum);

            InteropCommon.SetWindowLong(this.Handle, m_nExStyleNum, exstyleGet | WS_EX_LAYERED | WS_EX_TRANSPARENT);

            #region    Get Information from ConfigPath.ini ⨌⨌
            string    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");
            IniParser parser     = new IniParser(strINIPath);

            string sColor = string.Empty;
            try
            {
                string sLeft = string.Empty;
                string sTop  = string.Empty;
                if (nFlaskNumber == 1)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK1LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK1TOP");
                    sColor = parser.GetSetting("MISC", "FLASK1COLOR");
                    pictureFlask.BackgroundImage = Image.FromFile(Application.StartupPath + "\\DeadlyInform\\Flask\\"
                                                                  + DeadlyTranslation.FlaskImgPath[DeadlyFlaskImage.FlaskImageTimerGetValuebyKey(0)]);
                }
                else if (nFlaskNumber == 2)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK2LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK2TOP");
                    sColor = parser.GetSetting("MISC", "FLASK2COLOR");
                    pictureFlask.BackgroundImage = Image.FromFile(Application.StartupPath + "\\DeadlyInform\\Flask\\"
                                                                  + DeadlyTranslation.FlaskImgPath[DeadlyFlaskImage.FlaskImageTimerGetValuebyKey(1)]);
                }
                else if (nFlaskNumber == 3)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK3LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK3TOP");
                    sColor = parser.GetSetting("MISC", "FLASK3COLOR");
                    pictureFlask.BackgroundImage = Image.FromFile(Application.StartupPath + "\\DeadlyInform\\Flask\\"
                                                                  + DeadlyTranslation.FlaskImgPath[DeadlyFlaskImage.FlaskImageTimerGetValuebyKey(2)]);
                }
                else if (nFlaskNumber == 4)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK4LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK4TOP");
                    sColor = parser.GetSetting("MISC", "FLASK4COLOR");
                    pictureFlask.BackgroundImage = Image.FromFile(Application.StartupPath + "\\DeadlyInform\\Flask\\"
                                                                  + DeadlyTranslation.FlaskImgPath[DeadlyFlaskImage.FlaskImageTimerGetValuebyKey(3)]);
                }
                else if (nFlaskNumber == 5)
                {
                    sLeft  = parser.GetSetting("MISC", "FLASK5LEFT");
                    sTop   = parser.GetSetting("MISC", "FLASK5TOP");
                    sColor = parser.GetSetting("MISC", "FLASK5COLOR");
                    pictureFlask.BackgroundImage = Image.FromFile(Application.StartupPath + "\\DeadlyInform\\Flask\\"
                                                                  + DeadlyTranslation.FlaskImgPath[DeadlyFlaskImage.FlaskImageTimerGetValuebyKey(4)]);
                }

                Left = Convert.ToInt32(sLeft);
                Top  = Convert.ToInt32(sTop);
            }
            catch
            {
                MSGForm frmMSG = new MSGForm();
                frmMSG.lbMsg.Text = "FLASK 환경 파일을 읽을 수 없습니다.\r\n\r\nini 파일이 손상되었거나 삭제되었습니다.";
                frmMSG.ShowDialog();
            }
            #endregion

            xuiFlatProgressBar1.MaxValue      = 100; // Convert.ToInt32(lnFlaskTimer);
            xuiFlatProgressBar1.Value         = 100;
            xuiFlatProgressBar1.CompleteColor = StringRGBToColor(sColor);
            lnMaxValue = lnFlaskTimer;

            BringToFront();

            timer1.Start();
            Visible = true;
        }