コード例 #1
0
        public unsafe void InitPlayersGrid(GWorld *world)
        {
            ArrayList arrayList = new ArrayList();

            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_02JINPPBEP@No?$AA@)), 15));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_07CEAHOFOL@Faction?$AA@)), 50));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_07DFGIDBBA@Control?$AA@)), 50));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_04GBPANCCF@Team?$AA@)), 20));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_05PDOBBJNA@Color?$AA@)), 20));
            if (this.PlayersGrid == null)
            {
                GridControl gridControl = new GridControl(200, 236, arrayList, 0);
                this.PlayersGrid = gridControl;
                gridControl.Dock = DockStyle.Fill;
                this.PlayersGrid.SelectedIndex    = 0;
                this.PlayersGrid.ChooseItem      += new GridControl.__Delegate_ChooseItem(this.PlayersGridChooseItem);
                this.PlayersGrid.DoubleClickItem += new GridControl.__Delegate_DoubleClickItem(this.PlayersGridDoubleClickItem);
                base.Controls.Add(this.PlayersGrid);
            }
            this.InitItems(world);
        }
コード例 #2
0
        public unsafe void InitItems(GWorld *world)
        {
            string value = null;

            if (this.PlayersGrid.Items.Count > 0)
            {
                this.PlayersGrid.Items.Clear();
            }
            int num = 0;

            do
            {
                GPlayer * ptr       = < Module >.GWorld.GetPlayer(world, num);
                ArrayList arrayList = new ArrayList();
                arrayList.Add(string.Format("{0}", num + 1));
                switch (*(int *)(ptr + 4 / sizeof(GPlayer)))
                {
                case 0:
                    value = new string((sbyte *)(& < Module >.?? _C@_05IHOOPELI@Iraqi?$AA@));
                    break;

                case 1:
                    value = new string((sbyte *)(& < Module >.?? _C@_03OHIEPGFF@JTF?$AA@));
                    break;

                case 2:
                    value = new string((sbyte *)(& < Module >.?? _C@_07NDGKDAPO@Bosnian?$AA@));
                    break;

                case 3:
                    value = new string((sbyte *)(& < Module >.?? _C@_08NKKMBANE@Somalian?$AA@));
                    break;

                case 4:
                    value = new string((sbyte *)(& < Module >.?? _C@_09LDEFILLJ@Colombian?$AA@));
                    break;

                case 5:
                    value = new string((sbyte *)(& < Module >.?? _C@_06DJKJCBIE@Afghan?$AA@));
                    break;
                }
                arrayList.Add(value);
                switch (*(int *)(ptr + 8 / sizeof(GPlayer)))
                {
                case 0:
                    value = new string((sbyte *)(& < Module >.?? _C@_05OHCDHBAC@Human?$AA@));
                    break;

                case 1:
                    value = new string((sbyte *)(& < Module >.?? _C@_08JABLAMKL@Computer?$AA@));
                    break;

                case 2:
                    value = new string((sbyte *)(& < Module >.?? _C@_07GJJCKENN@Neutral?$AA@));
                    break;

                case 3:
                    value = new string((sbyte *)(& < Module >.?? _C@_09BIDEJFLN@Rescuable?$AA@));
                    break;

                case 4:
                    value = new string((sbyte *)(& < Module >.?? _C@_03KNAPCKEA@Spy?$AA@));
                    break;

                case 5:
                    value = new string((sbyte *)(& < Module >.?? _C@_05JDMJBIOG@Civil?$AA@));
                    break;
                }
                arrayList.Add(value);
                arrayList.Add(string.Format("{0}", *(int *)(ptr + 16 / sizeof(GPlayer))));
                arrayList.Add(string.Format("{0}", *(int *)ptr));
                this.PlayersGrid.Items.Add(arrayList);
                num++;
            }while (num < 12);
            this.PlayersGrid.UpdateViewHeight();
        }