Exemplo n.º 1
0
        public void DoubleClickItem()
        {
            nint i = tableView.SelectedRow;

            if ((i >= 0) && (i < Engine.Instance.Stats.List.Count))
            {
                StatsEntry e = Engine.Instance.Stats.List[(int)tableView.SelectedRow];

                Engine.Instance.Command("ui.stats." + e.Key, true);

                /*
                 * if (e.Key == "VpnGeneratedOVPN") {
                 *      if (Engine.Instance.IsConnected () == false)
                 *              return;
                 *      WindowTextViewerController textViewer = new WindowTextViewerController ();
                 *      (Engine.Instance as Engine).WindowsOpen.Add (textViewer);
                 *      textViewer.Title = e.Caption;
                 *      textViewer.Body = Engine.Instance.ConnectedOVPN;
                 *      textViewer.ShowWindow (this);
                 * } else if (e.Key == "SystemReport") {
                 *      WindowTextViewerController textViewer = new WindowTextViewerController ();
                 *      (Engine.Instance as Engine).WindowsOpen.Add (textViewer);
                 *      textViewer.Title = e.Caption;
                 *      textViewer.Body = Platform.Instance.GenerateSystemReport ();
                 *      textViewer.ShowWindow (this);
                 * } else if (e.Key == "ManifestLastUpdate") {
                 *      Core.Threads.Manifest.Instance.ForceUpdate = true;
                 * }
                 */
            }
        }
Exemplo n.º 2
0
 public override void OnStatsChange(StatsEntry entry)
 {
     if (FormMain != null)
     {
         FormMain.OnStatsChange(entry);
     }
 }
Exemplo n.º 3
0
        public void DoubleClickItem()
        {
            int i = tableView.SelectedRow;

            if ((i >= 0) && (i < Engine.Instance.Stats.List.Count))
            {
                StatsEntry e = Engine.Instance.Stats.List [tableView.SelectedRow];
                if (e.Key == "VpnGeneratedOVPN")
                {
                    if (Engine.Instance.IsConnected() == false)
                    {
                        return;
                    }
                    WindowTextViewerController textViewer = new WindowTextViewerController();
                    (Engine.Instance as Engine).WindowsOpen.Add(textViewer);
                    textViewer.Title = e.Caption;
                    textViewer.Body  = Engine.Instance.ConnectedOVPN;
                    textViewer.ShowWindow(this);
                }
                else if (e.Key == "SystemReport")
                {
                    WindowTextViewerController textViewer = new WindowTextViewerController();
                    (Engine.Instance as Engine).WindowsOpen.Add(textViewer);
                    textViewer.Title = e.Caption;
                    textViewer.Body  = Platform.Instance.GenerateSystemReport();
                    textViewer.ShowWindow(this);
                }
                else if (e.Key == "ManifestLastUpdate")
                {
                    Core.Threads.Manifest.Instance.ForceUpdate = true;
                }
            }
        }
            public WildPokemonInfo(IReadOnlyBinaryDataAccessor accessor)
            {
                var sir0 = new Sir0(accessor);

                int pokemonStatsCount  = sir0.SubHeader.ReadInt32(0x00);
                int pokemonStatsOffset = sir0.SubHeader.ReadInt32(0x08);

                Stats = new StatsEntry[pokemonStatsCount];
                for (int i = 0; i < pokemonStatsCount; i++)
                {
                    var offset = sir0.Data.ReadInt64(pokemonStatsOffset + i * sizeof(long));
                    Stats[i] = new StatsEntry(i, sir0.Data.Slice(offset, 16));
                }

                int floorCount = sir0.SubHeader.ReadInt32(0x10);

                Floors = new FloorInfo[floorCount];
                for (int i = 0; i < floorCount; i++)
                {
                    Floors[i] = new FloorInfo(pokemonStatsCount);
                    var offset = sir0.SubHeader.ReadInt64(0x18 + i * sizeof(long));
                    for (int j = 0; j < pokemonStatsCount; j++)
                    {
                        Floors[i].Entries[j] = new FloorInfo.Entry(sir0.Data.Slice(offset + j * 16, 16));
                    }
                }
            }
Exemplo n.º 5
0
 public override void OnStatsChange(StatsEntry entry)
 {
     if (UiClient.Instance.MainWindow != null)
     {
         UiClient.Instance.MainWindow.OnStatsChange(entry);
     }
 }
Exemplo n.º 6
0
        public static void Start()
        {
            ConsoleUtils.Write(ConsoleMsgType.Status, "Loading Stats Database...\n");

            DB = new Dictionary <int, StatsEntry>();

            Database        db     = new Database(Server.GameDbConString);
            MySqlDataReader reader =
                db.ReaderQuery(
                    "SELECT `id`, `str`, `vit`, `dex`, `agi`, `int`, `wis`, `luk` " +
                    "FROM `stats_db`", null, null
                    );

            while (reader.Read())
            {
                StatsEntry stats = new StatsEntry();

                stats.Str = (short)reader["str"];
                stats.Vit = (short)reader["vit"];
                stats.Dex = (short)reader["dex"];
                stats.Agi = (short)reader["agi"];
                stats.Int = (short)reader["int"];
                stats.Wis = (short)reader["wis"];
                stats.Luk = (short)reader["luk"];

                DB.Add((int)reader["id"], stats);
            }

            ConsoleUtils.Write(ConsoleMsgType.Status, "Stats Database Loaded.\n");
        }
 private void DrawStatsElement(StatsEntry entry)
 {
     using (new HorizontalBlock(EditorStyles.helpBox, GUILayout.Height(EditorGUIUtility.singleLineHeight)))
     {
         GUILayout.Label(entry.id);
         GUILayout.FlexibleSpace();
         GUILayout.Label(entry.count.ToString());
     }
 }
Exemplo n.º 8
0
        public void DoubleClickItem()
        {
            nint i = tableView.SelectedRow;

            if ((i >= 0) && (i < Engine.Instance.Stats.List.Count))
            {
                StatsEntry e = Engine.Instance.Stats.List[(int)tableView.SelectedRow];

                Engine.Instance.Command("ui.stats." + e.Key, true);
            }
        }
Exemplo n.º 9
0
        public void DoubleClickItem()
        {
            nint i = tableView.SelectedRow;

            if ((i >= 0) && (i < Engine.Instance.Stats.List.Count))
            {
                StatsEntry e = Engine.Instance.Stats.List[(int)tableView.SelectedRow];

                Core.UI.App.OpenStats(e.Key.ToLowerInvariant());
            }
        }
Exemplo n.º 10
0
 public CharStats(StatsEntry s)
 {
     _name      = s.Name;
     _petIds    = s.PetIds;
     _exp       = s.Exp;
     _mapId     = s.MapId;
     _portal    = s.Portal;
     _rank      = s.Rank;
     _jobRank   = s.JobRank;
     _baseStats = s.Stats;
     _female    = s.Female;
     _job       = new Job(_baseStats[MapleStat.Id.JOB]);
     InitTotalStats();
 }
            public WildPokemonInfo()
            {
                Stats = new StatsEntry[(int)CreatureIndex.END];
                for (int i = 0; i < (int)CreatureIndex.END; i++)
                {
                    Stats[i] = new StatsEntry();
                }

                Floors = new FloorInfo[99];
                for (int i = 0; i < 99; i++)
                {
                    Floors[i] = new FloorInfo((int)CreatureIndex.END);
                }
            }
Exemplo n.º 12
0
        public override void OnStatsChange(StatsEntry entry)
        {
            base.OnStatsChange(entry);

            if (MainWindow != null)
            {
                if (MainWindow.TableStatsController != null)
                {
                    new NSObject().InvokeOnMainThread(() => {
                        MainWindow.TableStatsController.RefreshUI();
                    });
                }
            }
        }
Exemplo n.º 13
0
        public override NSObject GetObjectValue(NSTableView tableView,
                                                NSTableColumn tableColumn,
                                                int row)
        {
            StatsEntry e = Engine.Instance.Stats.List [row];

            if (tableColumn.Identifier == "Icon")
            {
                return(NSImage.ImageNamed("stats_" + e.Icon.ToLowerInvariant() + ".png"));
            }
            else if (tableColumn.Identifier == "Key")
            {
                return(new NSString(e.Caption));
            }
            else if (tableColumn.Identifier == "Value")
            {
                return(new NSString(e.Value));
            }
            else
            {
                throw new NotImplementedException(string.Format("{0} is not recognized", tableColumn.Identifier));
            }
        }
Exemplo n.º 14
0
 internal void Add(StatsEntry item)
 {
     SetStatLevel(item.name, GetStatLevel(item.name) + item.value);
 }