~jamesbrashko/+junk/POGSdevel

« back to all changes in this revision

Viewing changes to POGS-Windows-UI/ChoosePlayerDialog.cs

  • Committer: Brashko
  • Date: 2008-04-28 09:53:43 UTC
  • Revision ID: james.brashko4ever@hotmail.com-20080428095343-kd3ytfust11coxls
upload windows UI

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Collections.Generic;
 
3
using System.ComponentModel;
 
4
using System.Data;
 
5
using System.Drawing;
 
6
using System.Text;
 
7
using System.Windows.Forms;
 
8
using POGS;
 
9
 
 
10
namespace POGS_Windows_UI
 
11
{
 
12
    public partial class ChoosePlayerDialog : Form
 
13
    {
 
14
        public ChoosePlayerDialog()
 
15
        {
 
16
            InitializeComponent();
 
17
        }
 
18
       
 
19
        public ChoosePlayerDialog(List<CharacterSlotInfo> l)
 
20
        {
 
21
            player = null;
 
22
            InitializeComponent();
 
23
            foreach (CharacterSlotInfo s in l)
 
24
            {
 
25
                listBox1.Items.Add(string.Format(s.SlotNumber.ToString() + "      " + s.Description));//populates the listbox with the character slot information
 
26
            };
 
27
 
 
28
        }
 
29
        private void Ok_Click(object sender, EventArgs e)
 
30
        {
 
31
           ChoosePlayerDialog.observing1 = false;
 
32
           ChoosePlayerDialog.player = listBox1.SelectedItem.ToString();
 
33
           ChoosePlayerDialog.playerindex = listBox1.SelectedIndex;//get the selected slot index and store it
 
34
           this.Hide();
 
35
        }
 
36
 
 
37
        public static int playerindex;
 
38
 
 
39
 
 
40
 
 
41
        private void ChoosePlayerDialog_Load(object sender, System.EventArgs e)
 
42
        {
 
43
 
 
44
        }
 
45
 
 
46
        private void Cancel_Click(object sender, EventArgs e)
 
47
        {
 
48
            ChoosePlayerDialog.observing1 = false; 
 
49
            this.Hide();
 
50
        }
 
51
 
 
52
        private void listBox1_SelectedIndexChanged_1(object sender, EventArgs e)
 
53
        {
 
54
 
 
55
        }
 
56
 
 
57
        internal void ChoosePlayerdialog(List<CharacterSlotInfo> l, PlayerSlotChosenCallback cb)
 
58
        {
 
59
            InitializeComponent();
 
60
            player = null;
 
61
 
 
62
        }
 
63
 
 
64
        private void Observe_Click(object sender, EventArgs e)
 
65
        {
 
66
            ChoosePlayerDialog.observing1 = true;
 
67
            player = "observer";
 
68
            this.Hide();
 
69
        }
 
70
 
 
71
        public static bool observing1;
 
72
        public static string player;
 
73
}
 
74
 
 
75
}
 
 
b'\\ No newline at end of file'