private void DisplayItem(Languaje idioma)
 {
     EditorGUILayout.BeginVertical("Box");
     EditorGUILayout.BeginHorizontal();
     GUILayout.Label("Name: ");
     idioma.Name = EditorGUILayout.TextField(idioma.Name, options);
     EditorGUILayout.EndHorizontal();
     if (database.LanguajesCount > 0 && firstLanguaje != string.Empty)
     {
         GUILayout.Label("Contents: ");
         EditorGUILayout.BeginHorizontal();
         GUILayout.Label(database.GetLanguaje(firstLanguaje).Name, h1);
         GUILayout.Label("New Idioma", h1);
         EditorGUILayout.EndHorizontal();
         for (int i = 0; i < database.LanguajeContentCount(firstLanguaje); i++)
         {
             EditorGUILayout.BeginHorizontal();
             GUILayout.Label(database.GetLanguaje(firstLanguaje).content[i].content, valueStyle);
             EditorGUILayout.BeginVertical();
             contents[i] = EditorGUILayout.TextField(contents[i], GUILayout.MinWidth(150.0f));
             EditorGUILayout.EndVertical();
             EditorGUILayout.EndHorizontal();
         }
         EditorGUILayout.EndVertical();
     }
 }
Esempio n. 2
0
        public frmMenu()
        {
            InitializeComponent();

            Languaje.Initialize();
            this.LoadLanguajeTexts();
        }
Esempio n. 3
0
 // Esta funcion permite
 public void AddLanguaje(Languaje idioma)
 {
     if (GetLanguaje(idioma.Name) == null)
     {
         idiomas.Add(idioma);
     }
     else
     {
         throw new System.Exception("Ya existe un idioma con ese Nombre, prueba con otro");
     }
 }
Esempio n. 4
0
 private void LoadLanguajeTexts()
 {
     try
     {
         this.lblLeyend.Text = Languaje.GetFrmHowToLblLeyend();
         this.btnBack.Text   = Languaje.GetFrmHowToBtnBack();
         this.btnRepeat.Text = Languaje.GetFrmHowToBtnRepeat();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void btnReset_Click(object sender, EventArgs e)
        {
            string       title        = Languaje.GetFrmHighScoresHighScores()[0];
            string       message      = Languaje.GetFrmHighScoresHighScores()[1];
            DialogResult dialogResult = MessageBox.Show(message, title, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.OK)
            {
                HighScores highScores = new HighScores();
                highScores.ResetHightScores();
                this.LoadFormData();
            }
        }
        /// <summary>
        /// Check if all level has been finished
        /// </summary>
        public bool CheckAllLevelsFinished()
        {
            if (_CurrentLevel >= MAX_LEVEL)
            {
                string title   = Languaje.GetFrmGameGameFinished()[0];
                string message = Languaje.GetFrmGameGameFinished()[1];

                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Check if no lives remaing
        /// </summary>
        public bool CheckNoLivesRemaining()
        {
            if (_Lives == 0)
            {
                string title   = Languaje.GetFrmGameNoLive()[0];
                string message = Languaje.GetFrmGameNoLive()[1];

                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(true);
            }

            return(false);
        }
    private void DisplayIdioma(int index, Languaje lang)
    {
        EditorGUILayout.BeginVertical("Box");

        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Name: " + lang.Name);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Content: ");
        contents[index] = EditorGUILayout.TextArea(contents[index]);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.EndVertical();
    }
        /// <summary>
        /// Check if current level has been finished
        /// </summary>
        public bool CheckLevelComplete(Board board)
        {
            if (board.Bricks.Count == 0)
            {
                _CurrentLevel++;

                string title   = Languaje.GetFrmGameLevelUp()[0];
                string message = Languaje.GetFrmGameLevelUp()[1] + _CurrentLevel.ToString() + ".";
                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(true);
            }

            return(false);
        }
Esempio n. 10
0
        public void Draw(Graphics graphics, int lives, int level, int score)
        {
            for (int i = 0; i < lives; i++)
            {
                graphics.DrawImage(image, new Point(10 + i * 35, 10));
            }

            string sLevel = Languaje.GetFrmGameLevelString() + " " + level.ToString();

            graphics.DrawString(sLevel, new Font("Bookman Old Style", 12, FontStyle.Bold), Brushes.White, new PointF(300, 17));

            string sScore = Languaje.GetFrmGameScoreString() + score.ToString().PadLeft(5, '0');

            graphics.DrawString(sScore, new Font("Bookman Old Style", 12, FontStyle.Bold), Brushes.White, new RectangleF(500, 17, 140, 20));
        }
Esempio n. 11
0
 private void LoadLanguajeTexts()
 {
     try
     {
         this.btnPlay.Text       = Languaje.GetFrmMenuBtnPlay();
         this.btnHowTo.Text      = Languaje.GetFrmMenuBtnHowTo();
         this.btnHighScores.Text = Languaje.GetFrmMenuBtnHighScores();
         this.btnOptions.Text    = Languaje.GetFrmMenuBtnOptions();
         this.btnEditor.Text     = Languaje.GetFrmMenuBtnEditor();
         this.btnCredits.Text    = Languaje.GetFrmMenuBtnCredits();
         this.btnExit.Text       = Languaje.GetFrmMenuBtnExits();
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 12
0
        public bool CheckLoseLive()
        {
            if (loseLive == true)
            {
                _Lives--;
                loseLive = false;

                string title   = Languaje.GetFrmGameLoseLive()[0];
                string message = _Lives.ToString() + Languaje.GetFrmGameLoseLive()[1];
                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(true);
            }

            return(false);
        }
    //Item deleteItem;

    private void DisplayIdioma(Languaje idioma)
    {
        EditorGUILayout.BeginVertical("Box");
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label(idioma.Name, h1);
        if (GUILayout.Button(idioma.editorShow ? "Hidden" : "Show", GUILayout.MaxWidth(80)))
        {
            idioma.editorShow = !idioma.editorShow;
        }
        EditorGUILayout.EndHorizontal();
        if (idioma.content.Count >= 0 && idioma.editorShow)
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Contenido:");
            EditorGUILayout.EndHorizontal();
            foreach (var content in idioma.content)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.BeginVertical();
                GUILayout.Label(content.id + ".- " + content.content, layoutWrap);
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical(GUILayout.MaxWidth(5));
                if (GUILayout.Button("Edit"))
                {
                    ContentModifiWindows.ShowWindow(database, content.id);
                }
                if (GUILayout.Button("Delete"))
                {
                    if (EditorUtility.DisplayDialog("Are you sure?", "Are you sure you want to delete this item?", "Acept"))
                    {
                        RemoveElement(content.id);
                    }
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();

                /*if (GUILayout.Button("Delete"))
                 * {
                 *  deleteItem = item;
                 * }
                 * else
                 *  deleteItem = null;*/
            }
        }
        EditorGUILayout.EndVertical();
    }
Esempio n. 14
0
 private void LoadLanguajeTexts()
 {
     try
     {
         this.lblLanguaje.Text = Languaje.GetFrmOptionsLblLanguaje();
         this.lblLives.Text    = Languaje.GetFrmOptionsLblLives();
         this.lblMusic.Text    = Languaje.GetFrmOptionsLblMusic();
         this.lblInput.Text    = Languaje.GetFrmOptionsLblInput();
         this.lblMessaje.Text  = Languaje.GetFrmOptionsLblMenssaje();
         this.btnOK.Text       = Languaje.GetFrmOptionsBtnOK();
         this.btnCancel.Text   = Languaje.GetFrmOptionsBtnCancel();
         this.btnRestart.Text  = Languaje.GetFrmOptionsBtnRestart();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public static void ShowWindow(ScriptableLanguaje db)
 {
     database               = db;
     window                 = GetWindow <AddLanguajeWindows>();
     window.minSize         = new Vector2(300, 380);
     newItem                = new Languaje();
     textAreaStyle.wordWrap = true;
     valueStyle.wordWrap    = true;
     valueStyle.alignment   = TextAnchor.MiddleLeft;
     h1.fontSize            = 16;
     window.titleContent    = new GUIContent("Add new Idioma");
     if (db.LanguajesCount > 0)
     {
         contents      = new string[db.LanguajeContentCount(db.GetLanguaje(0).Name)];
         firstLanguaje = db.GetLanguaje(0).Name;
     }
     else
     {
         contents      = new string[0];
         firstLanguaje = string.Empty;
     }
 }
Esempio n. 16
0
        private void DrawHowTo()
        {
            this.graphics = this.CreateGraphics();
            this.graphics.SmoothingMode = SmoothingMode.HighQuality;

            switch (step)
            {
            case 1:
                this.image = Image.FromFile(path + @"HowTo\Screen01.png");
                graphics.DrawImage(image, new Rectangle(0, 0, this.Width, this.Height));
                break;

            case 3:
                graphics.DrawLine(pen1, new Point(425, 270), new Point(470, 255));
                graphics.DrawString(Languaje.GetFrmHowToStep(1), new Font("Verdana", 10), Brushes.White, 80, 270);
                break;

            case 8:
                graphics.DrawString(Languaje.GetFrmHowToStep(2), new Font("Verdana", 10), Brushes.White, 80, 290);
                break;

            case 13:
                this.image = Image.FromFile(path + @"HowTo\Screen02.png");
                graphics.DrawImage(image, new Rectangle(0, 0, this.Width, this.Height));
                break;

            case 15:
                graphics.DrawLine(pen1, new Point(100, 400), new Point(70, 450));
                graphics.DrawString(Languaje.GetFrmHowToStep(3), new Font("Verdana", 10), Brushes.White, 115, 385);
                break;

            case 20:
                image = Image.FromFile(path + @"HowTo\Screen03.png");
                graphics.DrawImage(image, new Rectangle(0, 0, this.Width, this.Height));
                break;

            case 22:
                graphics.DrawLine(pen1, new Point(580, 355), new Point(520, 415));
                break;

            case 24:
                graphics.DrawLine(pen2, new Point(485, 415), new Point(425, 355));
                graphics.DrawString(Languaje.GetFrmHowToStep(4), new Font("Verdana", 10), Brushes.White, 90, 350);
                break;

            case 29:
                image = Image.FromFile(path + @"HowTo\Screen04.png");
                graphics.DrawImage(image, new Rectangle(0, 0, this.Width, this.Height));
                break;

            case 31:
                graphics.DrawLine(pen1, new Point(580, 355), new Point(520, 415));
                break;

            case 33:
                graphics.DrawLine(pen3, new Point(493, 405), new Point(485, 335));
                graphics.DrawLine(pen3, new Point(493, 405), new Point(493, 335));
                graphics.DrawLine(pen3, new Point(493, 405), new Point(501, 335));
                graphics.DrawString(Languaje.GetFrmHowToStep(5), new Font("Verdana", 10), Brushes.White, 90, 300);
                break;

            case 38:
                this.image = Image.FromFile(path + @"HowTo\Screen05.png");
                graphics.DrawImage(image, new Rectangle(0, 0, this.Width, this.Height));
                graphics.DrawString(Languaje.GetFrmHowToStep(5), new Font("Verdana", 10), Brushes.White, 90, 300);
                break;

            case 40:
                graphics.DrawLine(pen1, new Point(480, 355), new Point(420, 415));
                break;

            case 42:
                graphics.DrawLine(pen3, new Point(390, 410), new Point(330, 345));
                graphics.DrawLine(pen3, new Point(390, 410), new Point(330, 355));
                graphics.DrawLine(pen3, new Point(390, 410), new Point(330, 365));
                break;

            case 47:
                this.tmrTick.Enabled   = false;
                this.btnBack.Visible   = true;
                this.btnRepeat.Visible = true;
                this.lblLeyend.Visible = true;
                break;
            }
        }