示例#1
0
 public WithTextControlGroupDecoration(Actor self, WithTextControlGroupDecorationInfo info)
 {
     this.info = info;
     this.self = self;
     font      = Game.Renderer.Fonts[info.Font];
     color     = info.UsePlayerColor ? self.Owner.Color : info.Color;
     label     = new CachedTransform <int, string>(g => g.ToString());
 }
示例#2
0
        public WithTextControlGroupDecoration(Actor self, WithTextControlGroupDecorationInfo info)
        {
            this.info = info;

            if (!Game.Renderer.Fonts.TryGetValue(info.Font, out font))
            {
                throw new YamlException("Font '{0}' is not listed in the mod.yaml's Fonts section".F(info.Font));
            }

            color = info.UsePlayerColor ? self.Owner.Color.RGB : info.Color;
        }
        public WithTextControlGroupDecoration(Actor self, WithTextControlGroupDecorationInfo info)
        {
            this.info = info;

            if (!Game.Renderer.Fonts.TryGetValue(info.Font, out font))
            {
                throw new YamlException("Font '{0}' is not listed in the mod.yaml's Fonts section".F(info.Font));
            }

            decorationBounds = self.TraitsImplementing <IDecorationBounds>().ToArray();
            color            = info.UsePlayerColor ? self.Owner.Color : info.Color;
        }