public override EffectLayer Render(IGameState gamestate)
        {
            current_sine = (float)Math.Round(Math.Pow(Math.Sin((double)((Utils.Time.GetMillisecondsSinceEpoch() % 10000L) / 10000.0f) * 2 * Math.PI * Properties.EffectSpeed), 2));

            if (current_sine == 0.0f && Properties.RandomSecondaryColor)
            {
                current_secondary_color = Utils.ColorUtils.GenerateRandomColor();
            }
            else if (!Properties.RandomSecondaryColor)
            {
                current_secondary_color = Properties.SecondaryColor;
            }

            if (current_sine == 1.0f && Properties.RandomPrimaryColor)
            {
                current_primary_color = Utils.ColorUtils.GenerateRandomColor();
            }
            else if (!Properties.RandomPrimaryColor)
            {
                current_primary_color = Properties.PrimaryColor;
            }

            EffectLayer breathing_layer = new EffectLayer();

            breathing_layer.Set(Properties.Sequence, current_primary_color);
            breathing_layer.Set(Properties.Sequence, Color.FromArgb((byte)(current_sine * 255), current_secondary_color));

            return(breathing_layer);
        }
示例#2
0
        public override EffectLayer Render(IGameState gamestate)
        {
            var layer = new EffectLayer();

            if (!IsCurrentAppValid())
            {
                return(layer);
            }

            foreach (var key in (DeviceKeys[])Enum.GetValues(typeof(DeviceKeys)))
            {
                if (!TryGetColor(key, out Color color))
                {
                    continue;
                }

                layer.Set(key, color);
            }

            if (Properties.KeyCloneMap != null)
            {
                foreach (var target in Properties.KeyCloneMap)
                {
                    if (TryGetColor(target.Value, out var clr))
                    {
                        layer.Set(target.Key, clr);
                    }
                }
            }

            return(layer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer("Background Layer");

            if (gamestate is GameState_Minecraft)
            {
                long time = (gamestate as GameState_Minecraft).World.WorldTime;

                if (time >= 1000 && time <= 11000) // Between 1000 and 11000, world is fully bright day time
                {
                    layer.Set(Properties.Sequence, Properties.PrimaryColor);
                }
                else if (time <= 14000) // Between 11000 and 14000 world transitions from day to night
                {
                    layer.Set(Properties.Sequence, ColorUtils.BlendColors(Properties.PrimaryColor, Properties.SecondaryColor, ((float)(time - 11000) / 3000)));
                }
                else if (time <= 22000) // Between 14000 and 22000 world is fully night time
                {
                    layer.Set(Properties.Sequence, Properties.SecondaryColor);
                }
                else // Between 22000 and 1000 world is transitions from night to day
                {
                    layer.Set(Properties.Sequence, ColorUtils.BlendColors(Properties.SecondaryColor, Properties.PrimaryColor, (((float)(time + 2000) % 24000) / 3000))); // This weird calculation converts range (22,1) into range (0,1) respecting that 24000 = 0
                }
            }
            return(layer);
        }
示例#4
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer();

            if (isActive)
            {
                switch (Properties.AnimationType)
                {
                case TimerLayerAnimationType.OnOff:
                    layer.Set(Properties.Sequence, Properties.SecondaryColor);
                    break;

                case TimerLayerAnimationType.Fade:
                    layer.Set(Properties.Sequence, ColorUtils.BlendColors(Properties.SecondaryColor, Properties.PrimaryColor, timer.InterpolationValue));
                    break;

                case TimerLayerAnimationType.Progress:
                case TimerLayerAnimationType.ProgressGradual:
                    layer.PercentEffect(Properties.SecondaryColor, Properties.PrimaryColor, Properties.Sequence, timer.InterpolationValue, 1, Properties.AnimationType == TimerLayerAnimationType.Progress ? PercentEffectType.Progressive : PercentEffectType.Progressive_Gradual);
                    break;
                }
            }
            else
            {
                layer.Set(Properties.Sequence, Properties.PrimaryColor);
            }
            return(layer);
        }
示例#5
0
        public override void UpdateLights(EffectFrame frame)
        {
            Queue <EffectLayer> layers = new Queue <EffectLayer>();

            EffectLayer bitmap_layer = new EffectLayer("Overwatch - Bitmap");

            Devices.DeviceKeys[] allkeys = Enum.GetValues(typeof(Devices.DeviceKeys)).Cast <Devices.DeviceKeys>().ToArray();
            foreach (var key in allkeys)
            {
                if (key == Devices.DeviceKeys.LOGO && logo.Length == 4)
                {
                    int a, r, g, b;

                    b = logo[0];
                    g = logo[1];
                    r = logo[2];
                    a = logo[3];

                    bitmap_layer.Set(key, GetBoostedColor(Color.FromArgb(a, r, g, b)));
                }
                else if (key == Devices.DeviceKeys.Peripheral && peripheral.Length == 4)
                {
                    int a, r, g, b;

                    b = peripheral[0];
                    g = peripheral[1];
                    r = peripheral[2];
                    a = peripheral[3];

                    bitmap_layer.Set(key, GetBoostedColor(Color.FromArgb(a, r, g, b)));
                }
                else
                {
                    Devices.Logitech.Logitech_keyboardBitmapKeys logi_key = Devices.Logitech.LogitechDevice.ToLogitechBitmap(key);

                    if (logi_key != Devices.Logitech.Logitech_keyboardBitmapKeys.UNKNOWN)
                    {
                        int a, r, g, b;

                        b = bitmap[(int)logi_key];
                        g = bitmap[(int)logi_key + 1];
                        r = bitmap[(int)logi_key + 2];
                        a = bitmap[(int)logi_key + 3];

                        bitmap_layer.Set(key, GetBoostedColor(Color.FromArgb(a, r, g, b)));
                    }
                }
            }

            layers.Enqueue(bitmap_layer);

            //Scripts
            Global.Configuration.ApplicationProfiles[profilename].UpdateEffectScripts(layers, _game_state);

            frame.AddLayers(layers.ToArray());
        }
        public override EffectLayer Render(IGameState state)
        {
            EffectLayer kills_indicator_layer = new EffectLayer("CSGO - Kills Indicator");

            if (state is GameState_CSGO)
            {
                GameState_CSGO csgostate = state as GameState_CSGO;

                if (lastCountedKill != csgostate.Player.State.RoundKills)
                {
                    if (csgostate.Player.State.RoundKills == 0 ||
                        (csgostate.Round.WinTeam == RoundWinTeam.Undefined && csgostate.Previously.Round.WinTeam != RoundWinTeam.Undefined) ||
                        (csgostate.Player.State.Health == 100 && ((csgostate.Previously.Player.State.Health > -1 && csgostate.Previously.Player.State.Health < 100) || (csgostate.Round.WinTeam == RoundWinTeam.Undefined && csgostate.Previously.Round.WinTeam != RoundWinTeam.Undefined)) && csgostate.Provider.SteamID.Equals(csgostate.Player.SteamID))
                        )
                    {
                        roundKills.Clear();
                    }
                    if (csgostate.Previously.Player.State.RoundKills != -1 && csgostate.Player.State.RoundKills != -1 && csgostate.Previously.Player.State.RoundKills < csgostate.Player.State.RoundKills && csgostate.Provider.SteamID.Equals(csgostate.Player.SteamID))
                    {
                        if (csgostate.Previously.Player.State.RoundKillHS != -1 && csgostate.Player.State.RoundKillHS != -1 && csgostate.Previously.Player.State.RoundKillHS < csgostate.Player.State.RoundKillHS)
                        {
                            roundKills.Add(RoundKillType.Headshot);
                        }
                        else
                        {
                            roundKills.Add(RoundKillType.Regular);
                        }
                    }

                    lastCountedKill = csgostate.Player.State.RoundKills;
                }

                if (csgostate.Provider.SteamID.Equals(csgostate.Player.SteamID))
                {
                    for (int pos = 0; pos < Properties.Sequence.keys.Count(); pos++)
                    {
                        if (pos < roundKills.Count)
                        {
                            switch (roundKills[pos])
                            {
                            case (RoundKillType.Regular):
                                kills_indicator_layer.Set(Properties.Sequence.keys[pos], Properties.RegularKillColor);
                                break;

                            case (RoundKillType.Headshot):
                                kills_indicator_layer.Set(Properties.Sequence.keys[pos], Properties.HeadshotKillColor);
                                break;
                            }
                        }
                    }
                }
            }

            return(kills_indicator_layer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer sc_assistant_layer = new EffectLayer("Shortcut Assistant");

            if (Global.held_modified == Keys.LControlKey || Global.held_modified == Keys.RControlKey)
            {
                if (Properties.DimBackground)
                {
                    sc_assistant_layer.Fill(Properties.DimColor);
                }

                if (Global.held_modified == Keys.LControlKey)
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.LEFT_CONTROL, Properties.CtrlKeyColor);
                }
                else
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.RIGHT_CONTROL, Properties.CtrlKeyColor);
                }
                sc_assistant_layer.Set(Properties.CtrlKeySequence, Properties.CtrlKeyColor);
            }
            else if (Global.held_modified == Keys.LMenu || Global.held_modified == Keys.RMenu)
            {
                if (Properties.DimBackground)
                {
                    sc_assistant_layer.Fill(Properties.DimColor);
                }

                if (Global.held_modified == Keys.LMenu)
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.LEFT_ALT, Properties.AltKeyColor);
                }
                else
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.RIGHT_ALT, Properties.AltKeyColor);
                }
                sc_assistant_layer.Set(Properties.AltKeySequence, Properties.AltKeyColor);
            }
            else if (Global.held_modified == Keys.LWin || Global.held_modified == Keys.RWin)
            {
                if (Properties.DimBackground)
                {
                    sc_assistant_layer.Fill(Properties.DimColor);
                }

                if (Global.held_modified == Keys.LWin)
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.LEFT_WINDOWS, Properties.WindowsKeyColor);
                }
                else
                {
                    sc_assistant_layer.Set(Devices.DeviceKeys.RIGHT_WINDOWS, Properties.WindowsKeyColor);
                }
                sc_assistant_layer.Set(Properties.WindowsKeySequence, Properties.WindowsKeyColor);
            }


            return(sc_assistant_layer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            var layer = new EffectLayer("FFXIV - Action Layer");

            layer.Fill(Color.Transparent);
            if (gamestate is GameState_FFXIV ffxiv)
            {
                var keybinds     = ffxiv.KeyBinds.ToList();
                var recordedKeys = Global.InputEvents;
                var modif        = new List <DeviceKeys>();
                if (recordedKeys.Alt)
                {
                    modif.AddRange(new [] { DeviceKeys.LEFT_ALT, DeviceKeys.LEFT_SHIFT });
                }
                if (recordedKeys.Control)
                {
                    modif.AddRange(new [] { DeviceKeys.LEFT_CONTROL, DeviceKeys.RIGHT_CONTROL });
                }
                if (recordedKeys.Shift)
                {
                    modif.AddRange(new [] { DeviceKeys.LEFT_SHIFT, DeviceKeys.RIGHT_SHIFT });
                }
                if (!recordedKeys.Shift && !recordedKeys.Control && !recordedKeys.Alt)
                {
                    modif.AddRange(new [] { DeviceKeys.NONE });
                }
                if (keybinds.Any() && (!prevKey.Any() || !keybinds.All(t => prevKey.Contains(t)) || !prevDevice.Any() || !modif.All(t => prevDevice.Contains(t))))
                {
                    var modifs = new List <DeviceKeys>();
                    foreach (var keyBind in keybinds.Where(t => t.Key != DeviceKeys.NONE && t.KeyMod.All(f => modif.Contains(f)) && (!modif.Any() || modif.All(f => t.KeyMod.Contains(f))) && (!Properties.Ignore || !t.Command.Contains("PERFORMANCE_MODE"))))
                    {
                        layer.Set(keyBind.Key, Properties.PrimaryColor);
                        if (keyBind.KeyMod[0] != DeviceKeys.NONE)
                        {
                            modifs.AddRange(keyBind.KeyMod);
                        }
                    }
                    layer.Set(modifs.ToArray(), Properties.PrimaryColor);
                    prevKey    = keybinds;
                    prevDevice = modif;
                }
                else
                {
                    layer = prev;
                }
            }
            else
            {
                layer = prev;
            }
            prev = layer;
            return(layer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            var layer = new EffectLayer("FFXIV - Action Layer");

            layer.Fill(Color.Transparent);
            if (gamestate is GameState_FFXIV ffxiv)
            {
                lock (ffxiv.Actions)
                {
                    var modif = getModifs();
                    if (ffxiv.Actions.Any() && (Math.Abs(ffxiv.Player.CastingPercentage - prevCastPercent) > 0 || !prevActions.Any() || !ffxiv.Actions.All(t => prevActions.Any(f => f.Equals(t))) || !prevDevice.Any() || !modif.All(t => prevDevice.Contains(t))))
                    {
                        layer.Set(ffxiv.Actions.Where(t => t.Key != DeviceKeys.NONE).Select(t => t.Key).ToArray(), Properties.NotAvailable);
                        foreach (var ffxivAction in ffxiv.Actions.Where(t => modif.All(f => f(t)) && t.Key != DeviceKeys.NONE))
                        {
                            layer.Set(ffxivAction.Key, ColorUtils.MultiplyColorByScalar(Properties.PrimaryColor, ffxivAction.GetCoolDownPrecent(ffxiv)));
                            if (ffxivAction.IsProcOrCombo)
                            {
                                layer.Set(ffxivAction.Key, ColorUtils.MultiplyColorByScalar(Properties.Combo, ffxivAction.GetCoolDownPrecent(ffxiv)));
                            }
                            if (!ffxivAction.InRange)
                            {
                                layer.Set(ffxivAction.Key, ColorUtils.MultiplyColorByScalar(Properties.OutOfRange, ffxivAction.GetCoolDownPrecent(ffxiv)));
                            }
                            if (!ffxivAction.IsAvailable)
                            {
                                layer.Set(ffxivAction.Key, Properties.NotAvailable);
                            }
                        }
                        setModifKeys(layer, ffxiv.Actions.Where(t => t.IsCtrl).ToArray(), new [] { DeviceKeys.LEFT_CONTROL, DeviceKeys.RIGHT_CONTROL }, ffxiv);
                        setModifKeys(layer, ffxiv.Actions.Where(t => t.IsShift).ToArray(), new [] { DeviceKeys.LEFT_SHIFT, DeviceKeys.RIGHT_SHIFT }, ffxiv);
                        setModifKeys(layer, ffxiv.Actions.Where(t => t.IsAlt).ToArray(), new [] { DeviceKeys.LEFT_ALT, DeviceKeys.RIGHT_ALT }, ffxiv);
                        prevActions     = ffxiv.Actions.ToList();
                        prevDevice      = modif;
                        prevCastPercent = ffxiv.Player.CastingPercentage;
                    }
                    else
                    {
                        layer = prev;
                    }
                }
            }
            else
            {
                layer = prev;
            }
            prev = layer;
            return(layer);
        }
        private void SetKeySmooth(EffectLayer layer, DeviceKeys key, Color color)
        {
            if (!currentKeyColors.ContainsKey(key))
            {
                currentKeyColors[key] = Color.Empty;
            }

            KeyBlendState blendState = new KeyBlendState(currentKeyColors[key], color);

            if (keyBlendStates.ContainsKey(key))
            {
                if (!keyBlendStates[key].colorTo.Equals(color))
                {
                    blendState.colorFrom = keyBlendStates[key].GetBlendedColor();
                    keyBlendStates[key]  = blendState;
                }
            }
            else
            {
                keyBlendStates[key] = blendState;
            }

            keyBlendStates[key].Increment();
            if (keyBlendStates[key].Finished())
            {
                SetKey(layer, key, color);
            }
            else
            {
                layer.Set(key, keyBlendStates[key].GetBlendedColor());
            }
        }
示例#11
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer solidcolor_layer = new EffectLayer();

            solidcolor_layer.Set(Properties.Sequence, Properties.PrimaryColor);
            return(solidcolor_layer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            // Parse the operands
            double op1 = Utils.GameStateUtils.TryGetDoubleFromState(gamestate, Properties.Operand1Path);
            double op2 = Utils.GameStateUtils.TryGetDoubleFromState(gamestate, Properties.Operand2Path);

            // Evaluate the operands
            bool cond = false;

            switch (Properties.Operator)
            {
            case ComparisonOperator.EQ: cond = op1 == op2; break;

            case ComparisonOperator.NEQ: cond = op1 != op2; break;

            case ComparisonOperator.LT: cond = op1 < op2; break;

            case ComparisonOperator.LTE: cond = op1 <= op2; break;

            case ComparisonOperator.GT: cond = op1 > op2; break;

            case ComparisonOperator.GTE: cond = op1 >= op2; break;
            }

            // Render the correct color
            EffectLayer layer = new EffectLayer("Comparison");

            layer.Set(Properties.Sequence, cond ? Properties.PrimaryColor : Properties.SecondaryColor);
            return(layer);
        }
示例#13
0
        public override EffectLayer Render(IGameState state)
        {
            currenttime = Utils.Time.GetMillisecondsSinceEpoch();

            if (previoustime + (Properties.UpdateInterval * 1000L) <= currenttime)
            {
                previoustime = currenttime;

                foreach (Devices.DeviceKeys key in (Properties.Sequence.type == KeySequenceType.FreeForm) ? Enum.GetValues(typeof(Devices.DeviceKeys)) : Properties.Sequence.keys.ToArray())
                {
                    Color clr = (Properties.AllowTransparency ? (randomizer.Next() % 2 == 0 ? Color.Transparent : Utils.ColorUtils.GenerateRandomColor()) : Utils.ColorUtils.GenerateRandomColor());

                    if (_GlitchColors.ContainsKey(key))
                    {
                        _GlitchColors[key] = clr;
                    }
                    else
                    {
                        _GlitchColors.Add(key, clr);
                    }
                }
            }

            EffectLayer _GlitchLayer = new EffectLayer();

            foreach (var kvp in _GlitchColors)
            {
                _GlitchLayer.Set(kvp.Key, kvp.Value);
            }

            _GlitchLayer.OnlyInclude(Properties.Sequence);
            return(_GlitchLayer);
        }
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer blinker_layer = new EffectLayer("ETS2 - Blinker Layer");

            if (gamestate is GameState_ETS2)
            {
                // Left blinker
                Color trgColor = ((GameState_ETS2)gamestate).Truck.blinkerLeftOn ? Properties.BlinkerOnColor : Properties.BlinkerOffColor;
                blinker_layer.Set(Properties.LeftBlinkerSequence, trgColor);

                // Right blinker
                trgColor = ((GameState_ETS2)gamestate).Truck.blinkerRightOn ? Properties.BlinkerOnColor : Properties.BlinkerOffColor;
                blinker_layer.Set(Properties.RightBlinkerSequence, trgColor);
            }
            return(blinker_layer);
        }
示例#15
0
        public override EffectLayer Render(IGameState gamestate)
        {
            current_sine = (float)Math.Pow(Math.Sin((double)((Utils.Time.GetMillisecondsSinceEpoch() % 10000L) / 10000.0f) * 2 * Math.PI * Properties.EffectSpeed), 2);

            if (current_sine <= 0.0025f * Properties.EffectSpeed && Properties.RandomSecondaryColor)
            {
                current_secondary_color = Utils.ColorUtils.GenerateRandomColor();
            }
            else if (!Properties.RandomSecondaryColor)
            {
                current_secondary_color = Properties.SecondaryColor;
            }

            if (current_sine >= 1.0f - (0.0025f * Properties.EffectSpeed) && Properties.RandomPrimaryColor)
            {
                current_primary_color = Utils.ColorUtils.GenerateRandomColor();
            }
            else if (!Properties.RandomPrimaryColor)
            {
                current_primary_color = Properties.PrimaryColor;
            }

            EffectLayer breathing_layer = new EffectLayer();

            breathing_layer.Set(Properties.Sequence, Utils.ColorUtils.BlendColors(current_primary_color, current_secondary_color, current_sine));

            return(breathing_layer);
        }
示例#16
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer();

            layer.Set(Properties.Sequence, state ? Properties.SecondaryColor : Properties.PrimaryColor);
            return(layer);
        }
示例#17
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer sc_assistant_layer = new EffectLayer("Shortcut Assistant");

            Keys[] heldKeys = Global.InputEvents.PressedKeys;

            Tree <Keys> _childKeys = Properties.ShortcutKeysTree;

            foreach (var key in heldKeys)
            {
                if (_childKeys != null)
                {
                    _childKeys = _childKeys.ContainsItem(Properties.MergeModifierKey ? KeyUtils.GetStandardKey(key) : key);
                }
            }

            if (_childKeys != null && _childKeys.Item != Keys.None)
            {
                Keys[] shortcutKeys;

                if (Properties.PresentationType == ShortcutAssistantPresentationType.ProgressiveSuggestion)
                {
                    shortcutKeys = _childKeys.GetChildren();
                }
                else
                {
                    shortcutKeys = _childKeys.GetAllChildren();
                }

                if (shortcutKeys.Length > 0)
                {
                    Devices.DeviceKeys[] selectedKeys = Utils.KeyUtils.GetDeviceKeys(shortcutKeys, true, !Console.NumberLock)
                                                        .Concat(Utils.KeyUtils.GetDeviceKeys(heldKeys, true)).ToArray();

                    if (Properties.DimBackground)
                    {
                        Devices.DeviceKeys[] backgroundKeys = Utils.KeyUtils.GetDeviceAllKeys().Except(selectedKeys).ToArray();
                        sc_assistant_layer.Set(backgroundKeys, Properties.DimColor);
                        //sc_assistant_layer.Fill(Properties.DimColor);
                    }

                    sc_assistant_layer.Set(selectedKeys, Properties.PrimaryColor);
                }
            }

            return(sc_assistant_layer);
        }
示例#18
0
        public override EffectLayer Render(IGameState gamestate)
        {
            var layer = new EffectLayer();

            if (!IsCurrentAppValid())
            {
                return(layer);
            }

            foreach (var key in (DeviceKeys[])Enum.GetValues(typeof(DeviceKeys)))
            {
                Color color;
                if (RazerLayoutMap.GenericKeyboard.TryGetValue(key, out var position))
                {
                    color = _keyboardColors[position[1] + position[0] * 22];
                }
                else if (key >= DeviceKeys.MOUSEPADLIGHT1 && key <= DeviceKeys.MOUSEPADLIGHT15)
                {
                    color = _mousepadColors[DeviceKeys.MOUSEPADLIGHT15 - key];
                }
                else if (key == DeviceKeys.Peripheral)
                {
                    color = _mouseColor;
                }
                else
                {
                    continue;
                }

                if (Properties.ColorPostProcessEnabled)
                {
                    color = PostProcessColor(color);
                }

                layer.Set(key, color);

                if (Properties.KeyCloneMap != null)
                {
                    foreach (var target in Properties.KeyCloneMap.Where(x => x.Value == key).Select(x => x.Key))
                    {
                        layer.Set(target, color);
                    }
                }
            }

            return(layer);
        }
示例#19
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer("Conditional Layer");

            bool result = gamestate.GetBool(Properties.ConditionPath);

            layer.Set(Properties.Sequence, result ? Properties.PrimaryColor : Properties.SecondaryColor);
            return(layer);
        }
示例#20
0
        public override void UpdateLights(EffectFrame frame)
        {
            Queue <EffectLayer> layers = new Queue <EffectLayer>();

            long time = Utils.Time.GetMillisecondsSinceEpoch();

            if (Global.Configuration.skype_overlay_settings.mm_enabled)
            {
                if (_missed_messages_count > 0)
                {
                    EffectLayer skype_missed_messages = new EffectLayer("Overlay - Skype Missed Messages");

                    ColorSpectrum mm_spec = new ColorSpectrum(Global.Configuration.skype_overlay_settings.mm_color_primary, Global.Configuration.skype_overlay_settings.mm_color_secondary, Global.Configuration.skype_overlay_settings.mm_color_primary);
                    Color         color   = Color.Orange;

                    if (Global.Configuration.skype_overlay_settings.mm_blink)
                    {
                        color = mm_spec.GetColorAt((time % 2000L) / 2000.0f);
                    }
                    else
                    {
                        color = mm_spec.GetColorAt(0);
                    }

                    skype_missed_messages.Set(Global.Configuration.skype_overlay_settings.mm_sequence, color);

                    layers.Enqueue(skype_missed_messages);
                }
            }

            if (Global.Configuration.skype_overlay_settings.call_enabled)
            {
                if (_is_calling)
                {
                    EffectLayer skype_ringing_call = new EffectLayer("Overlay - Skype Ringing Call");

                    ColorSpectrum mm_spec = new ColorSpectrum(Global.Configuration.skype_overlay_settings.call_color_primary, Global.Configuration.skype_overlay_settings.call_color_secondary, Global.Configuration.skype_overlay_settings.call_color_primary);
                    Color         color   = Color.Green;

                    if (Global.Configuration.skype_overlay_settings.call_blink)
                    {
                        color = mm_spec.GetColorAt((time % 2000L) / 2000.0f);
                    }
                    else
                    {
                        color = mm_spec.GetColorAt(0);
                    }

                    skype_ringing_call.Set(Global.Configuration.skype_overlay_settings.call_sequence, color);

                    layers.Enqueue(skype_ringing_call);
                }
            }


            frame.AddOverlayLayers(layers.ToArray());
        }
 private void SetKey(EffectLayer layer, DeviceKeys key, Color color)
 {
     if (keyBlendStates.ContainsKey(key))
     {
         keyBlendStates.Remove(key);
     }
     currentKeyColors[key] = color;
     layer.Set(key, color);
 }
示例#22
0
        public override EffectLayer Render(IGameState state)
        {
            EffectLayer abilities_layer = new EffectLayer("Dota 2 - Abilities");

            if (state is GameState_Dota2)
            {
                GameState_Dota2 dota2state = state as GameState_Dota2;

                if (Properties.AbilityKeys.Count >= 6)
                {
                    for (int index = 0; index < dota2state.Abilities.Count; index++)
                    {
                        Ability ability = dota2state.Abilities[index];
                        if (ability.Name.Contains("seasonal") || ability.Name.Contains("high_five"))
                        {
                            continue;
                        }

                        Devices.DeviceKeys key = Properties.AbilityKeys[index];

                        if (ability.IsUltimate)
                        {
                            key = Properties.AbilityKeys[5];
                        }

                        if (ability.CanCast && ability.Cooldown == 0 && ability.Level > 0)
                        {
                            abilities_layer.Set(key, Properties.CanCastAbilityColor);
                        }
                        else if (ability.Cooldown <= 5 && ability.Level > 0)
                        {
                            abilities_layer.Set(key, Utils.ColorUtils.BlendColors(Properties.CanCastAbilityColor, Properties.CanNotCastAbilityColor, (double)ability.Cooldown / 5.0));
                        }
                        else
                        {
                            abilities_layer.Set(key, Properties.CanNotCastAbilityColor);
                        }
                    }
                }
            }

            return(abilities_layer);
        }
示例#23
0
        public override EffectLayer Render(IGameState _)
        {
            EffectLayer layer = new EffectLayer();

            foreach (var key in Properties.Sequence.keys)
            {
                layer.Set(key, key == activeKey ? Properties.SecondaryColor : Properties.PrimaryColor);
            }
            return(layer);
        }
示例#24
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer sc_assistant_layer = new EffectLayer("Shortcut Assistant");

            Keys[] heldKeys = Global.input_subscriptions.PressedKeys;

            Tree <Keys> _childKeys = Properties.ShortcutKeysTree;

            foreach (var key in heldKeys)
            {
                if (_childKeys != null)
                {
                    _childKeys = _childKeys.ContainsItem(key);
                }
            }

            if (_childKeys != null && _childKeys.Item != Keys.None)
            {
                Keys[] shortcutKeys;

                if (Properties.PresentationType == ShortcutAssistantPresentationType.ProgressiveSuggestion)
                {
                    shortcutKeys = _childKeys.GetChildren();
                }
                else
                {
                    shortcutKeys = _childKeys.GetAllChildren();
                }

                if (shortcutKeys.Length > 0)
                {
                    if (Properties.DimBackground)
                    {
                        sc_assistant_layer.Fill(Properties.DimColor);
                    }

                    sc_assistant_layer.Set(Utils.KeyUtils.GetDeviceKeys(shortcutKeys), Properties.PrimaryColor);
                    sc_assistant_layer.Set(Utils.KeyUtils.GetDeviceKeys(heldKeys), Properties.PrimaryColor);
                }
            }

            return(sc_assistant_layer);
        }
        private void setModifKeys(EffectLayer layer, ActionStructure[] actions, DeviceKeys[] deviceKeys, GameState_FFXIV ffxiv)
        {
            if (!actions.Any())
            {
                return;
            }
            var scalar = actions.Select(t => t.GetCoolDownPrecent(ffxiv)).Max();

            layer.Set(deviceKeys, ColorUtils.MultiplyColorByScalar(Properties.PrimaryColor, scalar));
            if (actions.Any(t => t.IsProcOrCombo))
            {
                layer.Set(deviceKeys, ColorUtils.MultiplyColorByScalar(Properties.Combo, scalar));
            }
            if (!actions.Any(t => t.InRange))
            {
                layer.Set(deviceKeys, ColorUtils.MultiplyColorByScalar(Properties.OutOfRange, scalar));
            }
            if (!actions.Any(t => t.IsAvailable))
            {
                layer.Set(deviceKeys, Properties.NotAvailable);
            }
        }
示例#26
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer gradient_layer = new EffectLayer();

            //If Wave Size 0 Gradiant Stop Moving Animation
            if (Properties.GradientConfig.gradient_size == 0)
            {
                Properties.GradientConfig.shift_amount    += ((Utils.Time.GetMillisecondsSinceEpoch() - Properties.GradientConfig.last_effect_call) / 1000.0f) * 5.0f * Properties.GradientConfig.speed;
                Properties.GradientConfig.shift_amount     = Properties.GradientConfig.shift_amount % Effects.canvas_biggest;
                Properties.GradientConfig.last_effect_call = Utils.Time.GetMillisecondsSinceEpoch();

                Color selected_color = Properties.GradientConfig.brush.GetColorSpectrum().GetColorAt(Properties.GradientConfig.shift_amount, Effects.canvas_biggest);

                gradient_layer.Set(Properties.Sequence, selected_color);
            }
            else if (Properties.Sequence.type == KeySequenceType.Sequence)
            {
                using var temp_layer = new EffectLayer("Color Zone Effect", LayerEffects.GradientShift_Custom_Angle, Properties.GradientConfig);

                foreach (var key in Properties.Sequence.keys)
                {
                    gradient_layer.Set(key, temp_layer.Get(key));
                }
            }
            else
            {
                gradient_layer.DrawTransformed(
                    Properties.Sequence,
                    g =>
                {
                    var rect = new RectangleF(0, 0, Effects.canvas_width, Effects.canvas_height);
                    using var temp_layer_bitmap = new EffectLayer("Color Zone Effect", LayerEffects.GradientShift_Custom_Angle, Properties.GradientConfig, rect).GetBitmap();
                    g.DrawImage(temp_layer_bitmap, rect, rect, GraphicsUnit.Pixel);
                }
                    );
            }
            return(gradient_layer);
        }
示例#27
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer("Minecraft Key Conflict Layer");

            if (gamestate is GameState_Minecraft && (gamestate as GameState_Minecraft).Game.ControlsGuiOpen)
            {
                layer.Fill(Color.Black); // Hide any other layers behind this one
                // Set all keys in use by any binding to be the no-conflict colour
                foreach (var kb in ((GameState_Minecraft)gamestate).Game.KeyBindings)
                {
                    if (kb != null)
                    {
                        layer.Set(kb.AffectedKeys, Properties.PrimaryColor);
                    }
                }

                // Override the keys for all conflicting keys
                foreach (var kvp in CalculateConflicts((GameState_Minecraft)gamestate))
                {
                    layer.Set(kvp.Key, kvp.Value ? Properties.TertiaryColor : Properties.SecondaryColor);
                }
            }
            return(layer);
        }
示例#28
0
        public override EffectLayer Render(IGameState state)
        {
            EffectLayer keys_layer = new EffectLayer("Resident Evil 2 - Rank");

            if (state is GameState_ResidentEvil2)
            {
                GameState_ResidentEvil2 re2state = state as GameState_ResidentEvil2;

                if (re2state.Player.Status != Player_ResidentEvil2.PlayerStatus.OffGame && re2state.Player.Rank != 0)
                {
                    keys_layer.Set(Properties.Sequence.keys[re2state.Player.Rank - 1], Color.White);
                }
            }
            return(keys_layer);
        }
示例#29
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer gradient_layer = new EffectLayer();

            if (Properties.Sequence.type == KeySequenceType.Sequence)
            {
                temp_layer = new EffectLayer("Color Zone Effect", LayerEffects.GradientShift_Custom_Angle, Properties.GradientConfig);

                foreach (var key in Properties.Sequence.keys)
                {
                    gradient_layer.Set(key, Utils.ColorUtils.AddColors(gradient_layer.Get(key), temp_layer.Get(key)));
                }
            }
            else
            {
                float x_pos  = (float)Math.Round((Properties.Sequence.freeform.X + Effects.grid_baseline_x) * Effects.editor_to_canvas_width);
                float y_pos  = (float)Math.Round((Properties.Sequence.freeform.Y + Effects.grid_baseline_y) * Effects.editor_to_canvas_height);
                float width  = (float)Math.Round((double)(Properties.Sequence.freeform.Width * Effects.editor_to_canvas_width));
                float height = (float)Math.Round((double)(Properties.Sequence.freeform.Height * Effects.editor_to_canvas_height));

                if (width < 3)
                {
                    width = 3;
                }
                if (height < 3)
                {
                    height = 3;
                }

                Rectangle rect = new Rectangle((int)x_pos, (int)y_pos, (int)width, (int)height);

                temp_layer = new EffectLayer("Color Zone Effect", LayerEffects.GradientShift_Custom_Angle, Properties.GradientConfig, rect);

                using (Graphics g = gradient_layer.GetGraphics())
                {
                    PointF rotatePoint = new PointF(x_pos + (width / 2.0f), y_pos + (height / 2.0f));

                    Matrix myMatrix = new Matrix();
                    myMatrix.RotateAt(Properties.Sequence.freeform.Angle, rotatePoint, MatrixOrder.Append);

                    g.Transform = myMatrix;
                    g.DrawImage(temp_layer.GetBitmap(), rect, rect, GraphicsUnit.Pixel);
                }
            }

            return(gradient_layer);
        }
示例#30
0
        public override EffectLayer Render(IGameState gamestate)
        {
            EffectLayer layer = new EffectLayer("Conditional Layer");

            bool result = false;

            if (Properties.ConditionPath.Length > 0)
            {
                try {
                    object tmp = Utils.GameStateUtils.RetrieveGameStateParameter(gamestate, Properties.ConditionPath);
                    result = (bool)Utils.GameStateUtils.RetrieveGameStateParameter(gamestate, Properties.ConditionPath);
                } catch { }
            }

            layer.Set(Properties.Sequence, result ? Properties.PrimaryColor : Properties.SecondaryColor);
            return(layer);
        }