Skip to content

Commit

Permalink
desktop ui, missing strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhael-Danilov committed Jan 8, 2025
1 parent f405644 commit d342a0a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public void onSelect(int index) {

private class LoadGameOptions extends WndOptions {
public LoadGameOptions() {
super(StringsManager.getVar(R.string.StartScene_Load), "Continue your latest game or choose from a save slot", "Continue_your_latest_game", "Choose from a save slot");
super(StringsManager.getVar(R.string.StartScene_Load), StringsManager.getVar(R.string.StartScene_ContinueLatest), "Continue_your_latest_game", StringsManager.getVar(R.string.StartScene_ChooseFromSlot));
var info = GamesInProgress.check(curShield.cl);
IconButton newGameButton = ((IconButton)buttonsVbox.getMember(0));
if (info == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.nyrds.util.GuiProperties;
import com.nyrds.util.Util;
import com.watabou.gltextures.TextureCache;
import com.watabou.noosa.Group;
import com.watabou.noosa.Image;
import com.watabou.noosa.Text;
import com.watabou.noosa.TouchArea;
Expand All @@ -15,17 +14,19 @@
import com.watabou.pixeldungeon.scenes.PixelScene;
import com.watabou.pixeldungeon.ui.BuffIndicator;
import com.watabou.pixeldungeon.ui.ImageButton;
import com.watabou.pixeldungeon.windows.elements.TabContent;

import lombok.val;

class BuffsTab extends Group {
class BuffsTab extends TabContent {

private static final int GAP = 2;

private float pos;

public BuffsTab(final Char chr) {
public BuffsTab(final Char chr, int width) {
chr.forEachBuff(this::buffSlot);
this.width = width;
}

private void buffSlot(CharModifier buff) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.nyrds.pixeldungeon.ml.R;
import com.nyrds.pixeldungeon.utils.CharsList;
import com.nyrds.platform.util.PUtil;
import com.nyrds.platform.util.StringsManager;
import com.nyrds.util.GuiProperties;
import com.watabou.noosa.Text;
Expand All @@ -21,7 +22,7 @@ class StatsTab extends TabContent {

private float pos;

public StatsTab(final Char chr) {
public StatsTab(final Char chr, int width) {
Text title = PixelScene.createText(
Utils.format(R.string.WndHero_StaTitle, chr.lvl(), chr.className()).toUpperCase(), GuiProperties.titleFontSize());
title.hardlight(Window.TITLE_COLOR);
Expand Down Expand Up @@ -122,6 +123,7 @@ protected void onClick() {
statSlot(R.string.WndHero_SkillLevel, chr.skillLevel());

pos += GAP;
setMaxWidth(width);
}

private void statSlot(int label, String value) {
Expand All @@ -131,7 +133,9 @@ private void statSlot(int label, String value) {
add(txt);

txt = PixelScene.createText(value, GuiProperties.regularFontSize());
txt.setX(PixelScene.align(WndChar.WIDTH * 0.65f));

txt.setX(PixelScene.align(maxWidth - txt.width() - GAP));
PUtil.slog("text","txt:"+txt.width());
txt.setY(pos);
add(txt);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.nyrds.LuaInterface;
import com.nyrds.pixeldungeon.ml.R;
import com.nyrds.platform.game.RemixedDungeon;
import com.nyrds.platform.util.StringsManager;
import com.watabou.pixeldungeon.actors.Char;
import com.watabou.pixeldungeon.actors.CharUtils;
Expand All @@ -15,7 +16,8 @@

public class WndChar extends WndTabbed {
public static final int WIDTH = 100;
private static final int TAB_WIDTH = 33;
public static final int L_WIDTH = 140;

private final Char target;
private final Char selector;

Expand All @@ -30,13 +32,15 @@ public WndChar(final Char chr, final Char selector) {
CharUtils.markTarget(target);
}

var desc = new CharDescTab(chr, selector, WIDTH);
int width = RemixedDungeon.landscape() ? L_WIDTH : WIDTH;

var desc = new CharDescTab(chr, selector, width);
add(desc);

var stats = new StatsTab(chr);
var stats = new StatsTab(chr, width);
add(stats);

var buffs = new BuffsTab(chr);
var buffs = new BuffsTab(chr, width);
add(buffs);


Expand Down Expand Up @@ -72,11 +76,10 @@ public void select(boolean value) {
}

for (Tab tab : tabs) {
tab.setSize(TAB_WIDTH, tabHeight());
tab.setSize((float) width /3, tabHeight());
}


resize(WIDTH, (int) Utils.max(desc.height() + GAP,stats.height() + GAP, buffs.height() + GAP));
resize(width, (int) Utils.max(desc.height() + GAP, stats.height() + GAP, buffs.height() + GAP));

select(0);
}
Expand Down
2 changes: 2 additions & 0 deletions RemixedDungeon/src/main/res/values/strings_all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2979,5 +2979,7 @@ No, there was no place for her in the light, not anymore. She turned from the me

<string name="Badges_ThisIsSparta">This is Sparta!!!</string>
<string name="WndSettings_FpsLimit">FPS limit</string>
<string name="StartScene_ContinueLatest">Continue your latest game or choose from a save slot</string>
<string name="StartScene_ChooseFromSlot">Choose from a save slot</string>

</resources>

0 comments on commit d342a0a

Please sign in to comment.