private static void VarRegistrySourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            Control_VariableRegistryEditor self = (Control_VariableRegistryEditor)obj;

            if (e.OldValue == e.NewValue || self.stack_Options.Children.Count == 0)
                return;

            VariableRegistry newRegistry = (VariableRegistry)e.NewValue;
            foreach (UIElement child in self.stack_Options.Children)
            {
                if (child is Control_VariableRegistryItem)
                    ((Control_VariableRegistryItem)child).VarRegistry = newRegistry;
            }
        }
Example #2
0
 public VariableRegistry GetRegisteredVariables()
 {
     if (default_registry == null)
     {
         default_registry = new VariableRegistry();
         default_registry.Register($"{devicename}_restore_dualshock", new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(255, 0, 0, 255)), "Color", new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(255, 255, 255, 255)), new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(0, 0, 0, 0)), "Set restore color for your DS4 Controller");
         default_registry.Register($"{devicename}_disconnect_when_stop", false, "Disconnect when Stopping");
         default_registry.Register($"{devicename}_auto_connect", true, "Auto connect");
         default_registry.Register($"{devicename}_LowBattery_threshold", 20, "Low battery threshold", 100, 0, "In percent. To deactivate set to 0");
         default_registry.Register($"{devicename}_LowBattery_color", new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(255, 255, 0, 0)), "Low battery color", new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(255, 255, 255, 255)), new Aurora.Utils.RealColor(System.Drawing.Color.FromArgb(0, 0, 0, 0)));
         default_registry.Register($"{devicename}_devicekey", DeviceKeys.Peripheral, "Key to Use", DeviceKeys.MOUSEPADLIGHT15, DeviceKeys.Peripheral);
     }
     return(default_registry);
 }
Example #3
0
        protected override void RegisterVariables(VariableRegistry local)
        {
            //hack to not have to reference wpf stuff to get the Media.Color :(
            var black = new RealColor();

            black.SetDrawingColor(Color.Black);
            var white = new RealColor();

            white.SetDrawingColor(Color.White);

            local.Register($"{DeviceName}_color", black, "Default Color", white, black);
            local.Register($"{DeviceName}_override", false, "Override DLL");
            local.Register($"{DeviceName}_dlltype", DLLType.LGS, "DLL Type");
        }
Example #4
0
        public VariableRegistry GetRegisteredVariables()
        {
            if (default_registry == null)
            {
                var devKeysEnumAsEnumerable = Enum.GetValues(typeof(DeviceKeys)).Cast <DeviceKeys>();

                default_registry = new VariableRegistry();
                default_registry.Register($"{devicename}_devicekey", DeviceKeys.Peripheral_Logo, "Key to Use", devKeysEnumAsEnumerable.Max(), devKeysEnumAsEnumerable.Min());
                default_registry.Register($"{devicename}_send_delay", 35, "Send delay (ms)");
                default_registry.Register($"{devicename}_IP", "0.0.0.0", "YeeLight IP", null, null, "If set to 0.0.0.0 and auto-discovery is enabled, it will try to discover a YeeLight and connect to it.");
                default_registry.Register($"{devicename}_auto_discovery", false, "Auto-discovery", null, null, "Enable this and set IP to 0.0.0.0 to auto-discover a light.");
            }

            return(default_registry);
        }
Example #5
0
 public VariableRegistry GetRegisteredVariables()
 {
     if (default_registry == null)
     {
         default_registry = new VariableRegistry();
         default_registry.Register("esp8266_devicekey", DeviceKeys.Peripheral, "Key to Use", DeviceKeys.MOUSEPADLIGHT15, DeviceKeys.Peripheral);
         default_registry.Register("esp8266_wifi_enable", false, "Use WiFi");
         default_registry.Register("esp8266_wifi", "", "ESP8266 IP Adresses (Comma separated)");
         default_registry.Register("esp8266_wifi_port_tcp", 1337, "ESP8266 TCP Port");
         default_registry.Register("esp8266_wifi_port_udp", 1337, "ESP8266 UDP Port");
         default_registry.Register("esp8266_com_enable", false, "Use Serial Port (USB)");
         default_registry.Register("esp8266_com", "", "Serial Ports (Comma separated)");
         default_registry.Register("esp8266_com_baud", 74880, "Baud Rate", 0, 2000000);
         default_registry.Register("esp8266_auto_switch", true, "Automatically switch to Aurora Mode");
         default_registry.Register("esp8266_restore_mode", Mode.DefaultMode, "Mode to return to when disconnecting");
     }
     return(default_registry);
 }
    public object UpdateLights(VariableRegistry settings, IGameState state = null)
    {
        EffectLayer layer = new EffectLayer(this.ID);
        RealColor   FG    = settings.GetVariable <RealColor>("foregroundColour");
        RealColor   BG    = settings.GetVariable <RealColor>("backgroundColour");

        if (!this.threadRunning)
        {
            this.threadRunning = true;
            ThreadPool.QueueUserWorkItem(this.Battery);
        }
        if (this.batteryStatus.isCharging == true)
        {
            FG = settings.GetVariable <RealColor>("chargingColour");
            BG = settings.GetVariable <RealColor>("chargingBGColour");
        }
        layer.PercentEffect(FG.GetDrawingColor(), BG.GetDrawingColor(), settings.GetVariable <KeySequence>("keys") ?? DefaultKeys, this.batteryStatus.percentage, 100D, PercentEffectType.Progressive_Gradual);
        return(layer);
    }
Example #7
0
    public object UpdateLights(VariableRegistry settings, IGameState state = null)
    {
        Queue <EffectLayer> layers = new Queue <EffectLayer>();

        EffectLayer layer = new EffectLayer(this.ID);

        layer.PercentEffect(Color.White, Color.Black, new KeySequence(new[] { DeviceKeys.F1, DeviceKeys.F2, DeviceKeys.F3, DeviceKeys.F4, DeviceKeys.F5, DeviceKeys.F6, DeviceKeys.F7, DeviceKeys.F8, DeviceKeys.F9, DeviceKeys.F10, DeviceKeys.F11, DeviceKeys.F12 }), DateTime.Now.Hour % 12D, 12D, PercentEffectType.Progressive);
        layers.Enqueue(layer);

        EffectLayer layer_2 = new EffectLayer(this.ID + " 2");

        layer_2.PercentEffect(Color.White, Color.Transparent, new KeySequence(new[] { DeviceKeys.NUM_ONE, DeviceKeys.NUM_TWO, DeviceKeys.NUM_THREE, DeviceKeys.NUM_FOUR, DeviceKeys.NUM_FIVE, DeviceKeys.NUM_SIX, DeviceKeys.NUM_SEVEN, DeviceKeys.NUM_EIGHT, DeviceKeys.NUM_NINE, DeviceKeys.NUM_ZERO }), DateTime.Now.Second % 10D, 10D, PercentEffectType.Progressive);
        //layers.Enqueue(layer_2);

        EffectLayer layer_3 = new EffectLayer(this.ID + " 3");

        layer_3.PercentEffect(Color.White, Color.Transparent, new KeySequence(new[] { DeviceKeys.ONE, DeviceKeys.TWO, DeviceKeys.THREE, DeviceKeys.FOUR, DeviceKeys.FIVE, DeviceKeys.SIX, DeviceKeys.SEVEN, DeviceKeys.EIGHT, DeviceKeys.NINE, DeviceKeys.ZERO }), DateTime.Now.Minute % 10f, 10D, PercentEffectType.Progressive);
        //layers.Enqueue(layer_3);

        EffectLayer layer_4 = new EffectLayer(this.ID + " 4");

        layer_4.PercentEffect(Color.FromArgb(200, 255, 0, 0), Color.Transparent, new KeySequence(new[] { DeviceKeys.ONE, DeviceKeys.TWO, DeviceKeys.THREE, DeviceKeys.FOUR, DeviceKeys.FIVE, DeviceKeys.SIX }), DateTime.Now.Minute % 60D, 60D, PercentEffectType.Progressive);
        //layers.Enqueue(layer_4);

        EffectLayer layer_5 = new EffectLayer(this.ID + " 5");

        layer_5.PercentEffect(Color.FromArgb(200, 255, 0, 0), Color.Transparent, new KeySequence(new[] { DeviceKeys.NUM_ONE, DeviceKeys.NUM_TWO, DeviceKeys.NUM_THREE, DeviceKeys.NUM_FOUR, DeviceKeys.NUM_FIVE, DeviceKeys.NUM_SIX }), DateTime.Now.Second % 60D, 60D, PercentEffectType.Progressive);
        //layers.Enqueue(layer_5);

        EffectLayer layer_sum34 = layer_3 + layer_4;

        layers.Enqueue(layer_sum34);

        EffectLayer layer_sum25 = layer_2 + layer_5;

        layers.Enqueue(layer_sum25);

        return(layers.ToArray());
    }
    public object UpdateLights(VariableRegistry settings, IGameState state = null)
    {
        Queue <EffectLayer> layers = new Queue <EffectLayer>();

        EffectLayer layer = new EffectLayer(this.ID);

        layer.PercentEffect(Color.Purple, Color.Green, new KeySequence(new[] { DeviceKeys.F12, DeviceKeys.F11, DeviceKeys.F10, DeviceKeys.F9, DeviceKeys.F8, DeviceKeys.F7, DeviceKeys.F6, DeviceKeys.F5, DeviceKeys.F4, DeviceKeys.F3, DeviceKeys.F2, DeviceKeys.F1 }), DateTime.Now.Second % 20D, 20D);
        layers.Enqueue(layer);

        EffectLayer layer_swirl = new EffectLayer(this.ID + " - Swirl");

        layer_swirl.PercentEffect(Color.Blue, Color.Black, new KeySequence(new[] { DeviceKeys.NUM_ONE, DeviceKeys.NUM_FOUR, DeviceKeys.NUM_SEVEN, DeviceKeys.NUM_EIGHT, DeviceKeys.NUM_NINE, DeviceKeys.NUM_SIX, DeviceKeys.NUM_THREE, DeviceKeys.NUM_TWO }), DateTime.Now.Millisecond % 500D, 500D, PercentEffectType.Progressive_Gradual);
        layers.Enqueue(layer_swirl);

        EffectLayer layer_blinking = new EffectLayer(this.ID + " - Blinking Light");

        ColorSpectrum blink_spec  = new ColorSpectrum(Color.Red, Color.Black, Color.Red);
        Color         blink_color = blink_spec.GetColorAt(DateTime.Now.Millisecond / 1000.0f);

        layer_blinking.Set(DeviceKeys.NUM_FIVE, blink_color);
        layers.Enqueue(layer_blinking);

        return(layers.ToArray());
    }
Example #9
0
 protected override void RegisterVariables(VariableRegistry variableRegistry)
 {
     variableRegistry.Register($"{DeviceName}_scalar_r", 100, "Red Scalar", 100, 0);
     variableRegistry.Register($"{DeviceName}_scalar_g", 100, "Green Scalar", 100, 0);
     variableRegistry.Register($"{DeviceName}_scalar_b", 100, "Blue Scalar", 100, 0, "In percent");
 }
Example #10
0
 protected override void RegisterVariables(VariableRegistry variableRegistry)
 {
     variableRegistry.Register($"{DeviceName}_query", false, "Query Razer devices", remark: "This is slow so it is disabled by default. Can be useful for debugging");
 }
Example #11
0
 protected override void RegisterVariables(VariableRegistry local)
 {
     local.Register($"{DeviceName}_devicekey", DeviceKeys.Peripheral, "Key to Use", DeviceKeys.MOUSEPADLIGHT15, DeviceKeys.Peripheral_Logo);
     local.Register($"{DeviceName}_disconnect_when_stop", false, "Disconnect when Stopping");
 }
Example #12
0
 public override void Default()
 {
     base.Default();
     _ScriptProperties = new VariableRegistry();
 }
Example #13
0
 public NodeIdentifier(string varName)
 {
     StoredValue    = VariableRegistry.Get(varName);
     IdentifierName = varName;
 }
Example #14
0
 /// <summary>
 /// Only called once when registering variables. Can be empty if not needed
 /// </summary>
 protected virtual void RegisterVariables(VariableRegistry local)
 {
     //purposefully empty, if varibles are needed, this should be overridden
 }
Example #15
0
 public VolumeScript()
 {
     ID         = "Volume Layer - Show every 10%";
     Properties = new VariableRegistry();
     //Create Properties
 }
Example #16
0
 protected virtual void RegisterVariables(VariableRegistry variableRegistry)
 {
 }
 public ExampleEffect()
 {
     ID         = "ExampleCSScript (Multi-Layer)";
     Properties = new VariableRegistry();
     //Create Properties
 }
Example #18
0
 protected override void RegisterVariables(VariableRegistry local)
 {
     local.Register($"{DeviceName}_devicekey", DeviceKeys.Peripheral, "Key to Use", DeviceKeys.MOUSEPADLIGHT15, DeviceKeys.Peripheral_Logo);
 }
Example #19
0
 public Clock()
 {
     ID         = "Clock Final (Multi-Layer)";
     Properties = new VariableRegistry();
     //Create Properties
 }