Exemple #1
0
 public frmMain()
 {
     Presentation.frmLogin login = new Presentation.frmLogin(compteJoueurController, context);
     login.ShowDialog();
     if (login.DialogResult != System.Windows.Forms.DialogResult.OK)
         Application.Exit();
     InitializeComponent();
 }
Exemple #2
0
 public frmMain()
 {
     Presentation.frmLogin login = new Presentation.frmLogin(compteJoueurController, context);
     login.ShowDialog();
     if (login.DialogResult != System.Windows.Forms.DialogResult.OK)
     {
         Application.Exit();
     }
     InitializeComponent();
 }
        /* -------------------------------------------------------------- *\
        frmMain_Load()
        - Main Form Initialization
        \* -------------------------------------------------------------- */
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            // Montre la fenetre de connexion a premier plan
            Presentation.frmLogin Login = new Presentation.frmLogin();
            //Login.ShowDialog();
            // TP HugoLand: Ajout d'un bouton "Ajouter Utilisateur" si l'utilisateur est administrateur
            if (Login.UserType == 1)
            {
                mnuSettings.Visible = true;
                mnuCreateNewUser.Enabled = true;
            }

            _db = new GameContext();

            m_Map = new CMap();
            m_TileLibrary = new CTileLibrary();
            m_Map.TileLibrary = m_TileLibrary;

            picMap.Parent = picEditArea;
            picMap.Left = 0;
            picMap.Top = 0;

            picTiles.Parent = picEditSel;
            picTiles.Width = m_TileLibrary.Width * csteApplication.TILE_WIDTH_IN_IMAGE;
            picTiles.Height = m_TileLibrary.Height * csteApplication.TILE_HEIGHT_IN_IMAGE;
            picTiles.Left = 0;
            picTiles.Top = 0;

            vscMap.Minimum = 0;
            vscMap.Maximum = m_Map.Height;
            m_YSel = 0;

            hscMap.Minimum = 0;
            hscMap.Maximum = m_Map.Width;
            m_XSel = 0;

            m_bRefresh = true;
            m_bResize = true;
            tmrUpdate.Enabled = true;
            m_Zoom = csteApplication.ZOOM;

            m_TileRect = new Rectangle(-1, -1, -1, -1);
            m_LibRect = new Rectangle(-1, -1, -1, -1);
            m_ActiveTileID = 32;

            //dlgLoadMap.InitialDirectory = Path.GetDirectoryName(Application.ExecutablePath) + "\\maps\\";
            //dlgSaveMap.InitialDirectory = dlgLoadMap.InitialDirectory;
            m_bOpen = false;
            m_MenuLogic();
            //tmrLoad.Enabled = true;

            m_pen = new Pen(Color.Orange, 4);
            m_brush = new SolidBrush(Color.FromArgb(160, 249, 174, 55));
            m_brush2 = new SolidBrush(Color.FromArgb(160, 255, 0, 0));

            m_bDrawTileRect = false;
            m_bDrawMapRect = false;

            cboZoom.Left = 250;
            cboZoom.Top = 2;
            cboZoom.Items.Add(new ComboItem("1X", 1));
            cboZoom.Items.Add(new ComboItem("2X", 2));
            cboZoom.Items.Add(new ComboItem("4X", 4));
            cboZoom.Items.Add(new ComboItem("8X", 8));
            cboZoom.Items.Add(new ComboItem("16X", 16));
            cboZoom.SelectedIndex = 1;
            cboZoom.DropDownStyle = ComboBoxStyle.DropDownList;

            lblZoom.Left = 180;
            lblZoom.Top = 2;

            tbMain.Controls.Add(lblZoom);
            tbMain.Controls.Add(cboZoom);
        }