public void TriggerEvent()
    {
        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text, out InGameEventType eventType))
        {
            return;
        }

        var index = nextDropDown.value;

        if (eventType == InGameEventType.Random)
        {
            index = 0;
        }

        if (index != 0)         // Index 0 (Random Event) will never have a parameter page
        {
            // Instead of triggering the event right away, if we have an extra parameter page, we show it
            List <EventScriptBase> listEvents = InGameEventsManager.Instance.GetListFromEnum(eventType);
            if (listEvents[index - 1].parametersPageType != ParametersPageType.None)
            {
                GameObject parameterPage = eventsParametersPages.eventParameterPages.FirstOrDefault(p => p.ParametersPageType == listEvents[index - 1].parametersPageType).ParameterPage;

                if (parameterPage)
                {
                    parameterPage.SetActive(true);
                    parameterPage.GetComponent <SicknessParametersPage>().SetBasicEventParameters(index, isFakeToggle.isOn, announceToggle.isOn, InGameEventType.Fun);
                    return;
                }
            }
        }

        ServerCommandVersionFourMessageClient.Send(ServerData.UserID, PlayerList.Instance.AdminToken, index, isFakeToggle.isOn, announceToggle.isOn, eventType, "CmdTriggerGameEvent");
    }
Ejemplo n.º 2
0
        public List <EventScriptBase> GetRandomEventList()
        {
            var enumList = EnumListCache;

            enumList.Remove("Random");
            enumList.Remove("Debug");

            if (InGameEventType.TryParse(enumList.GetRandom(), out InGameEventType result))
            {
                return(GetListFromEnum(result));
            }
            return(null);
        }
Ejemplo n.º 3
0
    public void TriggerEvent()
    {
        // Pull time from game manager and put it into a private holder variable which gets cleared on timeout and allows the button to be pressed again. Current WAIT time set to 5 secs

        stationTimeHolder = GameManager.Instance.stationTime;

        if (stationTimeHolder < (stationTimeSnapshot))
        {
            // Tells all admins to wait X seconds, this is based on round time so if the server stutters loading an event it
            // will take it into account effectivly stopping any sort of spam.
            Chat.AddExamineMsgToClient($"Please wait {Mathf.Round((float)stationTimeSnapshot.Subtract(stationTimeHolder).TotalSeconds)} seconds before trying to generate another event.");
            return;
        }

        stationTimeSnapshot = stationTimeHolder.AddSeconds(5);

        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text,
                                      out InGameEventType eventType))
        {
            return;
        }

        var index = nextDropDown.value;

        if (eventType == InGameEventType.Random)
        {
            index = 0;
        }

        if (index != 0)         // Index 0 (Random Event) will never have a parameter page
        {
            // Instead of triggering the event right away, if we have an extra parameter page, we show it
            List <EventScriptBase> listEvents = InGameEventsManager.Instance.GetListFromEnum(eventType);
            if (listEvents[index - 1].parametersPageType != ParametersPageType.None)
            {
                GameObject parameterPage = eventsParametersPages.eventParameterPages
                                           .FirstOrDefault(p => p.ParametersPageType == listEvents[index - 1].parametersPageType)
                                           .ParameterPage;
                if (parameterPage)
                {
                    parameterPage.SetActive(true);
                    parameterPage.GetComponent <SicknessParametersPage>().SetBasicEventParameters(index,
                                                                                                  isFakeToggle.isOn, announceToggle.isOn, InGameEventType.Fun);
                    return;
                }
            }
        }

        AdminCommandsManager.Instance.CmdTriggerGameEvent(index, isFakeToggle.isOn, announceToggle.isOn, eventType, null);
    }
Ejemplo n.º 4
0
    private void GenerateDropDownOptionsEventType()
    {
        if (!generated)
        {
            generated = true;
            EventTypeOptions();
        }

        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text, out InGameEventType eventType))
        {
            return;
        }

        GenerateDropDownOptionsEventList(eventType);
    }
Ejemplo n.º 5
0
    public void TriggerEvent()
    {
        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text, out InGameEventType eventType))
        {
            return;
        }

        var index = nextDropDown.value;

        if (eventType == InGameEventType.Random)
        {
            index = 0;
        }

        ServerCommandVersionFourMessageClient.Send(ServerData.UserID, PlayerList.Instance.AdminToken, index, isFakeToggle.isOn, announceToggle.isOn, eventType, "CmdTriggerGameEvent");
    }