コード例 #1
0
    // Token: 0x06001C8A RID: 7306
    public static string ToCustomString(this GameActorInfo info)
    {
        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.AppendFormat("Name: {0} - {1}/{2}\n", info.PlayerName, info.Cmid, info.PlayerId);
        stringBuilder.AppendLine("Play: " + CmunePrint.Flag <PlayerStates>(info.PlayerState));
        stringBuilder.AppendLine(string.Concat(new object[]
        {
            "CurrentWeapon: ",
            info.CurrentWeaponSlot,
            "/",
            info.CurrentWeaponID
        }));
        stringBuilder.AppendLine(string.Concat(new object[]
        {
            "Life: ",
            info.Health,
            "/",
            info.ArmorPoints
        }));
        stringBuilder.AppendLine("Team: " + info.TeamID);
        stringBuilder.AppendLine("Color: " + info.SkinColor);
        stringBuilder.AppendLine("Weapons: " + CmunePrint.Values(new object[]
        {
            info.Weapons
        }));
        stringBuilder.AppendLine("Gear: " + CmunePrint.Values(new object[]
        {
            info.Gear
        }));
        return(stringBuilder.ToString());
    }
コード例 #2
0
 // Token: 0x060007C7 RID: 1991 RVA: 0x0003567C File Offset: 0x0003387C
 public void Draw()
 {
     this.v1 = GUILayout.BeginScrollView(this.v1, new GUILayoutOption[0]);
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     foreach (GameActorInfo gameActorInfo in GameState.Current.Players.Values)
     {
         ICharacterState characterState = GameState.Current.RemotePlayerStates.GetState(gameActorInfo.PlayerId);
         if (gameActorInfo.Cmid == PlayerDataManager.Cmid)
         {
             characterState = GameState.Current.PlayerData;
         }
         GUILayout.BeginVertical(new GUILayoutOption[0]);
         GUILayout.Label(gameActorInfo.ToCustomString(), new GUILayoutOption[0]);
         if (characterState != null)
         {
             GUILayout.Label("Keys: " + CmunePrint.Flag <KeyState>(characterState.KeyState), new GUILayoutOption[0]);
             GUILayout.Label("Move: " + CmunePrint.Flag <MoveStates>(characterState.MovementState), new GUILayoutOption[0]);
             float num = Mathf.Clamp(characterState.VerticalRotation + 90f, 0f, 180f) / 180f;
             GUILayout.Label(string.Concat(new object[]
             {
                 "Rotation: ",
                 characterState.HorizontalRotation,
                 "/",
                 characterState.VerticalRotation.ToString("f2"),
                 "/",
                 num.ToString("f2")
             }), new GUILayoutOption[0]);
             GUILayout.Label("Position: " + characterState.Position, new GUILayoutOption[0]);
             GUILayout.Label("Velocity: " + characterState.Velocity, new GUILayoutOption[0]);
         }
         GUI.contentColor = ((gameActorInfo.TeamID != TeamID.RED) ? ((gameActorInfo.TeamID != TeamID.BLUE) ? Color.white : Color.blue) : Color.red);
         GUILayout.Label("AVATAR: " + GameState.Current.Avatars.ContainsKey(gameActorInfo.Cmid), new GUILayoutOption[0]);
         if (gameActorInfo.Cmid != PlayerDataManager.Cmid && GUILayout.Button("Kick", new GUILayoutOption[0]))
         {
             GameState.Current.Actions.KickPlayer(gameActorInfo.Cmid);
         }
         GUI.contentColor = Color.white;
         GUILayout.EndVertical();
     }
     GUILayout.EndHorizontal();
     GUILayout.EndScrollView();
 }