Esempio n. 1
0
        private void updateCurrentDisplay(int dispMode)
        {
            LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());
            LogitechLCD.LogiLcdColorSetTitle("Final Fantasy XIV");
            if (dispMode == -1) /*Initial Screen*/
            {
                updateBackground(1);
                /*Monochrome*/
                maxScrollIndex = 0;
                LogitechLCD.LogiLcdMonoSetText(0, "");
                LogitechLCD.LogiLcdMonoSetText(1, "     Final Fantasy XIV    ");
                LogitechLCD.LogiLcdMonoSetText(2, "          Online          ");

                /*Color*/
                LogitechLCD.LogiLcdColorSetText(0, "");
                LogitechLCD.LogiLcdColorSetText(1, "");
                LogitechLCD.LogiLcdColorSetText(2, "");
                LogitechLCD.LogiLcdColorSetText(3, "");
                LogitechLCD.LogiLcdColorSetText(4, "");
                LogitechLCD.LogiLcdColorSetText(5, "");
                LogitechLCD.LogiLcdColorSetText(6, "");
                LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());

                if (btnConnect.Enabled)
                {
                    LogitechLCD.LogiLcdMonoSetText(3, "   Awaiting Connection... ");
                    LogitechLCD.LogiLcdColorSetText(7, "    Awaiting Connection...  ");
                    LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundBlank);
                }
                else
                {
                    LogitechLCD.LogiLcdMonoSetText(3, "");
                    LogitechLCD.LogiLcdColorSetText(7, "");
                    LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundFixed);
                }
            }
            else if (dispMode == 0) /*First Tab*/
            {
                updateBackground(0);
                /*Monochrome*/
                maxScrollIndex = 0;
                LogitechLCD.LogiLcdMonoSetText(0, playerName.PadRight(21) + " " + Enum.GetName(typeof(Sharlayan.Core.Enums.Actor.Job), job) + level);
                LogitechLCD.LogiLcdMonoSetText(1, "HP: " + currentHP + "/" + maxHP);
                if (job == 16 || job == 17 || job == 18)
                {
                    LogitechLCD.LogiLcdMonoSetText(2, "GP: " + currentGP + "/" + maxGP);
                }
                else if (job >= 8 && job <= 15)
                {
                    LogitechLCD.LogiLcdMonoSetText(2, "CP: " + currentCP + "/" + maxCP);
                }
                else
                {
                    string strMP = "MP: " + currentMP + "/" + maxMP, strTP = "TP: " + currentTP;
                    strMP = strMP.PadRight(18, ' ');
                    LogitechLCD.LogiLcdMonoSetText(2, strMP + " " + strTP);
                }
                LogitechLCD.LogiLcdMonoSetText(3, "");
                LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundFixed);

                /*Color*/
                maxScrollIndexColor = 0;
                LogitechLCD.LogiLcdColorSetText(0, playerName.PadRight(23) + " " + Enum.GetName(typeof(Sharlayan.Core.Enums.Actor.Job), job) + level);
                LogitechLCD.LogiLcdColorSetText(1, "HP: " + currentHP + "/" + maxHP);
                LogitechLCD.LogiLcdColorSetText(2, "");
                if (job == 16 || job == 17 || job == 18)
                {
                    LogitechLCD.LogiLcdColorSetText(3, "GP: " + currentGP + "/" + maxGP);
                    ColorTab1.drawTab1(2, currentGP, maxGP, currentHP, maxHP, currentTP, maxTP);
                }
                else if (job >= 8 && job <= 15)
                {
                    LogitechLCD.LogiLcdColorSetText(3, "CP: " + currentCP + "/" + maxCP);
                    ColorTab1.drawTab1(1, currentCP, maxCP, currentHP, maxHP, currentTP, maxTP);
                }
                else
                {
                    LogitechLCD.LogiLcdColorSetText(3, "MP: " + currentMP + "/" + maxMP);
                    ColorTab1.drawTab1(0, currentMP, maxMP, currentHP, maxHP, currentTP, maxTP);
                }
                LogitechLCD.LogiLcdColorSetText(4, "");
                LogitechLCD.LogiLcdColorSetText(5, "TP: " + currentTP + "/" + maxTP);
                LogitechLCD.LogiLcdColorSetText(6, "");
                LogitechLCD.LogiLcdColorSetText(7, "");
            }
            else if (dispMode == 1) /*Second Tab*/
            {
                updateBackground(0);
                String[] rows;
                switch (locale)
                {
                case 0:
                    rows = new String[] {
                        jobLocalization[0][locale] + levelGLD.ToString().PadLeft(2, '0') + "  " + jobLocalization[1][locale] + levelPGL.ToString().PadLeft(2, '0') + "  " + jobLocalization[2][locale] + levelMRD.ToString().PadLeft(2, '0') + "  " + jobLocalization[3][locale] + levelLNC.ToString().PadLeft(2, '0'),
                        jobLocalization[4][locale] + levelARC.ToString().PadLeft(2, '0') + "  " + jobLocalization[5][locale] + levelROG.ToString().PadLeft(2, '0') + "  " + jobLocalization[6][locale] + levelCNJ.ToString().PadLeft(2, '0') + "  " + jobLocalization[7][locale] + levelTHM.ToString().PadLeft(2, '0'),
                        jobLocalization[8][locale] + levelACN.ToString().PadLeft(2, '0') + "  " + jobLocalization[9][locale] + levelCPT.ToString().PadLeft(2, '0') + "  " + jobLocalization[10][locale] + levelBSM.ToString().PadLeft(2, '0') + "  " + jobLocalization[0][locale] + levelARM.ToString().PadLeft(2, '0'),
                        jobLocalization[12][locale] + levelGSM.ToString().PadLeft(2, '0') + "  " + jobLocalization[13][locale] + levelLTW.ToString().PadLeft(2, '0') + "  " + jobLocalization[14][locale] + levelWVR.ToString().PadLeft(2, '0') + "  " + jobLocalization[15][locale] + levelALC.ToString().PadLeft(2, '0'),
                        jobLocalization[16][locale] + levelCUL.ToString().PadLeft(2, '0') + "  " + jobLocalization[17][locale] + levelMIN.ToString().PadLeft(2, '0') + "  " + jobLocalization[18][locale] + levelBTN.ToString().PadLeft(2, '0') + "  " + jobLocalization[19][locale] + levelFSH.ToString().PadLeft(2, '0'),
                        jobLocalization[20][locale] + levelDRK.ToString().PadLeft(2, '0') + "  " + jobLocalization[21][locale] + levelAST.ToString().PadLeft(2, '0') + "  " + jobLocalization[22][locale] + levelMCH.ToString().PadLeft(2, '0') + "  " + jobLocalization[23][locale] + levelSAM.ToString().PadLeft(2, '0'),
                        jobLocalization[24][locale] + levelRDM.ToString().PadLeft(2, '0')
                    };
                    break;

                case 1:
                    rows = new String[] {
                        jobLocalization[0][locale] + levelGLD.ToString().PadLeft(2, '0') + " " + jobLocalization[1][locale] + levelPGL.ToString().PadLeft(2, '0') + " " + jobLocalization[2][locale] + levelMRD.ToString().PadLeft(2, '0') + " " + jobLocalization[3][locale] + levelLNC.ToString().PadLeft(2, '0') + " " + jobLocalization[4][locale] + levelARC.ToString().PadLeft(2, '0'),
                        jobLocalization[5][locale] + levelROG.ToString().PadLeft(2, '0') + " " + jobLocalization[6][locale] + levelCNJ.ToString().PadLeft(2, '0') + " " + jobLocalization[7][locale] + levelTHM.ToString().PadLeft(2, '0') + " " + jobLocalization[8][locale] + levelACN.ToString().PadLeft(2, '0') + " " + jobLocalization[20][locale] + levelDRK.ToString().PadLeft(2, '0'),
                        jobLocalization[21][locale] + levelAST.ToString().PadLeft(2, '0') + " " + jobLocalization[22][locale] + levelMCH.ToString().PadLeft(2, '0') + " " + jobLocalization[23][locale] + levelSAM.ToString().PadLeft(2, '0') + " " + jobLocalization[24][locale] + levelRDM.ToString().PadLeft(2, '0'),
                        jobLocalization[9][locale] + levelCPT.ToString().PadLeft(2, '0') + jobLocalization[10][locale] + levelBSM.ToString().PadLeft(2, '0') + jobLocalization[11][locale] + levelARM.ToString().PadLeft(2, '0'),
                        jobLocalization[12][locale] + levelGSM.ToString().PadLeft(2, '0') + jobLocalization[13][locale] + levelLTW.ToString().PadLeft(2, '0') + jobLocalization[14][locale] + levelWVR.ToString().PadLeft(2, '0'),
                        jobLocalization[15][locale] + levelALC.ToString().PadLeft(2, '0') + jobLocalization[16][locale] + levelCUL.ToString().PadLeft(2, '0') + jobLocalization[17][locale] + levelMIN.ToString().PadLeft(2, '0'),
                        jobLocalization[18][locale] + levelBTN.ToString().PadLeft(2, '0') + jobLocalization[19][locale] + levelFSH.ToString().PadLeft(2, '0')
                    };
                    break;

                default:
                    rows = new String[] {};
                    break;
                }


                /*Monochrome*/
                maxScrollIndex = 4;
                LogitechLCD.LogiLcdMonoSetText(0, rows[0 + curentScrollIndex]);
                LogitechLCD.LogiLcdMonoSetText(1, rows[1 + curentScrollIndex]);
                LogitechLCD.LogiLcdMonoSetText(2, rows[2 + curentScrollIndex]);
                LogitechLCD.LogiLcdMonoSetText(3, "");
                LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundScrollable);

                /*Color*/
                maxScrollIndexColor = 0;
                LogitechLCD.LogiLcdColorSetText(0, " " + rows[0]);
                LogitechLCD.LogiLcdColorSetText(1, " " + rows[1]);
                LogitechLCD.LogiLcdColorSetText(2, " " + rows[2]);
                LogitechLCD.LogiLcdColorSetText(3, " " + rows[3]);
                LogitechLCD.LogiLcdColorSetText(4, " " + rows[4]);
                LogitechLCD.LogiLcdColorSetText(5, " " + rows[5]);
                LogitechLCD.LogiLcdColorSetText(6, " " + rows[6]);
                LogitechLCD.LogiLcdColorSetText(7, "");
                LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());
            }
            else if (dispMode == 2) /*Third Tab*/
            {
                updateBackground(0);
                /*Monochrome*/
                maxScrollIndex = 0;
                LogitechLCD.LogiLcdMonoSetText(0, "Tab 3");
                LogitechLCD.LogiLcdMonoSetText(1, "");
                LogitechLCD.LogiLcdMonoSetText(2, "");
                LogitechLCD.LogiLcdMonoSetText(3, "");
                LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundFixed);

                /*Color*/
                maxScrollIndexColor = 0;
                LogitechLCD.LogiLcdColorSetText(0, "Tab 3");
                LogitechLCD.LogiLcdColorSetText(1, "");
                LogitechLCD.LogiLcdColorSetText(2, "");
                LogitechLCD.LogiLcdColorSetText(3, "");
                LogitechLCD.LogiLcdColorSetText(4, "");
                LogitechLCD.LogiLcdColorSetText(5, "");
                LogitechLCD.LogiLcdColorSetText(6, "");
                LogitechLCD.LogiLcdColorSetText(7, "");
                LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());
            }
            else if (dispMode == 3) /*Fourth Tab*/
            {
                updateBackground(0);
                /*Monochrome*/
                maxScrollIndex = 0;
                LogitechLCD.LogiLcdMonoSetText(0, "Tab 4");
                LogitechLCD.LogiLcdMonoSetText(1, "");
                LogitechLCD.LogiLcdMonoSetText(2, "");
                LogitechLCD.LogiLcdMonoSetText(3, "");
                LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundFixed);

                /*Color*/
                maxScrollIndexColor = 0;
                LogitechLCD.LogiLcdColorSetText(0, "Tab 4");
                LogitechLCD.LogiLcdColorSetText(1, "");
                LogitechLCD.LogiLcdColorSetText(2, "");
                LogitechLCD.LogiLcdColorSetText(3, "");
                LogitechLCD.LogiLcdColorSetText(4, "");
                LogitechLCD.LogiLcdColorSetText(5, "");
                LogitechLCD.LogiLcdColorSetText(6, "");
                LogitechLCD.LogiLcdColorSetText(7, "");
                LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());
            }
        }
Esempio n. 2
0
        private void timerUpdateLCD_Tick(object sender, EventArgs e)
        {
            if (LogitechLCD.LogiLcdIsConnected(LogitechLCD.LcdType.Mono) || LogitechLCD.LogiLcdIsConnected(LogitechLCD.LcdType.Color))
            {
                if ((level != plevel) && (job == pjob))
                {
                    //Do level up animation
                    if (isDoingAnimation == false)
                    {
                        isDoingAnimation = true;
                        plevel           = level;

                        /*Monochrome*/
                        LogitechLCD.LogiLcdMonoSetText(0, "                          ");
                        LogitechLCD.LogiLcdMonoSetText(1, "         Level Up!        ");
                        LogitechLCD.LogiLcdMonoSetText(2, "          " + Enum.GetName(typeof(Sharlayan.Core.Enums.Actor.Job), job) + " " + level + "          ");
                        LogitechLCD.LogiLcdMonoSetText(3, "                          ");
                        LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundBlank);

                        /*Color*/
                        LogitechLCD.LogiLcdColorSetText(0, "");
                        LogitechLCD.LogiLcdColorSetText(1, "");
                        LogitechLCD.LogiLcdColorSetText(2, "         Level Up!          ");
                        LogitechLCD.LogiLcdColorSetText(3, "");
                        LogitechLCD.LogiLcdColorSetText(4, "");
                        LogitechLCD.LogiLcdColorSetText(5, "");
                        LogitechLCD.LogiLcdColorSetText(6, "");
                        LogitechLCD.LogiLcdColorSetText(7, "");
                        LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());

                        timerAnimations.Start();
                    }
                }
                if (job != pjob)
                {
                    //do job change animation
                    if (isDoingAnimation == false)
                    {
                        isDoingAnimation = true;
                        pjob             = job;
                        plevel           = level;

                        /*Monochrome*/
                        LogitechLCD.LogiLcdMonoSetText(0, "                          ");
                        LogitechLCD.LogiLcdMonoSetText(1, "        Job Change        ");
                        LogitechLCD.LogiLcdMonoSetText(2, "           " + Enum.GetName(typeof(Sharlayan.Core.Enums.Actor.Job), job) + "            ");
                        LogitechLCD.LogiLcdMonoSetText(3, "                          ");
                        LogitechLCD.LogiLcdMonoSetBackground(LogitechLCD.lcdBackroundBlank);

                        /*Color*/
                        LogitechLCD.LogiLcdColorSetText(0, "");
                        LogitechLCD.LogiLcdColorSetText(1, "");
                        LogitechLCD.LogiLcdColorSetText(2, "         Job Change         ");
                        LogitechLCD.LogiLcdColorSetText(3, "");
                        LogitechLCD.LogiLcdColorSetText(4, "            " + Enum.GetName(typeof(Sharlayan.Core.Enums.Actor.Job), job) + "             ");
                        LogitechLCD.LogiLcdColorSetText(5, "");
                        LogitechLCD.LogiLcdColorSetText(6, "");
                        LogitechLCD.LogiLcdColorSetText(7, "");
                        LogitechLCD.LogiLcdColorSetBackground(mainMap.getMap());

                        timerAnimations.Start();
                    }
                }
                if (!isDoingAnimation)
                {
                    updateCurrentDisplay(currentDisplayMode);
                }


                LogitechLCD.LogiLcdUpdate();
            }

            if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.MonoButton0) || LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.ColorLeft))
            {
                if (currentDisplayMode > 0)
                {
                    currentDisplayMode--;
                }
                else
                {
                    currentDisplayMode = maxDisplayMode;
                }
                curentScrollIndex      = 0;
                curentScrollIndexColor = 0;
            }
            else if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.MonoButton1) || LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.ColorRight))
            {
                if (currentDisplayMode < maxDisplayMode)
                {
                    currentDisplayMode++;
                }
                else
                {
                    currentDisplayMode = 0;
                }
                curentScrollIndex      = 0;
                curentScrollIndexColor = 0;
            }
            else if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.MonoButton2))
            {
                if (curentScrollIndex > 0)
                {
                    curentScrollIndex--;
                }
            }
            else if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.MonoButton3))
            {
                if (curentScrollIndex < maxScrollIndex)
                {
                    curentScrollIndex++;
                }
            }
            else if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.ColorUp))
            {
                if (curentScrollIndexColor > 0)
                {
                    curentScrollIndexColor--;
                }
            }
            else if (LogitechLCD.LogiLcdIsButtonPressed(LogitechLCD.Buttons.ColorDown))
            {
                if (curentScrollIndexColor < maxScrollIndexColor)
                {
                    curentScrollIndexColor++;
                }
            }
        }