コード例 #1
0
    private void UpdateUI(CharacterInfoComponent comp, string jobTitle, Dictionary <string, List <ConditionInfo> > objectives)
    {
        comp.Control.SubText.Text = jobTitle;

        comp.Control.ObjectivesContainer.RemoveAllChildren();
        foreach (var(groupId, objectiveConditions) in objectives)
        {
            var vbox = new BoxContainer
            {
                Orientation = BoxContainer.LayoutOrientation.Vertical,
                Modulate    = Color.Gray
            };

            vbox.AddChild(new Label
            {
                Text     = groupId,
                Modulate = Color.LightSkyBlue
            });

            foreach (var objectiveCondition in objectiveConditions)
            {
                var hbox = new BoxContainer
                {
                    Orientation = BoxContainer.LayoutOrientation.Horizontal
                };
                hbox.AddChild(new ProgressTextureRect
                {
                    Texture           = objectiveCondition.SpriteSpecifier.Frame0(),
                    Progress          = objectiveCondition.Progress,
                    VerticalAlignment = Control.VAlignment.Center
                });
                hbox.AddChild(new Control
                {
                    MinSize = (10, 0)
                });
コード例 #2
0
 private void OnComponentAdd(EntityUid uid, CharacterInfoComponent component, ComponentAdd args)
 {
     component.Scene = component.Control = new CharacterInfoComponent.CharacterInfoControl();
 }