Esempio n. 1
0
 public void RemoveOperation(ParsedWorld world, ParsedOperation operation)
 {
     if (operation != null)
     {
         activeEvents.RemoveItem(operation.Id);
     }
 }
Esempio n. 2
0
        public Context1()
        {
            configWindow = new Form1();

            var configMenuItem = new MenuItem("Open", ShowConfig);
            var aboutMenuItem  = new MenuItem("About", ShowAbout);
            var exitMenuItem   = new MenuItem("Exit", Exit);

            voice = new SpeechSynthesizer();
            voice.SelectVoiceByHints(VoiceGender.Female);

            notifyIcon = new NotifyIcon
            {
                Icon        = System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Name),
                ContextMenu = new ContextMenu(new[] { configMenuItem, aboutMenuItem, exitMenuItem }),
                Visible     = true
            };

            notifyIcon.MouseDoubleClick += ShowConfig;

            client = new WarframeClient();

            world = new ParsedWorld();
            world.OnOperationStarted      += OnOperationStarted;
            world.OnOperationEnded        += OnOperationEnded;
            world.OnOperationsInitialized += OnOperationsInitialized;
            world.OnPopupMessage          += Popup;
            world.OnSpeakMessage          += Speak;
            world.OnLogMessage            += Log;

            OnLoadExtractors();
            configWindow.OnSaveExtractors += OnSaveExtractors;

            world.TitanExtractor.OnExtractorFinished      += OnTitanExtractorFinished;
            configWindow.titanExtractorBox.CheckedChanged += TitanExtractorCheckChanged;

            world.DistillingExtractor.OnExtractorFinished      += OnDistillingExtractorFinished;
            configWindow.distillingExtractorBox.CheckedChanged += DistillingExtractorCheckChanged;

            var secondTimer = new System.Timers.Timer();

            secondTimer.Elapsed += SecondTimer;
            secondTimer.Interval = 1000;
            secondTimer.Enabled  = true;

            var minuteTimer = new System.Timers.Timer();

            minuteTimer.Elapsed += MinuteTimer;
            minuteTimer.Interval = 60000;
            minuteTimer.Enabled  = true;

            Log("System", "Connecting...");
            RefreshWorldState();

            configWindow.Show();
        }
Esempio n. 3
0
 public void RefreshMainTab(ParsedWorld world)
 {
     this.SafeInvoke(() =>
     {
         RefreshExtractorLabel(world.TitanExtractor, titanExtractorTimerLabel);
         RefreshExtractorLabel(world.DistillingExtractor, distillingExtractorTimerLabel);
         RefreshWeeklyAbsoluteLabel(world.WeeklyTicker, weeklyTimerLabel);
         RefreshAbsoluteLabel(world.DailyTicker, dailyTimerLabel);
         RefreshAbsoluteLabel(world.MissionTicker, missionTimerLabel);
         RefreshCyclicLabel(world.CetusTicker, cetusDayTimerLabel, cetusNightTimerLabel);
         RefreshCyclicLabel(world.EarthTicker, earthDayTimerLabel, earthNightTimerLabel);
     });
 }
Esempio n. 4
0
        public void AddOperation(ParsedWorld world, ParsedOperation operation)
        {
            if (operation == null)
            {
                return;
            }

            if (operation.Relevant)
            {
                activeEvents.AddItemToBottom(new ActiveOperationListBoxItem(world, operation.Id));
            }

            loggedEvents.AddItemToTop(new LoggedOperationListBoxItem(operation));
        }
Esempio n. 5
0
        public ActiveOperationListBoxItem(ParsedWorld world, string id)
        {
            this.world = world;
            this.id    = id;

            UpdateOperation();

            if (operation == null)
            {
                return;
            }

            missionText = operation.Description(DescriptionType.Written);
            tag         = operation.Id;
            faded       = false;

            UpdateText();
        }