Ejemplo n.º 1
0
        private void Squish()
        {
            int a, b, r;

            List <int> rowsToUse = new List <int>();

            for (b = 0; b < _totalRows; b++)
            {
                for (a = 0; a < COLUMNS; a++)
                {
                    if (_spells[b, a] != null)
                    {
                        rowsToUse.Add(b);
                        break;
                    }
                }
            }


            MagicMenuEntry[,] newSpells = new MagicMenuEntry[rowsToUse.Count, COLUMNS];

            r = 0;
            foreach (int i in rowsToUse)
            {
                for (int j = 0; j < COLUMNS; j++)
                {
                    newSpells[r, j] = _spells[i, j];
                }
                r++;
            }

            _spells = newSpells;

            _totalRows = rowsToUse.Count;
        }
Ejemplo n.º 2
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            MagicMenuEntry s = BattleState.Commanding.MagicMenu.Selected;

            int row = 0;

            if (s != null)
            {
                string cost = s.Spell.MPCost.ToString();
                Text.ShadowedText(g, "MP Req", X + x1, Y + y0);

                row++;

                cost = cost + "/";
                te   = g.TextExtents(cost);
                Text.ShadowedText(g, cost, X + x2 - te.Width, Y + y0 + (row * ys));

                string tot = BattleState.Commanding.MP.ToString();
                te = g.TextExtents(tot);
                Text.ShadowedText(g, tot, X + x3 - te.Width, Y + y0 + (row * ys));

                row++;

//                if (s.AddedAbility.Contains(AddedAbility.All))
//                {
//                    string msg = "All x";
//                    msg += s.AllCount.ToString();
//                    Text.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
//                    row++;
//                }
//
//                if (s.AddedAbility.Contains(AddedAbility.QuadraMagic))
//                {
//                    string msg = "Q-Magic x";
//                    msg += s.QMagicCount.ToString();
//                    Text.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
//                    row++;
//                }
            }
        }
Ejemplo n.º 3
0
        protected override void DrawContents(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
        {
            g.SelectFontFace(Text.MONOSPACE_FONT, FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            Color c;

            int j = Math.Min(_visibleRows + _topRow, _totalRows);


            for (int b = _topRow; b < j; b++)
            {
                for (int a = 0; a < COLUMNS; a++)
                {
                    MagicMenuEntry spell = _spells[b, a];

                    if (spell != null)
                    {
                        if (AssociatedAlly.Frog && spell.Name != "Toad")
                        {
                            c = Colors.GRAY_4;
                        }
                        else
                        {
                            c = Colors.WHITE;
                        }

                        Text.ShadowedText(g, c, spell.Spell.Name,
                                          X + x1 + a * xs,
                                          Y + (b - _topRow + 1) * ys);
                    }
                }
            }


            if (IsControl)
            {
                Shapes.RenderCursor(g,
                                    X + x1 + cx + _xopt * xs,
                                    Y + cy + (_yopt - _topRow + 1) * ys);
            }


            AssociatedAlly.CurrentBattle.Screen.MagicInfo.Draw(d, g, width, height, screenChanged);
        }