aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/FinalMission/QuestViewer.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-05-17 15:37:02 -0400
committerMichaelTheShifter <[email protected]>2016-05-17 15:37:02 -0400
commita3fc2c45ec2a62684e128ffd7cab88bd101ad917 (patch)
tree1dc63efaa4597a28fd901047a714f38954dafa5e /source/WindowsFormsApplication1/FinalMission/QuestViewer.cs
parent0085241d2366f266b5416488dbead174184420b0 (diff)
downloadshiftos-c--a3fc2c45ec2a62684e128ffd7cab88bd101ad917.tar.gz
shiftos-c--a3fc2c45ec2a62684e128ffd7cab88bd101ad917.tar.bz2
shiftos-c--a3fc2c45ec2a62684e128ffd7cab88bd101ad917.zip
Committing all I've got
Committing everything I've got - so that I can take a break for a few months and work on other things.
Diffstat (limited to 'source/WindowsFormsApplication1/FinalMission/QuestViewer.cs')
-rw-r--r--source/WindowsFormsApplication1/FinalMission/QuestViewer.cs63
1 files changed, 63 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/FinalMission/QuestViewer.cs b/source/WindowsFormsApplication1/FinalMission/QuestViewer.cs
new file mode 100644
index 0000000..3b447f9
--- /dev/null
+++ b/source/WindowsFormsApplication1/FinalMission/QuestViewer.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS.FinalMission
+{
+ public partial class QuestViewer : Form
+ {
+ public QuestViewer()
+ {
+ InitializeComponent();
+ }
+
+ private void QuestViewer_Load(object sender, EventArgs e)
+ {
+ SetupList();
+ StartQuestCheckThread();
+ var tmr = new System.Windows.Forms.Timer();
+ tmr.Interval = 500;
+ tmr.Tick += (object s, EventArgs a) =>
+ {
+ SetupList();
+ };
+ tmr.Start();
+ }
+
+ public void SetupList()
+ {
+ lbobjectives.Items.Clear();
+ foreach(var itm in EndGameHandler.ThingsToDo)
+ {
+ lbobjectives.Items.Add(itm.Key);
+ }
+ }
+
+ public void StartQuestCheckThread()
+ {
+ var t = new Thread(new ThreadStart(new Action(() => {
+ //Start checkloop.
+ while(true)
+ {
+ CheckObjective(EndGameHandler.CurrentObjective);
+ }
+ })));
+ t.Start();
+ }
+
+ public void CheckObjective(string obj)
+ {
+ if(EndGameHandler.ThingsToDo[obj] == true)
+ {
+ EndGameHandler.GoToNextObjective();
+ }
+ }
+ }
+}