예제 #1
0
    public StatsValue(
        Func <GameObject, InlineElement> valueSupplier,
        Rectangle rect,
        StatsUiTexture downImage,
        StatsUiTexture hoverImage,
        StatsUiParams uiParams) : base(rect)
    {
        _downImage     = new WidgetImage(uiParams.TexturePaths[downImage]);
        _hoverImage    = new WidgetImage(uiParams.TexturePaths[hoverImage]);
        _valueSupplier = valueSupplier;

        _label = new WidgetText("", "char-ui-stat-value");
        SetWidgetMsgHandler(msg =>
        {
            if (msg.widgetEventType == TigMsgWidgetEvent.Exited)
            {
                UiSystems.CharSheet.Help.ClearHelpText();
                return(true);
            }

            return(false);
        });

        TooltipText = UiSystems.Tooltip.GetString(6044);
    }
예제 #2
0
    public StatsLabel(
        Stat stat,
        string helpTopic,
        Rectangle rect,
        StatsUiTexture downImage,
        StatsUiTexture hoverImage,
        StatsUiParams uiParams) : base(rect)
    {
        _stat       = stat;
        _downImage  = new WidgetImage(uiParams.TexturePaths[downImage]);
        _hoverImage = new WidgetImage(uiParams.TexturePaths[hoverImage]);

        var statName = GetStatName(uiParams, stat);

        _label = new WidgetText(statName, "char-ui-stat-label");
        SetWidgetMsgHandler(msg =>
        {
            if (msg.widgetEventType == TigMsgWidgetEvent.Exited)
            {
                UiSystems.CharSheet.Help.ClearHelpText();
                return(true);
            }

            return(false);
        });
        if (helpTopic != null)
        {
            SetClickHandler(() => { GameSystems.Help.ShowTopic(helpTopic); });
        }
    }
예제 #3
0
 public StatsValue(
     Func <GameObject, string> valueSupplier,
     Rectangle rect,
     StatsUiTexture downImage,
     StatsUiTexture hoverImage,
     StatsUiParams uiParams) : this(obj => new SimpleInlineElement(valueSupplier(obj)),
                                    rect,
                                    downImage,
                                    hoverImage,
                                    uiParams)
 {
 }