Beispiel #1
0
        public override void HandleState(EuiStateBase state)
        {
            base.HandleState(state);

            if (state is not GhostRolesEuiState ghostState)
            {
                return;
            }
            _window.ClearEntries();

            var groupedRoles = ghostState.GhostRoles.GroupBy(
                role => (role.Name, role.Description));

            foreach (var group in groupedRoles)
            {
                var name        = group.Key.Name;
                var description = group.Key.Description;

                _window.AddEntry(name, description, group);
            }

            var closeRulesWindow = ghostState.GhostRoles.All(role => role.Identifier != _windowRulesId);

            if (closeRulesWindow)
            {
                _windowRules?.Close();
            }
        }
Beispiel #2
0
        public override void HandleState(EuiStateBase state)
        {
            base.HandleState(state);

            if (state is not GhostRolesEuiState ghostState)
            {
                return;
            }

            var closeRulesWindow = true;

            _window.ClearEntries();

            foreach (var info in ghostState.GhostRoles)
            {
                _window.AddEntry(info);
                if (info.Identifier == _windowRulesId)
                {
                    closeRulesWindow = false;
                }
            }

            if (closeRulesWindow)
            {
                _windowRules?.Close();
            }
        }
        public override void HandleState(EuiStateBase baseState)
        {
            var state = (EditSolutionsEuiState)baseState;

            _window.SetTargetEntity(state.Target);
            _window.UpdateSolutions(state.Solutions);
            _window.UpdateReagents();
        }
Beispiel #4
0
        public override void HandleState(EuiStateBase state)
        {
            if (state is not MakeGhostRoleEuiState uiState)
            {
                return;
            }

            _window.SetEntity(uiState.EntityUid);
        }
Beispiel #5
0
        public override void ReadFromBuffer(NetIncomingMessage buffer)
        {
            Id = buffer.ReadUInt32();

            var ser    = IoCManager.Resolve <IRobustSerializer>();
            var len    = buffer.ReadVariableInt32();
            var stream = buffer.ReadAlignedMemory(len);

            State = ser.Deserialize <EuiStateBase>(stream);
        }
    public override void HandleState(EuiStateBase state)
    {
        if (state is not AdminNotesEuiState s)
        {
            return;
        }

        NoteWindow.SetTitlePlayer(s.NotedPlayerName);
        NoteControl.SetNotes(s.Notes);
        NoteControl.SetPermissions(s.CanCreate, s.CanDelete, s.CanEdit);
    }
Beispiel #7
0
        public override void HandleState(EuiStateBase state)
        {
            base.HandleState(state);

            if (state is not GhostRolesEuiState ghostState)
            {
                return;
            }

            _window.ClearEntries();

            foreach (var info in ghostState.GhostRoles)
            {
                _window.AddEntry(info);
            }
        }
Beispiel #8
0
    public override void HandleState(EuiStateBase state)
    {
        var s = (AdminLogsEuiState)state;

        var first = TrySetFirstState(s);

        if (s.IsLoading)
        {
            return;
        }

        LogsControl.SetCurrentRound(s.RoundId);
        LogsControl.SetPlayers(s.Players);

        if (first)
        {
            RequestLogs();
        }
    }
Beispiel #9
0
    public override void HandleState(EuiStateBase state)
    {
        var s = (AdminLogsEuiState)state;

        if (s.IsLoading)
        {
            return;
        }

        LogsControl.SetCurrentRound(s.RoundId);
        LogsControl.SetPlayers(s.Players);

        if (!FirstState)
        {
            return;
        }

        FirstState = false;
        LogsControl.SetRoundSpinBox(s.RoundId);
        RequestLogs();
    }
Beispiel #10
0
 public override void HandleState(EuiStateBase state)
 {
     _window.HandleState((AdminAddReagentEuiState)state);
 }
Beispiel #11
0
 public virtual void HandleState(EuiStateBase state)
 {
 }
Beispiel #12
0
        public override void HandleState(EuiStateBase state)
        {
            var outfitState = (SetOutfitEuiState)state;

            _window.TargetEntityId = outfitState.TargetEntityId;
        }