Esempio n. 1
0
    void OnGUI()
    {
        Customize.cust.windowx[windowID] = windowRect.x;
        Customize.cust.windowy[windowID] = windowRect.y;
        GUI.skin = com.Skin[GameControl.control.GUIID];

        if (GameControl.control.LCDPage > 50 && GameControl.control.LCDPage < 100)
        {
            LogitechGSDK.LogiLcdColorSetTitle("Emails", 0, 255, 0);
            if (ContractSelect > -1)
            {
                LogitechGSDK.LogiLcdColorSetText(0, "Subject: " + Contracts[ContractSelect].Subject, 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(1, "Target: " + GameControl.control.Contracts[ContractSelect].Target, 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(2, "File: " + GameControl.control.Contracts[ContractSelect].File, 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(3, "Cash: " + GameControl.control.Contracts[ContractSelect].Cash.ToString(), 0, 255, 0);
            }
        }

        if (show == true)
        {
            GUI.color  = com.colors[Customize.cust.WindowColorInt];
            windowRect = WindowClamp.ClampToScreen(GUI.Window(windowID, windowRect, DoMyWindow, ""));
        }

        RefreshList();
    }
Esempio n. 2
0
    void Test()
    {
        LogitechGSDK.LogiLcdColorSetTitle("Testing", 255, 0, 0);
        LogitechGSDK.LogiLcdColorSetText(0, "zero", 255, 255, 0);
        LogitechGSDK.LogiLcdColorSetText(1, "first", 0, 255, 0);
        LogitechGSDK.LogiLcdColorSetText(2, "second", 0, 255, 30);
        LogitechGSDK.LogiLcdColorSetText(3, "third", 0, 255, 50);
        LogitechGSDK.LogiLcdColorSetText(4, "fourth", 0, 255, 90);
        LogitechGSDK.LogiLcdColorSetText(5, "fifth", 0, 255, 140);
        LogitechGSDK.LogiLcdColorSetText(6, "sixth", 0, 255, 200);
        LogitechGSDK.LogiLcdColorSetText(7, "seventh", 0, 255, 255);
        LogitechGSDK.LogiLcdColorSetText(8, "eight", 0, 255, 255);

        LogitechGSDK.LogiLcdMonoSetText(0, "testing");
        LogitechGSDK.LogiLcdMonoSetText(1, "mono");
        LogitechGSDK.LogiLcdMonoSetText(2, "chrome");
        LogitechGSDK.LogiLcdMonoSetText(3, "lcd");
    }
Esempio n. 3
0
    void OnGUI()
    {
        Customize.cust.windowx[windowID] = windowRect.x;
        Customize.cust.windowy[windowID] = windowRect.y;

        GUI.skin = com.Skin[GameControl.control.GUIID];

        if (GameControl.control.LCDPage > 0 && GameControl.control.LCDPage < 50)
        {
            LogitechGSDK.LogiLcdColorSetTitle("Notification", 0, 255, 0);
            LogitechGSDK.LogiLcdColorSetText(0, Notification, 0, 255, 0);
        }

        SetWindowPos();

        if (show == true)
        {
            windowRect = WindowClamp.ClampToScreen(GUI.Window(windowID, windowRect, DoMyWindow, ""));
        }
    }
Esempio n. 4
0
        static void Main(string[] args)
        {
            // check and load config
            AppSettings loadedSettings = CheckandLoadConfig();

            listEntries = loadedSettings.Applications;


            // set settings
            titelColorR    = utils.HexToColor(loadedSettings.GlobalSettings.TitelColor).R;
            titelColorG    = utils.HexToColor(loadedSettings.GlobalSettings.TitelColor).G;
            titelColorB    = utils.HexToColor(loadedSettings.GlobalSettings.TitelColor).B;
            lineColorR     = utils.HexToColor(loadedSettings.GlobalSettings.LineColor).R;
            lineColorG     = utils.HexToColor(loadedSettings.GlobalSettings.LineColor).G;
            lineColorB     = utils.HexToColor(loadedSettings.GlobalSettings.LineColor).B;
            selectedColorR = utils.HexToColor(loadedSettings.GlobalSettings.SelectedEntryColor).R;
            selectedColorG = utils.HexToColor(loadedSettings.GlobalSettings.SelectedEntryColor).G;
            selectedColorB = utils.HexToColor(loadedSettings.GlobalSettings.SelectedEntryColor).B;
            prefixSelector = loadedSettings.GlobalSettings.PrefixSelector;
            suffixSelector = loadedSettings.GlobalSettings.SuffixSelector;
            debugOn        = loadedSettings.GlobalSettings.DebugMode;
            paddingLeft    = loadedSettings.GlobalSettings.paddingLeft;
            topOffset      = loadedSettings.GlobalSettings.topOffset;



            // check if already running
            Process[] pname = Process.GetProcessesByName(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
            if (pname.Length > 1)
            {
                Process currentProcess = Process.GetCurrentProcess();
                debugOn = true;
                WriteDebugMessage("App already running need to kill all other...");

                foreach (Process task in pname)
                {
                    if (task.Id != currentProcess.Id)
                    {
                        task.Kill();
                        WriteDebugMessage("Process ID: " + task.Id + " killed");
                    }
                }
                WriteDebugMessage("...Done, but manuel restart is neccessary, press any key to exit..");
                Console.ReadKey();
                Environment.Exit(1);
            }
            else
            {
                WriteDebugMessage("no other instance is running... start");
            }


            // init device
            InitDevice();



            // initial line numbers, indexe etc. for scrolling and paging

            displayLines = g19DisplayLines - topOffset;

            maxIndexNumber = listEntries.Count - 1;
            if (maxIndexNumber >= displayLines)
            {
                maxLineNumber = displayLines;
            }
            else
            {
                maxLineNumber = maxIndexNumber;
            }
            int indexNumber = -1;
            int lineNumber  = -1;
            int pageNumber  = 0;

            // load display entries
            InitDisplayEntries();

            // main loop
            while (1 == 1)
            {
                // set time or titel
                if (loadedSettings.GlobalSettings.ShowClockInsteadOfTitel)
                {
                    LogitechGSDK.LogiLcdColorSetTitle(DateTime.Now.ToShortTimeString(), titelColorR, titelColorG, titelColorB);
                }
                else
                {
                    LogitechGSDK.LogiLcdColorSetTitle(loadedSettings.GlobalSettings.AppTitle, titelColorR, titelColorG, titelColorB);
                }
                LogitechGSDK.LogiLcdUpdate();


                // go down button
                if (LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_DOWN) & noPageLock)
                {
                    // count line number until end of page (7)
                    if (lineNumber < maxLineNumber)
                    {
                        lineNumber += 1;
                    }
                    // jump to top
                    else if (lineNumber == maxIndexNumber)
                    {
                        lineNumber = 0;
                    }

                    // count index until max index
                    if (indexNumber == maxIndexNumber)
                    {
                        indexNumber = 0;
                        lineNumber  = 0;
                    }
                    else
                    {
                        indexNumber += 1;
                    }

                    WriteDebugMessage("-> DOWN <-- Line " + lineNumber + " index number:  " + indexNumber + " on Page " + pageNumber);

                    // go down on Page 0 or 1
                    if (pageNumber == 0)
                    {
                        Reorder(lineNumber, indexNumber, appNAME);
                    }
                    else
                    {
                        Reorder(lineNumber, indexNumber, appPATH);
                    }
                }

                // go up button
                if (LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_UP) & noPageLock)
                {
                    // discount line number until start page (0)
                    if (lineNumber > -1 & indexNumber <= maxLineNumber)
                    {
                        lineNumber += -1;
                    }

                    // discount until index or line -1
                    if (indexNumber == -1 | lineNumber == -1)
                    {
                        indexNumber = maxIndexNumber;
                        lineNumber  = maxLineNumber;
                    }
                    else
                    {
                        indexNumber += -1;
                    }

                    WriteDebugMessage("-> UP <-- Line " + lineNumber + " index number:  " + indexNumber + " on Page " + pageNumber);

                    // go up Page 0 or 1
                    if (pageNumber == 0)
                    {
                        Reorder(lineNumber, indexNumber, appNAME);
                    }
                    else
                    {
                        Reorder(lineNumber, indexNumber, appPATH);
                    }
                }

                // hit enter
                if (LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_OK) & noPageLock)
                {
                    WriteDebugMessage("-> OK <-- Line " + lineNumber);
                    SelectEntryOK(lineNumber);
                }

                // go back (left)
                if (LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_LEFT) | LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_CANCEL))
                {
                    WriteDebugMessage("-> BACK (left) <-- Line " + lineNumber);
                    pageNumber = 0;
                    Reorder(lineNumber, indexNumber, appNAME);
                    noPageLock = true;
                }

                // show path (right)
                if (LogitechGSDK.LogiLcdIsButtonPressed(LogitechGSDK.LOGI_LCD_COLOR_BUTTON_RIGHT) & noPageLock)
                {
                    WriteDebugMessage("-> SHOW PATH (right) <-- Line " + lineNumber);
                    Reorder(lineNumber, indexNumber, appPATH);
                    pageNumber = 1;
                }

                Thread.Sleep(100);
            }
        }
Esempio n. 5
0
    void OnGUI()
    {
        Skin     = com.Skin[GameControl.control.GUIID];
        GUI.skin = Skin;

        Customize.cust.windowx[windowID] = windowRect.x;
        Customize.cust.windowy[windowID] = windowRect.y;

        if (show == true)
        {
            GUI.color  = Color.black;
            windowRect = WindowClamp.ClampToScreen(GUI.Window(windowID, windowRect, DoMyWindow, ""));
        }

        if (GameControl.control.LCDPage > 100 && GameControl.control.LCDPage < 150)
        {
            LogitechGSDK.LogiLcdColorSetTitle("CLI", 0, 255, 0);
            LogitechGSDK.LogiLcdColorSetText(7, "> " + cli.Parse, 0, 255, 0);

            if (cli.PastCommands.Count > 0)
            {
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 1)
            {
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 2)
            {
                LogitechGSDK.LogiLcdColorSetText(4, cli.PastCommands[cli.PastCommands.Count - 3], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 4)
            {
                LogitechGSDK.LogiLcdColorSetText(3, cli.PastCommands[cli.PastCommands.Count - 4], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(4, cli.PastCommands[cli.PastCommands.Count - 3], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 5)
            {
                LogitechGSDK.LogiLcdColorSetText(2, cli.PastCommands[cli.PastCommands.Count - 5], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(3, cli.PastCommands[cli.PastCommands.Count - 4], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(4, cli.PastCommands[cli.PastCommands.Count - 3], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 6)
            {
                LogitechGSDK.LogiLcdColorSetText(1, cli.PastCommands[cli.PastCommands.Count - 6], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(2, cli.PastCommands[cli.PastCommands.Count - 5], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(3, cli.PastCommands[cli.PastCommands.Count - 4], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(4, cli.PastCommands[cli.PastCommands.Count - 3], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
            if (cli.PastCommands.Count > 7)
            {
                LogitechGSDK.LogiLcdColorSetText(0, cli.PastCommands[cli.PastCommands.Count - 7], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(1, cli.PastCommands[cli.PastCommands.Count - 6], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(2, cli.PastCommands[cli.PastCommands.Count - 5], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(3, cli.PastCommands[cli.PastCommands.Count - 4], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(4, cli.PastCommands[cli.PastCommands.Count - 3], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(5, cli.PastCommands[cli.PastCommands.Count - 2], 0, 255, 0);
                LogitechGSDK.LogiLcdColorSetText(6, cli.PastCommands[cli.PastCommands.Count - 1], 0, 255, 0);
            }
        }
    }