示例#1
0
        public MainForm()
        {
            InitializeComponent();     // The InitializeComponent() call is required for Windows Forms designer support.
            InitDisplay();             //Set se Resolution
            EstablishConnection();

            Map      = new Map();
            SideMenu = new SideMenu();

            //Map
            this.Controls.Add(Map.FrameLabel);
            Map.FrameLabel.BringToFront();
            Map.FrameLabel.MouseUp   += OnMoveMap;
            Map.FrameLabel.MouseDown += OnMoveMap;
            Map.RedrawImage();
            //Places
            Places = new Locations(SendMoveRequest);
            InitControlGroup(Places.Menu);
            foreach (Place p in Places.AllPlaces.Values)
            {
                this.Controls.Add(p.ClickLabel);
                p.ClickLabel.Parent = Map.FrameLabel;
                p.ClickLabel.BringToFront();
            }
            OnMoveMap(Map.FrameLabel, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
            Map.FrameLabel.MouseDown += delegate
            {
                foreach (Place p in Places.AllPlaces.Values)
                {
                    p.ClickLabel.Visible = false;
                }
            };

            //Players
            UpdatePlayerLocation();

            //Sidemenu
            InitControlGroup(SideMenu);
            SideMenu.Visible = true;
            foreach (RelativeLabel c in SideMenu.Controls)
            {
                c.Click += SideMenuButtonClick;
            }
            InitControlGroup(SideMenu.LogMenu);

            //FIXME: debug... REMOVE!
            Quests[0] = new Quest("Quest 1", new int[2] {
                1, 2
            }, new Resources(2, 3, 1, 4), 2, 3, new Item[0]);
            Quests[1] = new Quest("Quest 1", new int[2] {
                1, 2
            }, new Resources(2, 3, 1, 4), 2, 3, new Item[0]);
            Quests[2] = new Quest("Quest 1", new int[2] {
                1, 2
            }, new Resources(2, 3, 1, 4), 2, 3, new Item[0]);
            //END
        }
示例#2
0
        public MainForm()
        {
            InitializeComponent(); // The InitializeComponent() call is required for Windows Forms designer support.
            InitDisplay(); //Set se Resolution
            EstablishConnection();

            Map = new Map();
            SideMenu = new SideMenu();

            //Map
            this.Controls.Add(Map.FrameLabel);
            Map.FrameLabel.BringToFront();
            Map.FrameLabel.MouseUp += OnMoveMap;
            Map.FrameLabel.MouseDown += OnMoveMap;
            Map.RedrawImage();
            //Places
            Places = new Locations(SendMoveRequest);
            InitControlGroup(Places.Menu);
            foreach(Place p in Places.AllPlaces.Values)
            {
                this.Controls.Add(p.ClickLabel);
                p.ClickLabel.Parent = Map.FrameLabel;
                p.ClickLabel.BringToFront();
            }
            OnMoveMap(Map.FrameLabel, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
            Map.FrameLabel.MouseDown += delegate
            {
                foreach (Place p in Places.AllPlaces.Values)
                    p.ClickLabel.Visible = false;
            };

            //Players
            UpdatePlayerLocation();

            //Sidemenu
            InitControlGroup(SideMenu);
            SideMenu.Visible = true;
            foreach (RelativeLabel c in SideMenu.Controls)
                c.Click += SideMenuButtonClick;
            InitControlGroup(SideMenu.LogMenu);

            //FIXME: debug... REMOVE!
            Quests[0] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            Quests[1] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            Quests[2] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            //END
        }