Inheritance: DisplayModule
示例#1
0
        public VesselInfo(Device dev) : base(dev)
        {
            name       = "Vessel";
            selectable = true;
            active     = false;

            width  = dev.width;
            height = dev.height;
            xoff   = 0;
            yoff   = 0;


            orbitinfo        = new OrbitInfo(dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44));
            target_orbitinfo = new OrbitInfo(dev, "+", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple);

            orbitgraph        = new OrbitGraph(dev, System.Drawing.Color.Yellow, "✈");
            target_orbitgraph = new OrbitGraph(dev, System.Drawing.Color.LightBlue, "+");

            orbitgraph.companion_mod = orbitinfo;
            orbitinfo.companion_mod  = orbitgraph;

            target_orbitinfo.is_target_type_module  = true;
            target_orbitgraph.is_target_type_module = true;
            target_orbitinfo.companion_mod          = target_orbitgraph;
            target_orbitgraph.companion_mod         = target_orbitinfo;

            orbitinfo.Activate();
            active_top_mod = orbitinfo;
            orbitgraph.Activate();
            active_bottom_mod = orbitgraph;

            orbitinfo.modid         = 1;
            target_orbitinfo.modid  = 2;
            orbitgraph.modid        = 3;
            target_orbitgraph.modid = 4;

            top_modules.Add(orbitinfo);
            top_modules.Add(target_orbitinfo);
            bottom_modules.Add(orbitgraph);
            bottom_modules.Add(target_orbitgraph);


            orbitinfo        = new OrbitInfo(dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44));
            target_orbitinfo = new OrbitInfo(dev, "+", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple);

            orbitgraph        = new OrbitGraph(dev, System.Drawing.Color.Yellow, "✈");
            target_orbitgraph = new OrbitGraph(dev, System.Drawing.Color.LightBlue, "+");

            orbitgraph.companion_mod = orbitinfo;
            orbitinfo.companion_mod  = orbitgraph;

            target_orbitinfo.is_target_type_module  = true;
            target_orbitgraph.is_target_type_module = true;
            target_orbitinfo.companion_mod          = target_orbitgraph;
            target_orbitgraph.companion_mod         = target_orbitinfo;

            orbitinfo.modid         = 1;
            target_orbitinfo.modid  = 2;
            orbitgraph.modid        = 3;
            target_orbitgraph.modid = 4;

            bottom_modules.Add(orbitinfo);
            bottom_modules.Add(target_orbitinfo);
            top_modules.Add(orbitgraph);
            top_modules.Add(target_orbitgraph);

            if (dev.use_backdrops)
            {
                background = Image.FromFile("stars.gif");
            }

            colmatrix          = new System.Drawing.Imaging.ColorMatrix();
            colmatrix.Matrix33 = 0.7F;
            img_attr           = new System.Drawing.Imaging.ImageAttributes();
            img_attr.SetColorMatrix(colmatrix, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap);

            dev.ButtonUP   += new Device.ButtonHandler(ButtonUp);
            dev.ButtonDOWN += new Device.ButtonHandler(ButtonDown);
        }
示例#2
0
文件: VesselInfo.cs 项目: BGog/GHud
        public VesselInfo(Device dev)
            : base(dev)
        {
            name = "Vessel";
            selectable = true;
            active = false;

            width = dev.width;
            height = dev.height;
            xoff = 0;
            yoff = 0;

            orbitinfo = new OrbitInfo(dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44));
            target_orbitinfo = new OrbitInfo(dev, "+", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple);

            orbitgraph = new OrbitGraph(dev, System.Drawing.Color.Yellow, "✈");
            target_orbitgraph = new OrbitGraph(dev, System.Drawing.Color.LightBlue, "+");

            orbitgraph.companion_mod = orbitinfo;
            orbitinfo.companion_mod = orbitgraph;

            target_orbitinfo.is_target_type_module = true;
            target_orbitgraph.is_target_type_module = true;
            target_orbitinfo.companion_mod = target_orbitgraph;
            target_orbitgraph.companion_mod = target_orbitinfo;

            orbitinfo.Activate();
            active_top_mod = orbitinfo;
            orbitgraph.Activate();
            active_bottom_mod = orbitgraph;

            orbitinfo.modid = 1;
            target_orbitinfo.modid = 2;
            orbitgraph.modid = 3;
            target_orbitgraph.modid = 4;

            top_modules.Add(orbitinfo);
            top_modules.Add(target_orbitinfo);
            bottom_modules.Add(orbitgraph);
            bottom_modules.Add(target_orbitgraph);

            orbitinfo = new OrbitInfo(dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44));
            target_orbitinfo = new OrbitInfo(dev, "+", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple);

            orbitgraph = new OrbitGraph(dev, System.Drawing.Color.Yellow, "✈");
            target_orbitgraph = new OrbitGraph(dev, System.Drawing.Color.LightBlue, "+");

            orbitgraph.companion_mod = orbitinfo;
            orbitinfo.companion_mod = orbitgraph;

            target_orbitinfo.is_target_type_module = true;
            target_orbitgraph.is_target_type_module = true;
            target_orbitinfo.companion_mod = target_orbitgraph;
            target_orbitgraph.companion_mod = target_orbitinfo;

            orbitinfo.modid = 1;
            target_orbitinfo.modid = 2;
            orbitgraph.modid = 3;
            target_orbitgraph.modid = 4;

            bottom_modules.Add(orbitinfo);
            bottom_modules.Add(target_orbitinfo);
            top_modules.Add(orbitgraph);
            top_modules.Add(target_orbitgraph);

            if(dev.use_backdrops)
                background = Image.FromFile("stars.gif");

            colmatrix = new System.Drawing.Imaging.ColorMatrix();
            colmatrix.Matrix33 = 0.7F;
            img_attr = new System.Drawing.Imaging.ImageAttributes();
            img_attr.SetColorMatrix(colmatrix, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap);

            dev.ButtonUP += new Device.ButtonHandler(ButtonUp);
            dev.ButtonDOWN += new Device.ButtonHandler(ButtonDown);
        }
示例#3
0
        public void Awake()
        {
            if (GHudmain != null)
            {
                return;
            }
            GHudmain = this;
            UnityEngine.Object.DontDestroyOnLoad(GHudmain);

            if (!lcd_initialized)
            {
                DMcLgLCD.LcdInit();
                lcd_initialized = true;
            }

            Device bw_dev    = new DeviceBW();
            Device color_dev = new DeviceQVGA();

            if (bw_dev != null && bw_dev.isValid())
            {
                devices.Add(bw_dev);
                OrbitInfo initialbw = new OrbitInfo(bw_dev, "✈", System.Drawing.Color.Black, System.Drawing.Color.Black);
                initialbw.Activate();
                bw_dev.modules.Add(initialbw);


                OrbitInfo targetinfo = new OrbitInfo(bw_dev, "+", System.Drawing.Color.Black, System.Drawing.Color.Black);
                targetinfo.is_target_type_module = true;
                bw_dev.modules.Add(targetinfo);

                bw_dev.modules.Add(new OrbitGraph(bw_dev, System.Drawing.Color.Yellow, "✈"));
                OrbitGraph tgt_orbitgraph = new OrbitGraph(bw_dev, System.Drawing.Color.Yellow, "+");
                tgt_orbitgraph.is_target_type_module = true;
                bw_dev.modules.Add(tgt_orbitgraph);
            }

            if (color_dev != null && color_dev.isValid())
            {
                devices.Add(color_dev);
                VesselInfo initialcolor = new VesselInfo(color_dev);
                initialcolor.Activate();
                color_dev.modules.Add(initialcolor);
                //color_dev.modules.Add(new OrbitInfo(color_dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44)));

                /*
                 * OrbitInfo col_targetinfo = new OrbitInfo(color_dev, "⊹", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple);
                 * col_targetinfo.is_target_type_module = true;
                 * color_dev.modules.Add(col_targetinfo);
                 */
                color_dev.modules.Add(new OrbitGraph(color_dev, System.Drawing.Color.Yellow, "✈"));
                OrbitGraph tgt_orbitgraph = new OrbitGraph(color_dev, System.Drawing.Color.LightBlue, "+");
                tgt_orbitgraph.is_target_type_module = true;
                color_dev.modules.Add(tgt_orbitgraph);
            }

            foreach (Device dev in devices)
            {
                dev.ButtonUP     += new Device.ButtonHandler(ButtonUp);
                dev.ButtonDOWN   += new Device.ButtonHandler(ButtonDown);
                dev.ButtonLEFT   += new Device.ButtonHandler(ButtonLeft);
                dev.ButtonRIGHT  += new Device.ButtonHandler(ButtonRight);
                dev.ButtonOK     += new Device.ButtonHandler(ButtonOk);
                dev.ButtonCANCEL += new Device.ButtonHandler(ButtonCancel);
                dev.ButtonMENU   += new Device.ButtonHandler(ButtonMenu);

                dev.DisplayFrame();
            }
        }