Beispiel #1
0
        public NameQueueDialog()
        {
            GetTranslations();

            doCloseX       = true;
            forcePause     = true;
            _pawnComponent = Current.Game.GetComponent <GameComponentPawns>();

            _allPawns        = Find.ColonistBar.Entries.Select(e => e.pawn).ToList();
            _currentDiceSide = Textures.DiceSides.RandomElement();

            _current = _allPawns.FirstOrDefault(p => !_pawnComponent.HasPawnBeenNamed(p)) ?? _allPawns.FirstOrDefault();
            Notify__CurrentPawnChanged();
        }
Beispiel #2
0
        private void AssignColonist()
        {
            if (_pawnComponent.HasPawnBeenNamed(_current))
            {
                string key = _pawnComponent.pawnHistory.Where(p => p.Value == _current).Select(p => p.Key).FirstOrDefault();

                if (key != null)
                {
                    _pawnComponent.pawnHistory.Remove(key);
                }
            }

            var name = _current.Name as NameTriple;

            _current.Name = new NameTriple(name?.First, _username.NullOrEmpty() ? name?.Last : _username, name?.Last);

            if (!_username.NullOrEmpty())
            {
                _pawnComponent.AssignUserToPawn(_username.ToLowerInvariant(), _current);
            }

            NextUnnamedColonist();
        }