コード例 #1
0
 public void UpdateDisplay(BodyScannerTemplateData template, Dictionary <string, BodyScannerBodyPartData> parts)
 {
     _template = template;
     _parts    = parts;
     _slots    = new List <string>();
     foreach (var(key, value) in _parts)
     {
         _slots.Add(key);    //We have to do this since ItemLists only return the index of what item is selected and dictionaries don't allow you to explicitly grab things by index.
                             //So we put the contents of the dictionary into a list so that we can grab the list by index. I don't know either.
         BodyPartList.AddItem(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(key));
     }
 }
コード例 #2
0
        public void UpdateDisplay(EntityUid entity)
        {
            _currentEntity = entity;
            BodyPartList.Clear();

            var body = IoCManager.Resolve <IEntityManager>().GetComponentOrNull <SharedBodyComponent>(_currentEntity);

            if (body == null)
            {
                return;
            }

            foreach (var(part, _) in body.Parts)
            {
                BodyPartList.AddItem(Loc.GetString(part.Name));
            }
        }
コード例 #3
0
        public void UpdateDisplay(IEntity entity)
        {
            _currentEntity = entity;
            BodyPartList.Clear();

            var body = CurrentBody;

            if (body == null)
            {
                return;
            }

            foreach (var slotName in body.Parts.Keys)
            {
                BodyPartList.AddItem(Loc.GetString(slotName));
            }
        }
コード例 #4
0
        public void UpdateDisplay(BodyScannerTemplateData template, Dictionary <string, BodyScannerBodyPartData> parts)
        {
            _template = template;
            _parts    = parts;
            _slots    = new List <string>();
            BodyPartList.Clear();

            foreach (var slotName in _parts.Keys)
            {
                // We have to do this since ItemLists only return the index of what item is
                // selected and dictionaries don't allow you to explicitly grab things by index.
                // So we put the contents of the dictionary into a list so
                // that we can grab the list by index. I don't know either.
                _slots.Add(slotName);

                BodyPartList.AddItem(Loc.GetString(slotName));
            }
        }