HintServiceMeow icon indicating copy to clipboard operation
HintServiceMeow copied to clipboard

[BUG] Hint.YCoordinateAlign属性疑似无效

Open YongAn404 opened this issue 1 year ago • 6 comments

Bug Description Hint.YCoordinateAlign设置为HintVerticalAlign.Bottom无效果,依然是以HintVerticalAlign.Top开始计算

To Reproduce

        private readonly Hint customRoleHint = new()
        {
            FontSize = 20,
            Alignment = HintAlignment.Center,
            YCoordinateAlign = HintVerticalAlign.Bottom,
            YCoordinate = 0
        };

Environment

  • OS: Windows
  • Version: 5.4.0
  • Version of Game: 14.1.0
  • Plugin Framework: Exiled

YongAn404 avatar May 21 '25 07:05 YongAn404

抱歉久等了,谢谢你报告。下个版本会测试并修复的

MeowServer avatar May 29 '25 09:05 MeowServer

Image

您好,我测试时似乎没有遇到这个问题,以下是我的代码:

var pd = PlayerDisplay.Get(ev.Player);
pd.AddHint(new List<Hint>
{
    new Hint
    {
        Text = "TopAlignment",
        FontSize = 40,
        YCoordinate = 700,
        YCoordinateAlign = HintServiceMeow.Core.Enum.HintVerticalAlign.Top
    },
    new Hint
    {
        Text = "MiddleAlignment",
        FontSize = 40,
        YCoordinate = 700,
        YCoordinateAlign = HintServiceMeow.Core.Enum.HintVerticalAlign.Middle
    },
    new Hint
    {
        Text = "BottomAlignment",
        FontSize = 40,
        YCoordinate = 700,
        YCoordinateAlign = HintServiceMeow.Core.Enum.HintVerticalAlign.Bottom
    },
});

可以请您告诉我您的代码吗?这边测试一下。

MeowServer avatar Jun 01 '25 05:06 MeowServer

https://github.com/YongAn404/YongAnFrame/blob/dev/Features/PlayerUI.cs

YongAn404 avatar Jun 01 '25 07:06 YongAn404

我看了这个文件并做了一些简单测试,发现 customRoleHint 没有正常显示。这其实是因为您把 YCoordinate 设置成了 1280,而屏幕的范围是 0 到 1080。如果您是因为 customRoleHint 无法显示而困扰,可以试试把它的 YCoordinate 设置为 1080,这样就可以正常显示在屏幕底部了。

MeowServer avatar Jun 14 '25 04:06 MeowServer

Image 我原先想写

  YCoordinate=0
  YCoordinateAlign = HintVerticalAlign.Bottom

结果发现无法显示,然后我就调成了

  YCoordinate=1000
  YCoordinateAlign = HintVerticalAlign.Bottom

发现YCoordinateAlign 似乎是从Top开始,然后我直接抛弃大脑写成了1280并且忘记测试了 我认为HintVerticalAlign.Bottom是从底部开始向上0单位,所以我认为他应该在底下显示

YongAn404 avatar Jun 14 '25 07:06 YongAn404

OK,问题结局了就好

MeowServer avatar Aug 31 '25 04:08 MeowServer