public OrbitIcon(IMapIcon mapIcon, MapTab mapTab)
        {
            this.mapIcon = mapIcon;
            this.mapTab  = mapTab;
            InitializeComponent();
            ParentIcon = mapIcon.ParentIcon;

            maxOrbitRadius = mapIcon.Body.Children.Max(c => c.OrbitDistance) * MapTab.MapScale;

            foreach (var child in mapIcon.Body.Children)
            {
                var orbitRadius = child.OrbitDistance;
                var ellipse     = new Ellipse();
                ellipse.Stroke          = new SolidColorBrush(Colors.White);
                ellipse.StrokeThickness = strokeSize / mapTab.ZoomControl.Zoom;
                Canvas.SetLeft(ellipse, maxOrbitRadius - child.OrbitDistance * MapTab.MapScale);
                Canvas.SetTop(ellipse, maxOrbitRadius - child.OrbitDistance * MapTab.MapScale);
                ellipse.Width  = orbitRadius * 2 * MapTab.MapScale;
                ellipse.Height = orbitRadius * 2 * MapTab.MapScale;
                LayoutRoot.Children.Add(ellipse);
            }

            Canvas.SetZIndex(this, -1);

            if (mapIcon.Body.OrbitNestingLevel == 0)
            {
                // orbit doesn't move, just set the position once
                Canvas.SetLeft(this, mapIcon.X - maxOrbitRadius);
                Canvas.SetTop(this, mapIcon.Y - maxOrbitRadius);
            }

            Update();
        }
Esempio n. 2
0
 public static void SetupObjects()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(MainLevel.Instance);
     SaveGame.m_Objects.Add(Scenario.Get());
     SaveGame.m_Objects.Add(AIManager.Get());
     SaveGame.m_Objects.Add(TriggersManager.Get());
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(SensorManager.Get());
     SaveGame.m_Objects.Add(ConstructionGhostManager.Get());
     SaveGame.m_Objects.Add(StaticObjectsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(ObjectivesManager.Get());
     SaveGame.m_Objects.Add(HUDObjectives.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(Music.Get());
     SaveGame.m_Objects.Add(RainManager.Get());
     SaveGame.m_Objects.Add(BalanceSystem.Get());
 }
Esempio n. 3
0
            public void AddContextMenuItems(MapTab tab, ContextMenuStrip menu)
            {
                var myItem           = new ToolStripMenuItem(ToString());
                var copyPositionItem = new ToolStripMenuItem("Copy Position");

                copyPositionItem.Click += (_, __) =>
                {
                    CopyUtilities.CopyPosition(GetPosition());
                };
                myItem.DropDownItems.Add(copyPositionItem);

                var pastePositionItem = new ToolStripMenuItem("Paste Position");

                pastePositionItem.Click += (_, __) =>
                {
                    if (CopyUtilities.TryPastePosition(out Vector3 v))
                    {
                        SetPosition(v);
                    }
                };
                myItem.DropDownItems.Add(pastePositionItem);

                if (tab.graphics.view.mode != MapView.ViewMode.TopDown)
                {
                    var pivotItem = new ToolStripMenuItem("Make Pivot Point");
                    pivotItem.Click += (_, __) => Pivot(tab);
                    myItem.DropDownItems.Add(pivotItem);
                }
                menu.Items.Add(myItem);
            }
        }
Esempio n. 4
0
            public void AddContextMenuItems(MapTab tab, ContextMenuStrip menu)
            {
                var myItem = new ToolStripMenuItem($"{triangle.Classification} Triangle 0x{triangle.Address.ToString("x8")}");

                var itemCopyTriangleAddress = new ToolStripMenuItem("Copy Triangle Address");

                itemCopyTriangleAddress.Click += (_, __) =>
                {
                    if (triangle != null)
                    {
                        Clipboard.SetText($"0x{triangle.Address.ToString("x8")}");
                    }
                };
                myItem.DropDownItems.Add(itemCopyTriangleAddress);

                var itemCopyPosition = new ToolStripMenuItem("Copy Position");

                itemCopyPosition.Click += (_, __) =>
                {
                    if (triangle != null)
                    {
                        if (tab.graphics.view.mode == MapView.ViewMode.TopDown)
                        {
                            float y = triangle.IsWall() ? mapCursorOnRightClick.Y : (float)triangle.GetHeightOnTriangle(mapCursorOnRightClick.X, mapCursorOnRightClick.Z);
                            CopyUtilities.CopyPosition(new Vector3(mapCursorOnRightClick.X, y, mapCursorOnRightClick.Z));
                        }
                    }
                };
                myItem.DropDownItems.Add(itemCopyPosition);

                menu.Items.Add(myItem);
            }
        public PlanetIcon(CelestialObject planet, IMapIcon parentIcon, MapTab mapTab)
        {
            this.mapTab = mapTab;
            InitializeComponent();
            ParentIcon = parentIcon;
            Body       = planet;
            Canvas.SetZIndex(this, planet.Size);
            Label.Text     = planet.Name;
            Ellipse.Width  = Body.Size;
            Ellipse.Height = Body.Size;
            Ellipse.Fill   = Body.Brush;

            /*for (var i = 0; i < Body.MetalDensity*3; i++) {
             *  MetalPanel.Children.Add(new Ellipse { Width = 5, Height = 5, Fill = new SolidColorBrush(Colors.Gray), Margin = new Thickness(1) });
             * }
             * for (var i = 0; i < Body.FoodDensity*3; i++) {
             *  FoodPanel.Children.Add(new Ellipse { Width = 5, Height = 5, Fill = new SolidColorBrush(Colors.Green), Margin = new Thickness(1) });
             * }
             * for (var i = 0; i < Body.DarkMatterDensity*3; i++) {
             *  DarkMatterPanel.Children.Add(new Ellipse
             *                                   { Width = 5, Height = 5, Fill = new SolidColorBrush(Colors.Brown), Margin = new Thickness(1) });
             * }
             * for (var i = 0; i < Body.QuantiumDensity*3; i++) {
             *  QuantumPanel.Children.Add(new Ellipse { Width = 5, Height = 5, Fill = new SolidColorBrush(Colors.Purple), Margin = new Thickness(1) });
             * }
             * InfoText.Text = MakeDescription();
             * if (App.Player != null && Body.OwnerID != App.Player.PlayerID) {
             *  Structures.IsEnabled = false;
             *  Ships.IsEnabled = false;
             * }*/
        }
Esempio n. 6
0
 public static void SetupObjects()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(DifficultySettings.Get());
     SaveGame.m_Objects.Add(DialogsManager.Get());
     SaveGame.m_Objects.Add(AIManager.Get());
     SaveGame.m_Objects.Add(EnemyAISpawnManager.Get());
     SaveGame.m_Objects.Add(TriggersManager.Get());
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(SensorManager.Get());
     SaveGame.m_Objects.Add(ConstructionGhostManager.Get());
     SaveGame.m_Objects.Add(StaticObjectsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(ObjectivesManager.Get());
     SaveGame.m_Objects.Add(StoryObjectivesManager.Get());
     SaveGame.m_Objects.Add(HUDObjectives.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(Music.Get());
     SaveGame.m_Objects.Add(RainManager.Get());
     SaveGame.m_Objects.Add(SleepController.Get());
     SaveGame.m_Objects.Add(MainLevel.Instance);
     SaveGame.m_Objects.Add(ScenarioManager.Get());
     SaveGame.m_Objects.Add(InventoryBackpack.Get());
     SaveGame.m_Objects.Add(ReplicatedSessionState.Get());
 }
Esempio n. 7
0
            public void AddContextMenuItems(MapTab tab, ContextMenuStrip menu)
            {
                var myItem           = new ToolStripMenuItem("Tape Measure");
                var copyPositionItem = new ToolStripMenuItem("Copy Position");

                copyPositionItem.Click += (_, __) =>
                {
                    Vector2 src = dragA ? parent.a : parent.b;
                    CopyUtilities.CopyPosition(new Vector3(src.X, cursorY, src.Y));
                };
                myItem.DropDownItems.Add(copyPositionItem);

                var pastePositionItem = new ToolStripMenuItem("Paste Position");

                pastePositionItem.Click += (_, __) =>
                {
                    if (CopyUtilities.TryPastePosition(out Vector3 textVector))
                    {
                        if (dragA)
                        {
                            parent.a = new Vector2(textVector.X, textVector.Z);
                        }
                        else
                        {
                            parent.b = new Vector2(textVector.X, textVector.Z);
                        }
                    }
                };
                myItem.DropDownItems.Add(pastePositionItem);
                menu.Items.Add(myItem);
            }
        }
Esempio n. 8
0
 public override void Pivot(MapTab tab)
 {
     if (currentPositionAngle == null)
     {
         return;
     }
     tab.graphics.view.camera3DMode       = MapView.Camera3DMode.FocusOnPositionAngle;
     tab.graphics.view.focusPositionAngle = currentPositionAngle;
 }
 public override void InitSubTrackerContextMenuStrip(MapTab mapTab, ContextMenuStrip targetStrip)
 {
     base.InitSubTrackerContextMenuStrip(mapTab, targetStrip);
     MapObjectObject.AddObjectSubTrackers(tracker,
                                          _objName,
                                          targetStrip,
                                          () => Config.StroopMainForm.ObjectSlotsManager.GetLoadedObjectsWithPredicate(predicate).ConvertAll(obj => PositionAngle.Obj(obj.Address))
                                          );
 }
Esempio n. 10
0
        public override void InitSubTrackerContextMenuStrip(MapTab mapTab, ContextMenuStrip targetStrip)
        {
            base.InitSubTrackerContextMenuStrip(mapTab, targetStrip);

            targetStrip.Items.AddHandlerToItem("Add Tracker for Angle",
                                               tracker.MakeCreateTrackerHandler(mapTab, "CustomAngle", () => new MapArrowObject(
                                                                                    positionAngleProvider,
                                                                                    _ => _.Angle,
                                                                                    MapArrowObject.ArrowSource.Constant(1),
                                                                                    $"Angle")));
        }
 public TransitIcon(Transit transit, MapTab mapTab)
 {
     this.transit = transit;
     this.mapTab  = mapTab;
     InitializeComponent();
     Arrow.Width  = 20; //todo: optimization: make the path already have the right size
     Arrow.Height = 20;
     Canvas.SetZIndex(this, 1000);
     Canvas.SetZIndex(PlottedRouteLine, -2);
     Canvas.SetZIndex(PlaceOrderLine, -1);
     DataContext = transit;
 }
Esempio n. 12
0
            public void AddContextMenuItems(MapTab tab, ContextMenuStrip menu)
            {
                var myItem           = new ToolStripMenuItem("Drawing");
                var clearDrawingItem = new ToolStripMenuItem("Clear");

                clearDrawingItem.Click += (_, __) => parent.ClearDrawing();
                myItem.DropDownItems.Add(clearDrawingItem);

                var stopDrawingItem = new ToolStripMenuItem("Stop Drawing");

                stopDrawingItem.Click += (_, __) => parent.drawingEnabled = false;
                myItem.DropDownItems.Add(stopDrawingItem);
                menu.Items.Add(myItem);
            }
Esempio n. 13
0
 public static void SetupObjectsCoop()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(SleepController.Get());
     SaveGame.m_Objects.Add(DifficultySettings.Get());
     SaveGame.m_Objects.Add(InventoryBackpack.Get());
 }
Esempio n. 14
0
 public void OnDebug()
 {
     Player.Get().UnlockMap();
     Player.Get().UnlockNotepad();
     Player.Get().UnlockWatch();
     ItemsManager.Get().UnlockAllItemsInNotepad();
     PlayerDiseasesModule.Get().UnlockAllDiseasesInNotepad();
     PlayerDiseasesModule.Get().UnlockAllDiseasesTratmentInNotepad();
     PlayerDiseasesModule.Get().UnlockAllSymptomsInNotepad();
     PlayerDiseasesModule.Get().UnlockAllSymptomTreatmentsInNotepad();
     PlayerInjuryModule.Get().UnlockAllInjuryState();
     PlayerInjuryModule.Get().UnlockAllInjuryStateTreatment();
     MapTab.Get().UnlockAll();
     MainLevel.Instance.m_GameMode     = GameMode.Debug;
     GreenHellGame.Instance.m_GameMode = GameMode.None;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
 }
Esempio n. 15
0
        public StarIcon(CelestialObject star, MapTab mapTab)
        {
            this.mapTab = mapTab;
            if (star.CelestialObjectType != CelestialObjectType.Star)
            {
                throw new Exception("body not star");
            }

            InitializeComponent();
            Body       = star;
            Label.Text = star.Name;
            Canvas.SetZIndex(this, 30);
            X              = Body.X * MapTab.MapScale;
            Y              = Body.Y * MapTab.MapScale;
            Ellipse.Fill   = Body.Brush;
            Ellipse.Width  = Body.Size;
            Ellipse.Height = Body.Size;
            Update();
        }
Esempio n. 16
0
        public LinkIcon(CelestialObject starA, CelestialObject starB, MapTab mapTab)
        {
            this.mapTab = mapTab;
            InitializeComponent();

            var left = Math.Min(starA.X, starB.X) * MapTab.MapScale;
            var top  = Math.Min(starB.Y, starA.Y) * MapTab.MapScale;

            Line.X1 = starA.X * MapTab.MapScale - left;
            Line.Y1 = starA.Y * MapTab.MapScale - top;
            Line.X2 = starB.X * MapTab.MapScale - left;
            Line.Y2 = starB.Y * MapTab.MapScale - top;

            Canvas.SetLeft(this, left);
            Canvas.SetTop(this, top);
            Canvas.SetZIndex(this, -10);

            Update();
        }
Esempio n. 17
0
    private static void UnlockPois()
    {
        var mapTab = MapTab.Get();

        if (mapTab == null)
        {
            Debug.Log(string.Format("{0}: Places of interest could not be unlocked.", ModName));
            return;
        }

        foreach (var map in mapTab.m_MapDatas)
        {
            foreach (var mapElement in map.Value.m_Elemets)
            {
                mapTab.UnlockElement(mapElement.name);
            }
        }

        Debug.Log(string.Format("{0}: Places of interest unlocked.", ModName));
    }
Esempio n. 18
0
        public static void AddObjectSubTrackers(MapTracker tracker, string name, ContextMenuStrip targetStrip, PositionAngleProvider positionAngleProvider)
        {
            MapTab mapTab        = tracker.mapTab;
            var    cylindersItem = new ToolStripMenuItem("Cylinders");

            cylindersItem.DropDownItems.AddHandlerToItem("Add Tracker for Hitbox Cylinders",
                                                         tracker.MakeCreateTrackerHandler(mapTab, "HitboxCylinders", () => new MapObjectCylinderObject(
                                                                                              positionAngleProvider,
                                                                                              MapObjectCylinderObject.Dimensions.HitBox,
                                                                                              "Hitbox Cylinders")));

            cylindersItem.DropDownItems.AddHandlerToItem("Add Tracker for Effective Hitbox Cylinders",
                                                         tracker.MakeCreateTrackerHandler(mapTab, "EffectiveHitboxCylinders", () => new MapObjectCylinderObject(
                                                                                              positionAngleProvider,
                                                                                              MapObjectCylinderObject.Dimensions.EffectiveHitBox,
                                                                                              "Effective Hitbox Cylinders")));

            cylindersItem.DropDownItems.AddHandlerToItem("Add Tracker for Hurtbox Cylinders",
                                                         tracker.MakeCreateTrackerHandler(mapTab, "HurtboxCylinders", () => new MapObjectCylinderObject(
                                                                                              positionAngleProvider,
                                                                                              MapObjectCylinderObject.Dimensions.HurtBox,
                                                                                              "Hurtbox Cylinders")));

            cylindersItem.DropDownItems.AddHandlerToItem("Add Tracker for Effective Hurtbox Cylinders",
                                                         tracker.MakeCreateTrackerHandler(mapTab, "EffectiveHurtboxCylinders", () => new MapObjectCylinderObject(
                                                                                              positionAngleProvider,
                                                                                              MapObjectCylinderObject.Dimensions.EffectiveHitBox,
                                                                                              "Effective Hurtbox Cylinders")));

            cylindersItem.DropDownItems.AddHandlerToItem("Add Tracker for Custom Cylinders",
                                                         () =>
            {
                Func <MapObject> genObject = () =>
                {
                    var customCylinderObject = new MapObjectCylinderObject(
                        positionAngleProvider,
                        null,
                        "Custom Cylinders");
                    customCylinderObject.getDimensions = MapObjectCylinderObject.Dimensions.CustomSize(() => (customCylinderObject.Size, 0, 100));
                    return(customCylinderObject);
                };
Esempio n. 19
0
        public override void InitSubTrackerContextMenuStrip(MapTab mapTab, ContextMenuStrip targetStrip)
        {
            base.InitSubTrackerContextMenuStrip(mapTab, targetStrip);

            var anglesItem = targetStrip.Items.GetSubItem("Angles");

            anglesItem.DropDownItems.AddHandlerToItem("Add Tracker for Mario Facing Angle",
                                                      tracker.MakeCreateTrackerHandler(mapTab, "MarioFacingAngle", () => new MapArrowObject(
                                                                                           positionAngleProvider,
                                                                                           MapArrowObject.ArrowSource.MarioFacingYaw,
                                                                                           MapArrowObject.ArrowSource.MarioHSpeed,
                                                                                           $"Mario Facing Angle")));

            anglesItem.DropDownItems.AddHandlerToItem("Add Tracker for Mario Intended Angle",
                                                      tracker.MakeCreateTrackerHandler(mapTab, "MarioIntendedAngle", () => new MapArrowObject(
                                                                                           positionAngleProvider,
                                                                                           MapArrowObject.ArrowSource.MarioIndendedYaw,
                                                                                           MapArrowObject.ArrowSource.MarioHSpeed,
                                                                                           $"Mario Intended Angle")));

            anglesItem.DropDownItems.AddHandlerToItem("Add Tracker for Mario Moving Angle",
                                                      tracker.MakeCreateTrackerHandler(mapTab, "MarioMovingAngle", () => new MapArrowObject(
                                                                                           positionAngleProvider,
                                                                                           MapArrowObject.ArrowSource.MarioMovingYaw,
                                                                                           MapArrowObject.ArrowSource.MarioHSpeed,
                                                                                           $"Mario Moving Angle")));

            anglesItem.DropDownItems.AddHandlerToItem("Add Tracker for Mario Sliding Angle",
                                                      tracker.MakeCreateTrackerHandler(mapTab, "MarioSlidingAngle", () => new MapArrowObject(
                                                                                           positionAngleProvider,
                                                                                           MapArrowObject.ArrowSource.MarioSlidingYaw,
                                                                                           MapArrowObject.ArrowSource.MarioSlidingSpeed,
                                                                                           $"Mario Sliding Angle")));

            anglesItem.DropDownItems.AddHandlerToItem("Add Tracker for Mario Twirling Angle",
                                                      tracker.MakeCreateTrackerHandler(mapTab, "MarioTwirlingAngle", () => new MapArrowObject(
                                                                                           positionAngleProvider,
                                                                                           MapArrowObject.ArrowSource.MarioTwirlingYaw,
                                                                                           MapArrowObject.ArrowSource.MarioHSpeed,
                                                                                           $"Mario Twirling Angle")));
        }
Esempio n. 20
0
    // Use this for initialization
    void Start()
    {
        GeoGraph[] maps = this.GetComponentsInChildren <GeoGraph> (true);
        foreach (GeoGraph i in maps)
        {
            if (i.CompareTag("china"))
            {
                m_Map0 = i;
            }
            else if (i.CompareTag("beijing"))
            {
                m_Map1 = i;
            }
        }
        TabChanged += m_Map0.OnTabChanged;
        TabChanged += m_Map1.OnTabChanged;

        ShowMap(MapType.MapChina);          // display China map on startup, it's directed graph.

        s_instance = this;
    }
Esempio n. 21
0
    private static void ActivateMap()
    {
        var mapTab = MapTab.Get();

        if (mapTab == null || mapTab.m_MapDatas.Count == 0)
        {
            Debug.Log(string.Format("{0}: Map could not be unlocked.", ModName));
            return;
        }

        foreach (var map in mapTab.m_MapDatas)
        {
            if (map.Value.m_Unlocked)
            {
                continue;
            }

            mapTab.UnlockPage(map.Key);
        }

        Debug.Log(string.Format("{0}: Map unlocked.", ModName));
    }
Esempio n. 22
0
        private void EditorForm_Load(object sender, EventArgs e)
        {
            Program.Debug.Show();
            if (Program.Start.ShowDialog(this) != DialogResult.OK)
            {
                this.Close();
                return;
            }

            this.overview  = new OverviewTab(this);
            this.screen    = new ScreenTab(this);
            this.map       = new MapTab(this);
            this.cutscenes = new CutscenesTab(this);
            this.tilesets  = new TilesetsTab(this);
            this.gradients = new GradientsTab(this);
            this.music     = new MusicTab(this);
            this.ambiance  = new AmbianceTab(this);
            this.objects   = new ObjectsTab(this);
            this.worldIni  = new WorldIniTab(this);

            StoryChanged();
        }
Esempio n. 23
0
 public virtual void Pivot(MapTab tab)
 {
     tab.graphics.view.camera3DMode       = MapView.Camera3DMode.FocusOnPositionAngle;
     tab.graphics.view.focusPositionAngle = PositionAngle.Custom(GetPosition(), 0);
 }