Esempio n. 1
0
                protected void FillData(Icons.ID starticon, Kernel_bin.Stat statatk, Kernel_bin.Stat statdef)
                {
                    byte pos = 0;

                    Contents[0] = statatk;
                    getColor(pos, out byte palette, out Font.ColorID _colorid, out bool unlocked);
                    FF8String name = Kernel_bin.MagicData[Memory.State.Characters[Character].Stat_J[statatk]].Name;

                    if (name.Length == 0)
                    {
                        name = Misc[Items._];
                    }
                    ITEM[pos, 0] = new IGMDataItem_Icon(starticon, new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), palette);
                    ITEM[pos, 1] = new IGMDataItem_String(name, new Rectangle(SIZE[pos].X + 60, SIZE[pos].Y, 0, 0), color: _colorid);
                    BLANKS[pos]  = !unlocked;
                    for (pos = 1; pos < Count; pos++)
                    {
                        Contents[pos] = statdef + pos - 1;
                        getColor(pos, out palette, out _colorid, out unlocked);
                        name = Kernel_bin.MagicData[Memory.State.Characters[Character].Stat_J[statdef + pos - 1]].Name;
                        if (name.Length == 0)
                        {
                            name = Misc[Items._];
                        }
                        ITEM[pos, 0] = new IGMDataItem_Icon(starticon + 1, new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), palette);
                        ITEM[pos, 1] = new IGMDataItem_String(name, new Rectangle(SIZE[pos].X + 60, SIZE[pos].Y, 0, 0), color: _colorid);
                        BLANKS[pos]  = !unlocked;
                    }
                }
Esempio n. 2
0
            public override void Refresh()
            {
                base.Refresh();

                if (Memory.State.Characters != null && Character != Characters.Blank)
                {
                    for (int i = 0; i < Count; i++)
                    {
                        if (i == 0)
                        {
                            ITEM[i, 1] = new IGMDataItem_String(
                                Kernel_bin.BattleCommands[
                                    Memory.State.Characters[Character].Abilities.Contains(Kernel_bin.Abilities.Mug) ?
                                    13 :
                                    1].Name,
                                new Rectangle(SIZE[i].X + 80, SIZE[i].Y, 0, 0));
                        }
                        else
                        {
                            ITEM[i, 0] = new IGMDataItem_Icon(Icons.ID.Arrow_Right2, SIZE[i], 9);
                            ITEM[i, 1] = Memory.State.Characters[Character].Commands[i - 1] != Kernel_bin.Abilities.None ? new IGMDataItem_String(
                                Icons.ID.Ability_Command, 9,
                                Kernel_bin.Commandabilities[Memory.State.Characters[Character].Commands[i - 1]].Name,
                                new Rectangle(SIZE[i].X + 40, SIZE[i].Y, 0, 0)) : null;
                            Kernel_bin.Abilities k = Memory.State.Characters[Character].Commands[i - 1];
                            Descriptions[i] = k == Kernel_bin.Abilities.None ? null : Kernel_bin.Commandabilities[k].BattleCommand.Description;
                        }
                    }
                }
            }
                public override void ReInit()
                {
                    base.ReInit();

                    if (InGameMenu_Junction != null && InGameMenu_Junction.GetMode() == Mode.Mag_Stat && Enabled)
                    {
                        ITEM[0, 0] = new IGMDataItem_Icon(Icons.ID.Rewind_Fast, new Rectangle(SIZE[0].X, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 1] = new IGMDataItem_String(Descriptions[Items.ST_A_D], new Rectangle(SIZE[0].X + 20, SIZE[0].Y, 0, 0));
                        ITEM[0, 2] = new IGMDataItem_Icon(Icons.ID.Rewind, new Rectangle(SIZE[0].X + 143, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 3] = new IGMDataItem_String(Descriptions[Items.EL_A_D], new Rectangle(SIZE[0].X + 169, SIZE[0].Y, 0, 0));
                    }
                    else
                    if (InGameMenu_Junction != null && InGameMenu_Junction.GetMode() == Mode.Mag_EL_A && Enabled) //coords for these two need checked.
                    {
                        ITEM[0, 0] = new IGMDataItem_Icon(Icons.ID.Rewind, new Rectangle(SIZE[0].X, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 1] = new IGMDataItem_String(Descriptions[Items.ST_A_D], new Rectangle(SIZE[0].X + 20, SIZE[0].Y, 0, 0));
                        ITEM[0, 2] = new IGMDataItem_Icon(Icons.ID.Forward, new Rectangle(SIZE[0].X + 143, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 3] = new IGMDataItem_String(Descriptions[Items.Stats], new Rectangle(SIZE[0].X + 169, SIZE[0].Y, 0, 0));
                    }
                    else
                    if (InGameMenu_Junction != null && InGameMenu_Junction.GetMode() == Mode.Mag_ST_A && Enabled)
                    {
                        ITEM[0, 0] = new IGMDataItem_Icon(Icons.ID.Forward, new Rectangle(SIZE[0].X, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 1] = new IGMDataItem_String(Descriptions[Items.EL_A_D], new Rectangle(SIZE[0].X + 20, SIZE[0].Y, 0, 0));
                        ITEM[0, 2] = new IGMDataItem_Icon(Icons.ID.Forward_Fast, new Rectangle(SIZE[0].X + 143, SIZE[0].Y, 0, 0), 2, 7);
                        ITEM[0, 3] = new IGMDataItem_String(Descriptions[Items.Stats], new Rectangle(SIZE[0].X + 169, SIZE[0].Y, 0, 0));
                    }
                }
Esempio n. 4
0
                public override void ReInit()
                {
                    base.ReInit();
                    Rectangle r;

                    r = CONTAINER;
                    r.Offset(105, 14);
                    ITEM[0, 1] = new IGMDataItem_Int(Memory.State.Timeplayed.TotalHours < 99 ? (int)(Memory.State.Timeplayed.TotalHours) : 99, r, 2, 0, 1, 2);

                    r = CONTAINER;
                    r.Offset(165, 14);
                    ITEM[0, 3] = new IGMDataItem_Int(Memory.State.Timeplayed.TotalHours < 99 ? Memory.State.Timeplayed.Minutes : 99, r, 2, 0, 2, 2);
                    if (!Memory.State.TeamLaguna)
                    {
                        r = CONTAINER;
                        r.Offset(25, 48);
                        ITEM[0, 4] = new IGMDataItem_Icon(Icons.ID.SeeD, r, 13);

                        r = CONTAINER;
                        r.Offset(105, 48);
                        ITEM[0, 5] = Memory.State.Fieldvars != null
                            ? new IGMDataItem_Int(Memory.State.Fieldvars.SeedRankPts / 100 < 99999 ? Memory.State.Fieldvars.SeedRankPts / 100 : 99999, r, 2, 0, 1, 5)
                            : null;
                    }
                    else
                    {
                        ITEM[0, 4] = null;
                        ITEM[0, 5] = null;
                    }

                    r = CONTAINER;
                    r.Offset(25, 81);
                    ITEM[0, 6] = new IGMDataItem_Int(Memory.State.AmountofGil < 99999999 ? (int)(Memory.State.AmountofGil) : 99999999, r, 2, 0, 1, 8);
                }
Esempio n. 5
0
 protected override void Init()
 {
     base.Init();
     SIZE[Rows]    = SIZE[0];
     SIZE[Rows].Y  = Y;
     ITEM[Rows, 2] = new IGMDataItem_Icon(Icons.ID.Size_16x08_Lv_, new Rectangle(SIZE[Rows].X + SIZE[Rows].Width - 30, SIZE[Rows].Y, 0, 0), scale: new Vector2(2.5f));
 }
Esempio n. 6
0
 /// <summary>
 /// Things fixed at startup.
 /// </summary>
 protected override void Init()
 {
     ITEM[0, 1]  = new IGMDataItem_Icon(Icons.ID.MenuBorder, new Rectangle(X + 10, Y - 2, 100, 148), scale: new Vector2(1f));
     ITEM[0, 3]  = new IGMDataItem_String(Misc[Items.LV], new Rectangle(X + 117, Y + 54, 0, 0));
     ITEM[0, 6]  = new IGMDataItem_String(Misc[Items.HP], new Rectangle(X + 117, Y + 108, 0, 0));
     ITEM[0, 8]  = new IGMDataItem_String(Misc[Items.ForwardSlash], new Rectangle(X + 272, Y + 108, 0, 0));
     ITEM[0, 10] = new IGMDataItem_String(Misc[Items.CurrentEXP] + new FF8String("\n") + Misc[Items.NextLEVEL], new Rectangle(X, Y + 192, 0, 0));
     ITEM[0, 12] = new IGMDataItem_Icon(Icons.ID.P, new Rectangle(X + 372, Y + 198, 0, 0), 2);
     ITEM[0, 14] = new IGMDataItem_Icon(Icons.ID.P, new Rectangle(X + 372, Y + 231, 0, 0), 2);
     base.Init();
 }
Esempio n. 7
0
 protected override void Init()
 {
     base.Init();
     SIZE[rows]     = SIZE[0];
     SIZE[rows].Y   = Y;
     ITEM[rows, 2]  = new IGMDataItem_Icon(Icons.ID.NUM_, new Rectangle(SIZE[rows].X + SIZE[rows].Width - 45, SIZE[rows].Y, 0, 0), scale: new Vector2(2.5f));
     BLANKS[rows]   = true;
     Cursor_Status &= ~Cursor_Status.Horizontal;
     Cursor_Status |= Cursor_Status.Vertical;
     Cursor_Status &= ~Cursor_Status.Blinking;
 }
Esempio n. 8
0
            private void Refresh(sbyte pos, Characters character)
            {
                Contents[pos] = new Tuple <Characters, Characters>(character, character);
                float     yoff  = 39;
                Rectangle rbak  = SIZE[pos];
                Rectangle r     = rbak;
                Color     color = new Color(74.5f / 100, 12.5f / 100, 11.8f / 100, .9f);

                ITEM[pos, 0] = new IGMDataItem_String(Memory.Strings.GetName(character), rbak);
                CURSOR[pos]  = new Point(rbak.X, (int)(rbak.Y + (6 * TextScale.Y)));

                r.Offset(7, yoff);
                ITEM[pos, 1] = new IGMDataItem_Icon(Icons.ID.Lv, r, 13);

                r = rbak;
                r.Offset((49), yoff);
                ITEM[pos, 2] = new IGMDataItem_Int(Memory.State.Characters[character].Level, r, 2, 0, 1, 3);

                r = rbak;
                r.Offset(126, yoff);
                ITEM[pos, 3] = new IGMDataItem_Icon(Icons.ID.HP2, r, 13);

                r.Offset(0, 28);
                r.Width      = 118;
                r.Height     = 1;
                ITEM[pos, 4] = new IGMDataItem_Texture(_red_pixel, r)
                {
                    Color = Color.Black
                };
                r.Width      = (int)(r.Width * Memory.State.Characters[character].PercentFullHP());
                ITEM[pos, 5] = new IGMDataItem_Texture(_red_pixel, r)
                {
                    Color = color
                };

                r.Width = 118;
                r.Offset(0, 2);
                ITEM[pos, 6] = new IGMDataItem_Texture(_red_pixel, r)
                {
                    Color = Color.Black
                };
                r.Width      = (int)(r.Width * Memory.State.Characters[character].PercentFullHP());
                ITEM[pos, 7] = new IGMDataItem_Texture(_red_pixel, r)
                {
                    Color = color
                };
                //TODO red bar resizes based on current/max hp

                r = rbak;
                r.Offset((166), yoff);
                ITEM[pos, 8] = new IGMDataItem_Int(Memory.State.Characters[character].CurrentHP(), r, 2, 0, 1, 4);
            }
Esempio n. 9
0
        protected override void Init()
        {
            base.Init();
            SIZE[Rows]    = SIZE[0];
            SIZE[Rows].Y  = Y;
            ITEM[Rows, 2] = new IGMDataItem_Icon(Icons.ID.NUM_, new Rectangle(SIZE[Rows].X + SIZE[Rows].Width - 45, SIZE[Rows].Y, 0, 0), scale: new Vector2(2.5f));

            ITEM[Targets_Window, 0] = new IGMDataItem_IGMData(new BattleMenus.IGMData_TargetGroup());
            BLANKS[Rows]            = true;
            Cursor_Status          &= ~Cursor_Status.Horizontal;
            Cursor_Status          |= Cursor_Status.Vertical;
            Cursor_Status          &= ~Cursor_Status.Blinking;
            PointerZIndex           = Rows - 1;
        }
Esempio n. 10
0
                private void Fill()
                {
                    Faces.ID id   = 0;
                    int      skip = Page * rows;

                    for (int i = 0; i < rows; i++)
                    {
                        bool       gftest    = false;
                        bool       ctest     = false;
                        Characters character = Characters.Blank;
                        GFs        gf        = GFs.Blank;
                        while (!Enum.IsDefined(typeof(Faces.ID), id) ||
                               !((ctest = Item.TestCharacter(ref id, out character)) || (gftest = Item.TestGF(ref id, out gf))) ||
                               skip-- > 0)
                        {
                            if ((byte)++id > 32)
                            {
                                for (; i < rows; i++)
                                {
                                    ITEM[i, 0]  = null;
                                    ITEM[i, 1]  = null;
                                    ITEM[i, 2]  = null;
                                    BLANKS[i]   = true;
                                    Contents[i] = Faces.ID.Blank;
                                }
                                Pages = Page + 1;
                                return;
                            }
                        }
                        ITEM[i, 0] = new IGMDataItem_String(Memory.Strings.GetName(id), pos: SIZE[i]);
                        int hp = (ctest || gftest) ? Memory.State[id].CurrentHP() : -1;
                        BLANKS[i]   = false;
                        Contents[i] = id;
                        if (hp > -1)
                        {
                            ITEM[i, 1] = new IGMDataItem_Icon(Icons.ID.HP2, new Rectangle(SIZE[i].X + SIZE[i].Width - (20 * 7), SIZE[i].Y, 0, 0), 13);
                            ITEM[i, 2] = new IGMDataItem_Int(hp, pos: new Rectangle(SIZE[i].X + SIZE[i].Width - (20 * 4), SIZE[i].Y, 0, 0), spaces: 4);
                        }
                        else
                        {
                            ITEM[i, 1] = null;
                            ITEM[i, 2] = null;
                        }

                        id++;
                    }
                    Pages = Page + 2;
                }
Esempio n. 11
0
                protected override void Init()
                {
                    Rectangle r;

                    r = CONTAINER;
                    r.Offset(25, 14);
                    ITEM[0, 0] = new IGMDataItem_Icon(Icons.ID.PLAY, r, 13);

                    r = CONTAINER;
                    r.Offset(145, 14);
                    ITEM[0, 2] = new IGMDataItem_Icon(Icons.ID.Colon, r, 13, 2, .5f);

                    r = CONTAINER;
                    r.Offset(185, 81);
                    ITEM[0, 7] = new IGMDataItem_Icon(Icons.ID.G, r, 2);
                    base.Init();
                }
                public override void ReInit()
                {
                    base.ReInit();

                    if (Memory.State.Characters != null)
                    {
                        for (int i = 0; i < Count; i++)
                        {
                            int slots = 2;
                            if (Memory.State.Characters[Character].UnlockedGFAbilities.Contains(Kernel_bin.Abilities.Abilityx3))
                            {
                                slots = 3;
                            }
                            if (Memory.State.Characters[Character].UnlockedGFAbilities.Contains(Kernel_bin.Abilities.Abilityx4))
                            {
                                slots = 4;
                            }
                            if (i < slots)
                            {
                                ITEM[i, 0] = new IGMDataItem_Icon(Icons.ID.Arrow_Right2, SIZE[i], 9);
                                if (Memory.State.Characters[Character].Abilities[i] != Kernel_bin.Abilities.None)
                                {
                                    ITEM[i, 1] = new IGMDataItem_String(

                                        Kernel_bin.EquipableAbilities[Memory.State.Characters[Character].Abilities[i]].Icon, 9,
                                        Kernel_bin.EquipableAbilities[Memory.State.Characters[Character].Abilities[i]].Name,
                                        new Rectangle(SIZE[i].X + 40, SIZE[i].Y, 0, 0));
                                    Descriptions[i] = Kernel_bin.EquipableAbilities[Memory.State.Characters[Character].Abilities[i]].Description.ReplaceRegion();
                                }
                                else
                                {
                                    ITEM[i, 1] = null;
                                    //Descriptions[i] = "";
                                }
                                BLANKS[i] = false;
                            }
                            else
                            {
                                ITEM[i, 0] = null;
                                ITEM[i, 1] = null;
                                BLANKS[i]  = true;
                                //Descriptions[i] = "";
                            }
                        }
                    }
                }
Esempio n. 13
0
            /// <summary>
            /// Things that may of changed before screen loads or junction is changed.
            /// </summary>
            public override void Refresh()
            {
                if (Memory.State.Characters != null)
                {
                    Contents = Array.ConvertAll(Contents, c => c = default);
                    base.Refresh();

                    if (Memory.State.Characters != null && unlocked != null)
                    {
                        ITEM[5, 0] = new IGMDataItem_Icon(Icons.ID.Icon_Status_Attack, new Rectangle(SIZE[5].X + 200, SIZE[5].Y, 0, 0),
                                                          (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Atk_J) ? 2 : 7));
                        ITEM[5, 1] = new IGMDataItem_Icon(Icons.ID.Icon_Status_Defense, new Rectangle(SIZE[5].X + 240, SIZE[5].Y, 0, 0),
                                                          (byte)(unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx1) ||
                                                                 unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx2) ||
                                                                 unlocked.Contains(Kernel_bin.Abilities.ST_Def_Jx4) ? 2 : 7));
                        ITEM[5, 2] = new IGMDataItem_Icon(Icons.ID.Icon_Elemental_Attack, new Rectangle(SIZE[5].X + 280, SIZE[5].Y, 0, 0),
                                                          (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Atk_J) ? 2 : 7));
                        ITEM[5, 3] = new IGMDataItem_Icon(Icons.ID.Icon_Elemental_Defense, new Rectangle(SIZE[5].X + 320, SIZE[5].Y, 0, 0),
                                                          (byte)(unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx1) ||
                                                                 unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx2) ||
                                                                 unlocked.Contains(Kernel_bin.Abilities.EL_Def_Jx4) ? 2 : 7));
                        BLANKS[5] = true;
                        foreach (Kernel_bin.Stat stat in (Kernel_bin.Stat[])Enum.GetValues(typeof(Kernel_bin.Stat)))
                        {
                            if (Stat2Icon.ContainsKey(stat))
                            {
                                int pos = (int)stat;
                                if (pos >= 5)
                                {
                                    pos++;
                                }
                                Contents[pos] = stat;
                                FF8String name = Kernel_bin.MagicData[Memory.State.Characters[Character].Stat_J[stat]].Name;
                                if (name == null || name.Length == 0)
                                {
                                    name = Misc[Items._];
                                }

                                ITEM[pos, 0] = new IGMDataItem_Icon(Stat2Icon[stat], new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), 2);
                                ITEM[pos, 1] = new IGMDataItem_String(name, new Rectangle(SIZE[pos].X + 80, SIZE[pos].Y, 0, 0));
                                if (!unlocked.Contains(Kernel_bin.Stat2Ability[stat]))
                                {
                                    ((IGMDataItem_Icon)ITEM[pos, 0]).Palette     = ((IGMDataItem_Icon)ITEM[pos, 0]).Faded_Palette = 7;
                                    ((IGMDataItem_String)ITEM[pos, 1]).FontColor = Font.ColorID.Grey;
                                    BLANKS[pos] = true;
                                }
                                else
                                {
                                    BLANKS[pos] = false;
                                }

                                ITEM[pos, 2] = new IGMDataItem_Int(Memory.State.Characters[Character].TotalStat(stat, VisableCharacter), new Rectangle(SIZE[pos].X + 152, SIZE[pos].Y, 0, 0), 2, Icons.NumType.sysFntBig, spaces: 10);
                                ITEM[pos, 3] = stat == Kernel_bin.Stat.HIT || stat == Kernel_bin.Stat.EVA
                                    ? new IGMDataItem_String(Misc[Items.Percent], new Rectangle(SIZE[pos].X + 350, SIZE[pos].Y, 0, 0))
                                    : null;
                                if (GetPrevSetting() == null || GetPrevSetting().Stat_J[stat] == Memory.State.Characters[Character].Stat_J[stat] || GetPrevSetting().TotalStat(stat, VisableCharacter) == Memory.State.Characters[Character].TotalStat(stat, VisableCharacter))
                                {
                                    ITEM[pos, 4] = null;
                                }
                                else if (GetPrevSetting().TotalStat(stat, VisableCharacter) > Memory.State.Characters[Character].TotalStat(stat, VisableCharacter))
                                {
                                    ((IGMDataItem_Icon)ITEM[pos, 0]).Palette       = 5;
                                    ((IGMDataItem_Icon)ITEM[pos, 0]).Faded_Palette = 5;
                                    ((IGMDataItem_String)ITEM[pos, 1]).FontColor   = Font.ColorID.Red;
                                    ((IGMDataItem_Int)ITEM[pos, 2]).FontColor      = Font.ColorID.Red;
                                    if (ITEM[pos, 3] != null)
                                    {
                                        ((IGMDataItem_String)ITEM[pos, 3]).FontColor = Font.ColorID.Red;
                                    }
                                    ITEM[pos, 4] = new IGMDataItem_Icon(Icons.ID.Arrow_Down, new Rectangle(SIZE[pos].X + 250, SIZE[pos].Y, 0, 0), 16);
                                }
                                else
                                {
                                    ((IGMDataItem_Icon)ITEM[pos, 0]).Palette       = 6;
                                    ((IGMDataItem_Icon)ITEM[pos, 0]).Faded_Palette = 6;
                                    ((IGMDataItem_String)ITEM[pos, 1]).FontColor   = Font.ColorID.Yellow;
                                    ((IGMDataItem_Int)ITEM[pos, 2]).FontColor      = Font.ColorID.Yellow;
                                    if (ITEM[pos, 3] != null)
                                    {
                                        ((IGMDataItem_String)ITEM[pos, 3]).FontColor = Font.ColorID.Yellow;
                                    }
                                    ITEM[pos, 4] = new IGMDataItem_Icon(Icons.ID.Arrow_Up, new Rectangle(SIZE[pos].X + 250, SIZE[pos].Y, 0, 0), 17);
                                }
                            }
                        }
                    }
                }
            }
Esempio n. 14
0
                private void ReInitCharacter(sbyte pos, Characters character, Characters visableCharacter)
                {
                    if (SIZE != null)
                    {
                        if (character != Characters.Blank)
                        {
                            Contents[pos] = new Tuple <Characters, Characters>(character, visableCharacter);
                            float yoff = 6;

                            ITEM[pos, 0] = new IGMDataItem_Box(Memory.Strings.GetName(visableCharacter), title: Icons.ID.STATUS);
                            Tuple <Rectangle, Point, Rectangle> dims = DrawBox(SIZE[pos], ((IGMDataItem_Box)ITEM[pos, 0]).Data, options: Box_Options.SkipDraw);
                            Rectangle r = dims.Item3;
                            ITEM[pos, 0].Pos = dims.Item1;
                            CURSOR[pos]      = dims.Item2;

                            r = dims.Item3;
                            r.Offset(184, yoff);
                            ITEM[pos, 1] = new IGMDataItem_Icon(Icons.ID.Lv, r, 13);

                            r = dims.Item3;
                            r.Offset((229), yoff);
                            ITEM[pos, 2] = new IGMDataItem_Int(Memory.State.Characters[character].Level, r, 2, 0, 1, 3);

                            r = dims.Item3;
                            r.Offset(304, yoff);
                            ITEM[pos, 3] = new IGMDataItem_Icon(Icons.ID.HP2, r, 13);

                            r = dims.Item3;
                            r.Offset((354), yoff);
                            ITEM[pos, 4] = new IGMDataItem_Int(Memory.State.Characters[character].CurrentHP(visableCharacter), r, 2, 0, 1, 4);

                            r = dims.Item3;
                            r.Offset(437, yoff);
                            ITEM[pos, 5] = new IGMDataItem_Icon(Icons.ID.Slash_Forward, r, 13);

                            r = dims.Item3;

                            r.Offset((459), yoff);
                            ITEM[pos, 6] = new IGMDataItem_Int(Memory.State.Characters[character].MaxHP(visableCharacter), r, 2, 0, 1, 4);

                            if (Memory.State.TeamLaguna || Memory.State.SmallTeam)
                            {
                                BLANKS[pos] = false;
                                r           = dims.Item3;
                                r.Offset(145, 36);
                                FF8String s = Strings[Items.CurrentEXP] + "\n" + Strings[Items.NextLEVEL];
                                ITEM[pos, 7] = new IGMDataItem_String(s, r);

                                r = dims.Item3;
                                r.Offset((340), 42);
                                ITEM[pos, 8] = new IGMDataItem_Int((int)Memory.State.Characters[character].Experience, r, 2, 0, 1, 9);

                                r = dims.Item3;
                                r.Offset(520, 42);
                                ITEM[pos, 9] = new IGMDataItem_Icon(Icons.ID.P, r, 2);

                                r = dims.Item3;
                                r.Offset((340), 75);
                                ITEM[pos, 10] = new IGMDataItem_Int(Memory.State.Characters[character].ExperienceToNextLevel, r, 2, 0, 1, 9);

                                r = dims.Item3;
                                r.Offset(520, 75);
                                ITEM[pos, 11] = new IGMDataItem_Icon(Icons.ID.P, r, 2);
                            }
                            else
                            {
                                for (int i = 7; i < Depth; i++)
                                {
                                    ITEM[pos, i] = null;
                                }
                            }
                        }
                        else
                        {
                            ITEM[pos, 0] = new IGMDataItem_Box(pos: SIZE[pos]);
                            BLANKS[pos]  = true;
                            for (int i = 1; i < Depth; i++)
                            {
                                ITEM[pos, i] = null;
                            }
                        }
                    }
                }
Esempio n. 15
0
            public override void Refresh()
            {
                if (Memory.State?.Characters != null)
                {
                    List <KeyValuePair <int, Characters> > party = Memory.State.Party.Select((element, index) => new { element, index }).ToDictionary(m => m.index, m => m.element).Where(m => !m.Value.Equals(Characters.Blank)).ToList();
                    byte pos = (byte)party.FindIndex(x => x.Value == VisableCharacter);
                    foreach (KeyValuePair <int, Characters> pm in party.Where(x => x.Value == VisableCharacter))
                    {
                        Saves.CharacterData c    = Memory.State.Characters[Memory.State.PartyData[pm.Key]];
                        FF8String           name = Memory.Strings.GetName(pm.Value);
                        int HP = c.CurrentHP(pm.Value);
                        //int MaxHP = c.MaxHP(pm.Value);
                        //float HPpercent = c.PercentFullHP(pm.Value);
                        int          CriticalHP = c.CriticalHP(pm.Value);
                        Font.ColorID colorid    = Font.ColorID.White;
                        byte         palette    = 2;
                        if (HP < CriticalHP)
                        {
                            colorid = Font.ColorID.Yellow;
                            palette = 6;
                        }
                        if (HP <= 0)
                        {
                            colorid = Font.ColorID.Red;
                            palette = 5;
                        }
                        byte?        fadedpalette = null;
                        Font.ColorID?fadedcolorid = null;
                        bool         blink        = false;
                        if (mode == Mode.YourTurn)
                        {
                            blink        = true;
                            fadedpalette = 7;
                            fadedcolorid = Font.ColorID.Grey;
                            ITEM[pos, 2] = new IGMDataItem_Texture(dot, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), Color.LightYellow * .8f, new Color(125, 125, 0, 255) * .8f)
                            {
                                Blink = blink
                            };
                        }
                        else if (mode == Mode.ATB_Charged)
                        {
                            ITEM[pos, 2] = new IGMDataItem_Texture(dot, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), Color.Yellow * .8f);
                        }
                        // insert gradient atb bar here. Though this probably belongs in the update
                        // method as it'll be in constant flux.
                        else
                        {
                            ITEM[pos, 2] = null;
                        }

                        // TODO: make a font render that can draw right to left from a point. For Right aligning the names.
                        ITEM[pos, 0] = new IGMDataItem_String(name, new Rectangle(SIZE[pos].X, SIZE[pos].Y, 0, 0), colorid, faded_fontcolor: fadedcolorid)
                        {
                            Blink = blink
                        };
                        ITEM[pos, 1] = new IGMDataItem_Int(HP, new Rectangle(SIZE[pos].X + 128, SIZE[pos].Y, 0, 0), palette: palette, faded_palette: fadedpalette, spaces: 4, numtype: Icons.NumType.Num_8x16_1)
                        {
                            Blink = blink
                        };

                        ITEM[pos, 3] = new IGMDataItem_Icon(Icons.ID.Size_08x64_Bar, new Rectangle(SIZE[pos].X + 230, SIZE[pos].Y + 12, 150, 15), 0);
                        pos++;
                    }
                    base.Refresh();
                }
            }
Esempio n. 16
0
                protected void FillData <T>(Dictionary <T, byte> oldtotal, Dictionary <T, byte> total, Enum[] availableFlagsarray, Icons.ID starticon, sbyte offset = 0, byte palette = 2, Icons.ID[] skip = null) where T : Enum
                {
                    int   _nag      = 0;
                    int   _pos      = 0;
                    sbyte endoffset = (sbyte)(offset > 0?offset:0);

                    for (sbyte pos = 0; pos < Count - endoffset; pos++)
                    {
                        if (skip != null && skip.Contains(starticon + pos))
                        {
                            offset    -= 1;
                            pos       += 1;
                            endoffset -= 1;
                        }
                        ITEM[pos + offset, 0] = new IGMDataItem_Icon(starticon + pos, new Rectangle(SIZE[pos + offset].X, SIZE[pos + offset].Y, 0, 0), palette);
                        ITEM[pos + offset, 1] = total[(T)availableFlagsarray[pos + 1]] > 100 ? new IGMDataItem_Icon(Icons.ID.Star, new Rectangle(SIZE[pos + offset].X + 45, SIZE[pos + offset].Y, 0, 0), 4) : null;
                        ITEM[pos + offset, 2] = null;
                        ITEM[pos + offset, 3] = new IGMDataItem_Int(
                            total[(T)availableFlagsarray[pos + 1]] > 100 ?
                            total[(T)availableFlagsarray[pos + 1]] - 100 :
                            total[(T)availableFlagsarray[pos + 1]], new Rectangle(SIZE[pos + offset].X + SIZE[pos + offset].Width - 80, SIZE[pos + offset].Y, 0, 0), 17, numtype: Icons.NumType.sysFntBig, spaces: 3);
                        ITEM[pos + offset, 4] = new IGMDataItem_String("%", new Rectangle(SIZE[pos + offset].X + SIZE[pos + offset].Width - 20, SIZE[pos + offset].Y, 0, 0));
                        if (oldtotal != null)
                        {
                            if (oldtotal[(T)availableFlagsarray[pos + 1]] > total[(T)availableFlagsarray[pos + 1]])
                            {
                                ((IGMDataItem_Icon)ITEM[pos + offset, 0]).Palette       = 5;
                                ((IGMDataItem_Icon)ITEM[pos + offset, 0]).Faded_Palette = 5;
                                ITEM[pos + offset, 2] = new IGMDataItem_Icon(Icons.ID.Arrow_Down, new Rectangle(SIZE[pos + offset].X + SIZE[pos + offset].Width - 105, SIZE[pos + offset].Y, 0, 0), 16);
                                ((IGMDataItem_Int)ITEM[pos + offset, 3]).Colorid    = Font.ColorID.Red;
                                ((IGMDataItem_String)ITEM[pos + offset, 4]).Colorid = Font.ColorID.Red;

                                //{
                                //    ((IGMDataItem_Icon)Slots.ITEM[Slots.CURSOR_SELECT, 0]).Palette = 5;
                                //    ((IGMDataItem_Icon)Slots.ITEM[Slots.CURSOR_SELECT, 0]).Faded_Palette = 5;
                                //    ((IGMDataItem_String)Slots.ITEM[Slots.CURSOR_SELECT, 1]).Colorid = Font.ColorID.Red;
                                //}
                                if (++_nag > _pos)
                                {
                                    ColorChangeEventListener?.Invoke(this, Font.ColorID.Red);
                                }
                            }
                            else if (oldtotal[(T)availableFlagsarray[pos + 1]] < total[(T)availableFlagsarray[pos + 1]])
                            {
                                ((IGMDataItem_Icon)ITEM[pos + offset, 0]).Palette       = 6;
                                ((IGMDataItem_Icon)ITEM[pos + offset, 0]).Faded_Palette = 6;
                                ITEM[pos + offset, 2] = new IGMDataItem_Icon(Icons.ID.Arrow_Up, new Rectangle(SIZE[pos + offset].X + SIZE[pos + offset].Width - 105, SIZE[pos + offset].Y, 0, 0), 17);
                                ((IGMDataItem_Int)ITEM[pos + offset, 3]).Colorid    = Font.ColorID.Yellow;
                                ((IGMDataItem_String)ITEM[pos + offset, 4]).Colorid = Font.ColorID.Yellow;

                                //{
                                //    ((IGMDataItem_Icon)Slots.ITEM[Slots.CURSOR_SELECT, 0]).Palette = 6;
                                //    ((IGMDataItem_Icon)Slots.ITEM[Slots.CURSOR_SELECT, 0]).Faded_Palette = 6;
                                //    ((IGMDataItem_String)Slots.ITEM[Slots.CURSOR_SELECT, 1]).Colorid = Font.ColorID.Yellow;
                                //}
                                if (_nag <= ++_pos)
                                {
                                    ColorChangeEventListener?.Invoke(this, Font.ColorID.Yellow);
                                }
                            }
                        }
                    }
                }