상속: IDisposable
예제 #1
0
파일: OrbitGraph.cs 프로젝트: BGog/GHud
        public OrbitGraph(Device dev, System.Drawing.Color orbpen_color, String orphanstr)
            : base(dev)
        {
            name = "Orbit Graph";
            selectable = false;
            active = false;

            orphan_string = orphanstr;

            if (orbpen_color == null)
                orbpen_color = System.Drawing.Color.Yellow;

            width = dev.width;
            height = dev.height;

            a = 0;

            // Define the rendering color of the various orbital bodies.
            body_colors = new Dictionary<string, System.Drawing.Color>();
            body_colors.Add("Sun", System.Drawing.Color.Yellow);
            body_colors.Add("Kerbol", System.Drawing.Color.Yellow);
            body_colors.Add("Moho", System.Drawing.Color.Peru);
            body_colors.Add("Eve", System.Drawing.Color.BlueViolet);
            body_colors.Add("Kerbin", System.Drawing.Color.DodgerBlue);
            body_colors.Add("Duna", System.Drawing.Color.Firebrick);
            body_colors.Add("Dres", System.Drawing.Color.Gray);
            body_colors.Add("Jool", System.Drawing.Color.LimeGreen);
            body_colors.Add("Eeloo", System.Drawing.Color.LightGray);
            body_colors.Add("Gilly", System.Drawing.Color.DarkGray);
            body_colors.Add("Mun", System.Drawing.Color.DarkGray);
            body_colors.Add("Minmus", System.Drawing.Color.Gray);
            body_colors.Add("Ike", System.Drawing.Color.DarkGray);
            body_colors.Add("Laythe", System.Drawing.Color.DodgerBlue);
            body_colors.Add("Vall", System.Drawing.Color.Gray);
            body_colors.Add("Tylo", System.Drawing.Color.LightGray);
            body_colors.Add("Bop", System.Drawing.Color.Gray);
            body_colors.Add("Pol", System.Drawing.Color.SandyBrown);
            body_colors.Add("Default", System.Drawing.Color.DodgerBlue);

            body_colors.TryGetValue("Pol", out body_color);

            orbitpen = new Pen(orbpen_color, 1.0f);
            orbitpen.Alignment = System.Drawing.Drawing2D.PenAlignment.Outset;
        }
예제 #2
0
파일: OrbitInfo.cs 프로젝트: BGog/GHud
        public OrbitInfo(Device dev, String argmon, 
                         System.Drawing.Color brect_c1, 
                         System.Drawing.Color brect_c2)
            : base(dev)
        {
            name = "Orbit";
            selectable = false;
            active = false;
            monicer = argmon;

            width = dev.width;
            height = dev.height;

            if(brect_c1 != null)
                back_rect_c1 = brect_c1;
            if (brect_c2 != null)
                back_rect_c2 = brect_c2;

            ResetBackRectBrush();
        }
예제 #3
0
파일: DisplayModule.cs 프로젝트: BGog/GHud
        public DisplayModule(Device argdev)
        {
            dev = argdev;
            name = "INVALID";
            selectable = false;
            active = false;
            curfont = null;

            modid = 0;

            font_pt = dev.font_pt;

            companion_mod = null;

            fmt_left.Alignment = StringAlignment.Near;
            fmt_left.LineAlignment = StringAlignment.Center;
            fmt_center.Alignment = StringAlignment.Center;
            fmt_center.LineAlignment = StringAlignment.Center;
            fmt_right.Alignment = StringAlignment.Far;
            fmt_right.LineAlignment = StringAlignment.Center;
        }
예제 #4
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);
        }
예제 #5
0
파일: VesselInfo.cs 프로젝트: BGog/GHud
        /*
        public override void SetOrbit(Orbit argorbit, String obj_name = "Unknown")
        {
            base.SetOrbit(argorbit, obj_name);

            List<DisplayModule> list = top_modules + bottom_modules;

            foreach (DisplayModule mod in list)
            {
                ITargetable tgt;
                if (mod.is_target_type_module)
                {
                    tgt = FlightGlobals.fetch.VesselTarget;
                    mod.SetOrbit(tgt == null ? null : tgt.GetOrbit(), tgt == null ? null : tgt.GetName());
                }
                else
                {
                    mod.SetOrbit(argorbit, obj_name);
                }
            }

        }
        */
        public void ButtonUp(Device dev)
        {
            if (!active)
                return;

            CycleModules(ref top_modules, ref bottom_modules, ref active_top_mod, ref active_bottom_mod, false);
        }
예제 #6
0
파일: VesselInfo.cs 프로젝트: BGog/GHud
 public void ButtonDown(Device dev)
 {
     if (!active)
         return;
     if (dev.is_color)
     {
         CycleModules(ref bottom_modules, ref top_modules, ref active_bottom_mod, ref active_top_mod, false);
     }
 }