Merge pull request #5982 from kevlahnota/master2

update PlayerStatisticScene, BlurUtils
This commit is contained in:
kevlahnota
2024-08-24 12:59:14 +08:00
committed by GitHub
5 changed files with 19 additions and 11 deletions

View File

@@ -223,6 +223,10 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
return name; return name;
} }
public Boolean isFemale() {
return isFemale;
}
public float getWorldPosX() { public float getWorldPosX() {
return worldPosX; return worldPosX;
} }

View File

@@ -12,6 +12,7 @@ import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Scaling; import com.badlogic.gdx.utils.Scaling;
import com.github.tommyettinger.textra.TextraButton; import com.github.tommyettinger.textra.TextraButton;
import com.github.tommyettinger.textra.TextraLabel; import com.github.tommyettinger.textra.TextraLabel;
import com.github.tommyettinger.textra.TypingLabel;
import forge.Forge; import forge.Forge;
import forge.adventure.character.EnemySprite; import forge.adventure.character.EnemySprite;
import forge.adventure.data.EnemyData; import forge.adventure.data.EnemyData;
@@ -44,7 +45,8 @@ public class PlayerStatisticScene extends UIScene {
TextraLabel wins, totalWins, eventWins, eventMatchWins; TextraLabel wins, totalWins, eventWins, eventMatchWins;
TextraLabel loss, totalLoss, eventLosses, eventMatchLosses; TextraLabel loss, totalLoss, eventLosses, eventMatchLosses;
TextraLabel winloss, lossWinRatio, eventLossWinRatio, eventMatchLossWinRatio; TextraLabel winloss, lossWinRatio, eventLossWinRatio, eventMatchLossWinRatio;
TextraLabel playerName, headerAchievements, headerAvatar, headerName, headerWinLoss; TextraLabel headerAchievements, headerAvatar, headerName, headerWinLoss;
TypingLabel playerName;
TextraButton back, toggleAward; TextraButton back, toggleAward;
private final Table scrollContainer, achievementContainer; private final Table scrollContainer, achievementContainer;
TextraLabel blessingScroll; TextraLabel blessingScroll;
@@ -196,7 +198,9 @@ public class PlayerStatisticScene extends UIScene {
scrollContainer.clear(); scrollContainer.clear();
if (playerName != null) { if (playerName != null) {
playerName.setText(GamePlayerUtil.getGuiPlayer().getName()); String gender = Current.player().isFemale() ? "{GRADIENT=MAGENTA;MAUVE;1;1}\u2640{ENDGRADIENT}[BLACK] " : "{GRADIENT=CYAN;BLUE;1;1}\u2642{ENDGRADIENT}[BLACK] ";
playerName.setText(gender + GamePlayerUtil.getGuiPlayer().getName());
playerName.skipToTheEnd();
} }
if (avatar != null) { if (avatar != null) {
avatar.setDrawable(new TextureRegionDrawable(Current.player().avatar())); avatar.setDrawable(new TextureRegionDrawable(Current.player().avatar()));

View File

@@ -275,7 +275,7 @@ public class BlurUtils {
int y = (int)(pixmap.getHeight()*0.35f); int y = (int)(pixmap.getHeight()*0.35f);
int width = pixmap.getWidth()-x; int width = pixmap.getWidth()-x;
int height = pixmap.getHeight()-y; int height = pixmap.getHeight()-y;
return blur(pixmap, x/2, y/2, width, height, 0, 0, width, height, radius, iterations, disposePixmap); return blur(pixmap, x/2, y/2, width, height, 0, 0, width/4, height/4, radius, iterations, disposePixmap);
} }
/** /**

View File

@@ -37,7 +37,7 @@
{ {
"type": "Image", "type": "Image",
"name": "avatar", "name": "avatar",
"x": 321, "x": 384,
"y": 28, "y": 28,
"width": 64, "width": 64,
"height": 64 "height": 64
@@ -46,7 +46,7 @@
"type": "Image", "type": "Image",
"name": "colorFrame", "name": "colorFrame",
"image": "ui/colorC.png", "image": "ui/colorC.png",
"x": 305, "x": 368,
"y": 45, "y": 45,
"width": 64, "width": 64,
"height": 64 "height": 64
@@ -137,9 +137,9 @@
"y": 224 "y": 224
}, },
{ {
"type": "Label", "type": "TypingLabel",
"name": "playerName", "name": "playerName",
"x": 394, "x": 310,
"y": 20, "y": 20,
"width": 80, "width": 80,
"height": 24, "height": 24,
@@ -150,7 +150,7 @@
"name": "lifePoints", "name": "lifePoints",
"width": 64, "width": 64,
"height": 16, "height": 16,
"x": 394, "x": 310,
"y": 40 "y": 40
}, },
{ {
@@ -158,7 +158,7 @@
"name": "money", "name": "money",
"width": 64, "width": 64,
"height": 16, "height": 16,
"x": 394, "x": 310,
"y": 80 "y": 80
}, },
{ {
@@ -166,7 +166,7 @@
"name": "shards", "name": "shards",
"width": 64, "width": 64,
"height": 16, "height": 16,
"x": 394, "x": 310,
"y": 60 "y": 60
}, },
{ {

View File

@@ -136,7 +136,7 @@
"y": 440 "y": 440
}, },
{ {
"type": "Label", "type": "TypingLabel",
"name": "playerName", "name": "playerName",
"x": 98, "x": 98,
"y": 4, "y": 4,