Exemplo n.º 1
0
        public static void setActiveFactions(StarSystem system)
        {
            if (WIIC.settings.ignoreFactions.Contains(system.OwnerValue.Name))
            {
                return;
            }

            _fieldSetContractEmployers.SetValue(system.Def, WhoAndWhere.getEmployers(system));
            _fieldSetContractTargets.SetValue(system.Def, WhoAndWhere.getTargets(system));
        }
Exemplo n.º 2
0
        private static void Prefix()
        {
            try {
                var timelineWidget = (TaskTimelineWidget)_getTimelineWidget.GetValue(WIIC.sim.RoomManager);
                var activeItems    = (Dictionary <WorkOrderEntry, TaskManagementElement>)_getActiveItems.GetValue(timelineWidget);

                Utilities.slowDownFloaties();
                ColourfulFlashPoints.Main.clearMapMarkers();

                // ToList is used to make a copy because we may need to remove elements as we're iterating
                foreach (Flareup flareup in WIIC.flareups.Values.ToList())
                {
                    bool finished = flareup.passDay();
                    if (finished)
                    {
                        WIIC.cleanupSystem(flareup.location);
                    }
                    else
                    {
                        if (activeItems.TryGetValue(flareup.workOrder, out var taskManagementElement))
                        {
                            taskManagementElement.UpdateItem(0);
                        }
                    }
                }

                WhoAndWhere.checkForNewFlareup();

                if (Utilities.deferredToasts.Count > 0)
                {
                    foreach (var toast in Utilities.deferredToasts)
                    {
                        WIIC.sim.RoomManager.ShipRoom.AddEventToast(new Text(toast));
                    }
                    Utilities.deferredToasts.Clear();
                }

                Utilities.redrawMap();

                WIIC.sim.RoomManager.RefreshTimeline(false);
            } catch (Exception e) {
                WIIC.modLog.Error?.Write(e);
            }
        }
Exemplo n.º 3
0
 public static void FinishedLoading()
 {
     WhoAndWhere.init();
 }