Ejemplo n.º 1
0
        public static void OnPlayerJoined(Player player)
        {
            if (player.name.Contains("Local") && player.prop_APIUser_0 == null)
            {
                player.prop_APIUser_0 = APIUser.CurrentUser;
            }

            if (idToEntryTable.ContainsKey(player.prop_APIUser_0.id))
            {
                return; // If already in list
            }
            if (player.name.Contains("Local"))
            {
                if (localPlayerEntry != null)
                {
                    return;
                }

                GameObject template = Object.Instantiate(Constants.playerListLayout.transform.Find("Template").gameObject, Constants.playerListLayout.transform);
                template.SetActive(true);

                LeftSidePlayerEntry leftSidePlayerEntry = EntryBase.CreateInstance <LeftSidePlayerEntry>(template.transform.Find("LeftPart").gameObject);
                EntryBase.CreateInstance <LocalPlayerEntry>(template.transform.Find("RightPart").gameObject);
                AddPlayerLeftPairEntry(EntryBase.CreateInstance <PlayerLeftPairEntry>(template, new object[] { leftSidePlayerEntry, localPlayerEntry }));
            }
            else
            {
                GameObject template = Object.Instantiate(Constants.playerListLayout.transform.Find("Template").gameObject, Constants.playerListLayout.transform);
                template.SetActive(true);

                LeftSidePlayerEntry leftSidePlayerEntry = EntryBase.CreateInstance <LeftSidePlayerEntry>(template.transform.Find("LeftPart").gameObject);
                PlayerEntry         playerEntry         = EntryBase.CreateInstance <PlayerEntry>(template.transform.Find("RightPart").gameObject, new object[] { player });
                AddPlayerLeftPairEntry(EntryBase.CreateInstance <PlayerLeftPairEntry>(template, new object[] { leftSidePlayerEntry, playerEntry }));
            }
        }
Ejemplo n.º 2
0
 public static void AddGeneralInfoEntries()
 {
     MelonLogger.Msg("Adding List Entries...");
     AddGeneralInfoEntry(EntryBase.CreateInstance <PlayerListHeaderEntry>(Constants.playerListLayout.transform.Find("Header").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <RoomTimeEntry>(Constants.generalInfoLayout.transform.Find("RoomTime").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <SystemTime12HrEntry>(Constants.generalInfoLayout.transform.Find("SystemTime12Hr").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <SystemTime24HrEntry>(Constants.generalInfoLayout.transform.Find("SystemTime24Hr").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <GameVersionEntry>(Constants.generalInfoLayout.transform.Find("GameVersion").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <CoordinatePositionEntry>(Constants.generalInfoLayout.transform.Find("CoordinatePosition").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <WorldNameEntry>(Constants.generalInfoLayout.transform.Find("WorldName").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <WorldAuthorEntry>(Constants.generalInfoLayout.transform.Find("WorldAuthor").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <InstanceMasterEntry>(Constants.generalInfoLayout.transform.Find("InstanceMaster").gameObject, includeConfig: true));
     AddGeneralInfoEntry(EntryBase.CreateInstance <InstanceCreatorEntry>(Constants.generalInfoLayout.transform.Find("InstanceCreator").gameObject, includeConfig: true));
 }
Ejemplo n.º 3
0
        public static void OnPlayerJoin(Player player)
        {
            if (playerEntries.ContainsKey(player.field_Private_APIUser_0.id))
            {
                return;
            }

            if (player.field_Private_APIUser_0.IsSelf)
            {
                if (localPlayerEntry != null)
                {
                    return;
                }

                localPlayerEntry = EntryBase.CreateInstance <LocalPlayerEntry>(Object.Instantiate(Constants.playerListLayout.transform.Find("Template").gameObject, Constants.playerListLayout.transform));
                AddEntry(localPlayerEntry);
                localPlayerEntry.gameObject.SetActive(true);
                return;
            }

            AddPlayerEntry(EntryBase.CreateInstance <PlayerEntry>(Object.Instantiate(Constants.playerListLayout.transform.Find("Template").gameObject, Constants.playerListLayout.transform), new object[] { player }));
        }
Ejemplo n.º 4
0
 void initializeEntry()
 {
     entry = EntryBase.CreateInstance <Entry_ComponentsEntryTemplate>();
 }