Skip to content

Commit

Permalink
[F] SelectionDetail window size
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Sep 30, 2024
1 parent e65d67f commit 07817b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
9 changes: 9 additions & 0 deletions AquaMai/Resources/Locale.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions AquaMai/Resources/Locale.resx
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,7 @@
<data name="NetErrWasDownloadSuccessOnce" xml:space="preserve">
<value>Data download not success</value>
</data>
<data name="RatingUpWhenSSSp" xml:space="preserve">
<value>SSS+ =&gt; DXRating += {0}</value>
</data>
</root>
3 changes: 3 additions & 0 deletions AquaMai/Resources/Locale.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@
<data name="NetErrWasDownloadSuccessOnce" xml:space="preserve">
<value>数据下载不成功</value>
</data>
<data name="RatingUpWhenSSSp" xml:space="preserve">
<value>推到鸟加可上 {0} 分</value>
</data>
</root>
10 changes: 6 additions & 4 deletions AquaMai/Utils/SelectionDetail.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using AquaMai.Helpers;
using AquaMai.Resources;
using HarmonyLib;
using MAI2.Util;
using Manager;
Expand Down Expand Up @@ -82,21 +83,22 @@ public void OnGUI()
var rate = CalcB50(SelectData.MusicData, difficulty[player]);
if (rate > 0)
{
dataToShow.Add($"SSS+ => DXRating += {rate}");
dataToShow.Add(string.Format(Locale.RatingUpWhenSSSp, rate));
}


var x = GuiSizes.PlayerCenter - 100 + GuiSizes.PlayerWidth * player;
var width = GuiSizes.FontSize * 15f;
var x = GuiSizes.PlayerCenter - width / 2f + GuiSizes.PlayerWidth * player;
var y = Screen.height * 0.87f;

var labelStyle = GUI.skin.GetStyle("label");
labelStyle.fontSize = GuiSizes.FontSize;
labelStyle.alignment = TextAnchor.MiddleCenter;

GUI.Box(new Rect(x, y, 200, dataToShow.Count * GuiSizes.LabelHeight + 2 * GuiSizes.Margin), "");
GUI.Box(new Rect(x, y, width, dataToShow.Count * GuiSizes.LabelHeight + 2 * GuiSizes.Margin), "");
for (var i = 0; i < dataToShow.Count; i++)
{
GUI.Label(new Rect(x, y + GuiSizes.Margin + i * GuiSizes.LabelHeight, 200, GuiSizes.LabelHeight), dataToShow[i]);
GUI.Label(new Rect(x, y + GuiSizes.Margin + i * GuiSizes.LabelHeight, width, GuiSizes.LabelHeight), dataToShow[i]);
}
}

Expand Down

0 comments on commit 07817b0

Please sign in to comment.