Exemple #1
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);
                }
Exemple #2
0
 private void addGF(ref int pos, GFs g, Font.ColorID color = Font.ColorID.White)
 {
     ITEM[pos, 0]  = new IGMDataItem_String(Memory.Strings.GetName(g), SIZE[pos], color);
     ITEM[pos, 1]  = JunctionedGFs.ContainsKey(g) ? new IGMDataItem_Icon(Icons.ID.JunctionSYM, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 100, SIZE[pos].Y, 0, 0)) : null;
     ITEM[pos, 2]  = new IGMDataItem_Int(Source.GFs[g].Level, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 50, SIZE[pos].Y, 0, 0), spaces: 3);
     BLANKS[pos]   = false;
     Contents[pos] = g;
     pos++;
 }
Exemple #3
0
 protected override void Init()
 {
     base.Init();
     _helpStr = new FF8String[Count];
     for (byte pos = 0; pos < rows; pos++)
     {
         ITEM[pos, 0] = new IGMDataItem_String(null, SIZE[pos]);
         ITEM[pos, 1] = new IGMDataItem_Int(0, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 60, SIZE[pos].Y, 0, 0), numtype: Icons.NumType.sysFntBig, spaces: 3);
     }
 }
Exemple #4
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);
            }
Exemple #5
0
 private void addMagic(ref int pos, Kernel_bin.Magic_Data spell, Font.ColorID color = Font.ColorID.White)
 {
     if (color == Font.ColorID.White && Source.Stat_J.ContainsValue(spell.ID))
     {
         //spell is junctioned
         color = Font.ColorID.Grey;
     }
     ITEM[pos, 0]  = new IGMDataItem_String(spell.Name, SIZE[pos], color);
     ITEM[pos, 1]  = color != Font.ColorID.White ? new IGMDataItem_Icon(Icons.ID.JunctionSYM, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 75, SIZE[pos].Y, 0, 0)) : null;
     ITEM[pos, 2]  = new IGMDataItem_Int(Source.Magics[spell.ID], new Rectangle(SIZE[pos].X + SIZE[pos].Width - 50, SIZE[pos].Y, 0, 0), spaces: 3);
     BLANKS[pos]   = color == Font.ColorID.Dark_Gray ? true : false;
     Contents[pos] = spell.ID;
     pos++;
 }
                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;
                }
Exemple #7
0
 private void Fill(Faces.ID e)
 {
     if ((e == Faces.ID.Blank && Target != Faces.ID.Blank) || All)
     {
         Target = e;
         foreach (IGMDataItem i in ITEM)
         {
             i?.Hide();
         }
     }
     else
     {
         if (Target == Faces.ID.Blank)
         {
             foreach (IGMDataItem i in ITEM)
             {
                 i?.Show();
             }
         }
         Target = e;
         Characters character = e.ToCharacters();
         GFs        gf        = e.ToGFs();
         if (character != Characters.Blank || (gf != GFs.Blank && gf != GFs.All))
         {
             ITEM[0, 0] = new IGMDataItem_String(Misc[Items.LV], new Rectangle(SIZE[0].X, SIZE[0].Y, 0, 0));
             ITEM[1, 0] = new IGMDataItem_String(Misc[Items.HP], new Rectangle(SIZE[1].X, SIZE[1].Y, 0, 0));
             ITEM[1, 2] = new IGMDataItem_String(Misc[Items.ForwardSlash], new Rectangle(SIZE[1].X + 155, SIZE[1].Y, 0, 0));
         }
         if (Memory.State.Characters != null && character != Characters.Blank)
         {
             ITEM[0, 1] = new IGMDataItem_Int(Memory.State.Characters[character].Level, new Rectangle(SIZE[0].X + 35, SIZE[0].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
             ITEM[0, 2] = Memory.State.Party != null && Memory.State.Party.Contains(character)
                 ? new IGMDataItem_Icon(Icons.ID.InParty, new Rectangle(SIZE[0].X + 155, SIZE[0].Y, 0, 0), 6)
                 : null;
             ITEM[1, 1] = new IGMDataItem_Int(Memory.State.Characters[character].CurrentHP(character), new Rectangle(SIZE[1].X + 35, SIZE[1].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
             ITEM[1, 3] = new IGMDataItem_Int(Memory.State.Characters[character].MaxHP(character), new Rectangle(SIZE[1].X + 155, SIZE[1].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 5);
         }
         if (Memory.State.GFs != null && (gf != GFs.Blank && gf != GFs.All))
         {
             ITEM[0, 1] = new IGMDataItem_Int(Memory.State.GFs[gf].Level, new Rectangle(SIZE[0].X + 35, SIZE[0].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
             ITEM[0, 2] = null;
             ITEM[1, 1] = new IGMDataItem_Int(Memory.State.GFs[gf].CurrentHP(), new Rectangle(SIZE[1].X + 35, SIZE[1].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
             ITEM[1, 3] = new IGMDataItem_Int(Memory.State.GFs[gf].MaxHP(), new Rectangle(SIZE[1].X + 155, SIZE[1].Y, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 5);
         }
     }
 }
Exemple #8
0
                /// <summary>
                /// Things that may of changed before screen loads or junction is changed.
                /// </summary>
                public override void ReInit()
                {
                    base.ReInit();
                    ITEM[0, 0] = new IGMDataItem_Face((Faces.ID)VisableCharacter, new Rectangle(X + 12, Y, 96, 144));
                    ITEM[0, 2] = new IGMDataItem_String(Memory.Strings.GetName(VisableCharacter), new Rectangle(X + 117, Y + 0, 0, 0));

                    if (Memory.State.Characters != null)
                    {
                        ITEM[0, 4] = new IGMDataItem_Int(Memory.State.Characters[Character].Level, new Rectangle(X + 117 + 35, Y + 54, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
                        ITEM[0, 5] = Memory.State.Party != null && Memory.State.Party.Contains(Character)
                            ? new IGMDataItem_Icon(Icons.ID.InParty, new Rectangle(X + 278, Y + 48, 0, 0), 6)
                            : null;
                        ITEM[0, 7]  = new IGMDataItem_Int(Memory.State.Characters[Character].CurrentHP(VisableCharacter), new Rectangle(X + 152, Y + 108, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 6);
                        ITEM[0, 9]  = new IGMDataItem_Int(Memory.State.Characters[Character].MaxHP(VisableCharacter), new Rectangle(X + 292, Y + 108, 0, 0), 13, numtype: Icons.NumType.sysFntBig, padding: 1, spaces: 5);
                        ITEM[0, 11] = new IGMDataItem_Int((int)Memory.State.Characters[Character].Experience, new Rectangle(X + 192, Y + 198, 0, 0), 13, numtype: Icons.NumType.Num_8x8_2, padding: 1, spaces: 9);
                        ITEM[0, 13] = new IGMDataItem_Int(Memory.State.Characters[Character].ExperienceToNextLevel, new Rectangle(X + 192, Y + 231, 0, 0), 13, numtype: Icons.NumType.Num_8x8_2, padding: 1, spaces: 9);
                    }
                }
Exemple #9
0
        private void addMagic(ref int pos, Kernel_bin.Magic_Data spell, Font.ColorID color = @default)
        {
            bool j = false;

            if (color == @default && Source.Stat_J.ContainsValue(spell.ID))
            {
                //spell is junctioned
                if (!Battle)
                {
                    color = junctioned;
                }
                j = true;
            }
            ITEM[pos, 0] = new IGMDataItem_String(spell.Name, SIZE[pos], color);
            ITEM[pos, 1] = j ? new IGMDataItem_Icon(Icons.ID.JunctionSYM, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 75, SIZE[pos].Y, 0, 0)) : null;
            ITEM[pos, 2] = new IGMDataItem_Int(Source.Magics[spell.ID], new Rectangle(SIZE[pos].X + SIZE[pos].Width - 50, SIZE[pos].Y, 0, 0), spaces: 3);
            //makes it so you cannot junction a magic to a stat that does nothing.
            BLANKS[pos]   = color == nostat ? true : false;
            Contents[pos] = spell.ID;
            pos++;
        }
Exemple #10
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);
                                }
                            }
                        }
                    }
                }
            }
Exemple #11
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;
                            }
                        }
                    }
                }
Exemple #12
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();
                }
            }
Exemple #13
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);
                                }
                            }
                        }
                    }
                }