Exemplo n.º 1
0
        private static void UpdateLightColors(Color LogoColor, Color KeyboardMiddleColor, Color KeyboardOuterColor, Color StatusColor)
        {
            if (LogoColor == AlienwareFXManager.LastLogoColor && KeyboardMiddleColor == AlienwareFXManager.LastMidKeyColor && KeyboardOuterColor == AlienwareFXManager.LastOutKeyColor && StatusColor == AlienwareFXManager.LastOtherColor || (DateTime.Now - AlienwareFXManager.LastUpdateTime).TotalSeconds < 0.1)
            {
                return;
            }
            for (uint devIndex = 0; devIndex < AlienwareFXManager.numDevices; ++devIndex)
            {
                for (uint lightIndex = 0; lightIndex < AlienwareFXManager.deviceLightCounts[(int)devIndex]; ++lightIndex)
                {
                    LFX_ColorStruct lightCol = AlienwareFXManager.Col2LFXC(LogoColor);
                    string          lower    = AlienwareFXManager.deviceLightDescriptions[(int)devIndex][(int)lightIndex].ToLower();
                    if (lower.Contains("keyboard"))
                    {
                        lightCol = !lower.Contains("middle") ? AlienwareFXManager.Col2LFXC(KeyboardOuterColor) : AlienwareFXManager.Col2LFXC(KeyboardMiddleColor);
                    }
                    else if (lower.Contains("status"))
                    {
                        lightCol = AlienwareFXManager.Col2LFXC(StatusColor);
                    }
                    int num = (int)AlienwareFXManager.LightFX.LFX_SetLightColor(devIndex, lightIndex, ref lightCol);
                }
            }
            int num1 = (int)AlienwareFXManager.LightFX.LFX_Update();

            AlienwareFXManager.LastLogoColor   = LogoColor;
            AlienwareFXManager.LastMidKeyColor = KeyboardMiddleColor;
            AlienwareFXManager.LastOutKeyColor = KeyboardOuterColor;
            AlienwareFXManager.LastOtherColor  = StatusColor;
            AlienwareFXManager.LastUpdateTime  = DateTime.Now;
        }
Exemplo n.º 2
0
 private static void UpdateLightsForThemeAndFlash(OS os)
 {
     if (os.thisComputer.disabled)
     {
         AlienwareFXManager.UpdateLightColors(Color.Black, Color.Black, Color.Black, Color.Black);
     }
     else
     {
         float amount             = Math.Max(0.0f, Math.Min(1f, os.warningFlashTimer));
         Color KeyboardOuterColor = Color.Lerp(Color.Lerp(os.AFX_KeyboardOuter, Color.Red, amount), Color.White, os.PorthackCompleteFlashTime / PortHackExe.COMPLETE_LIGHT_FLASH_TIME);
         AlienwareFXManager.UpdateLightColors(Color.Lerp(Color.Lerp(os.AFX_WordLogo, Color.Red, amount), Color.White, os.MissionCompleteFlashTime / 3f), Color.Lerp(os.AFX_KeyboardMiddle, Color.Red, amount), KeyboardOuterColor, Color.Lerp(os.AFX_Other, Color.Red, amount));
     }
 }
Exemplo n.º 3
0
 public static void UpdateForOS(object OS_Obj)
 {
     if (!AlienwareFXManager.IsRunning)
     {
         return;
     }
     if (OS_Obj != null)
     {
         OS     os = (OS)OS_Obj;
         double warningFlashTimer = (double)os.warningFlashTimer;
         AlienwareFXManager.UpdateLightsForThemeAndFlash(os);
         AlienwareFXManager.HasUpdatedPostFlash = false;
     }
     else
     {
         AlienwareFXManager.CycleAllLights(Color.Red, Color.White, (float)(DateTime.Now - AlienwareFXManager.TimeStarted).TotalSeconds);
     }
 }
Exemplo n.º 4
0
        private static void CycleAllLights(Color from, Color to, float time)
        {
            if ((DateTime.Now - AlienwareFXManager.LastUpdateTime).TotalSeconds < 0.1)
            {
                return;
            }
            for (uint devIndex = 0; devIndex < AlienwareFXManager.numDevices; ++devIndex)
            {
                for (uint lightIndex = 0; lightIndex < AlienwareFXManager.deviceLightCounts[(int)devIndex]; ++lightIndex)
                {
                    float           amount   = (float)((Math.Sin((double)time / ((double)lightIndex / 2.0)) + 1.0) / 2.0);
                    LFX_ColorStruct lightCol = AlienwareFXManager.Col2LFXC(Color.Lerp(from, to, amount));
                    int             num      = (int)AlienwareFXManager.LightFX.LFX_SetLightColor(devIndex, lightIndex, ref lightCol);
                }
            }
            int num1 = (int)AlienwareFXManager.LightFX.LFX_Update();

            AlienwareFXManager.LastUpdateTime = DateTime.Now;
        }