v0.3.4b: added choice of classic font (needs more character support)
This commit is contained in:
parent
7b427ed9c2
commit
295fb19fb6
BIN
assets/pixelfont.ttf
Normal file
BIN
assets/pixelfont.ttf
Normal file
Binary file not shown.
|
@ -42,6 +42,7 @@ enum Preferences {
|
|||
public static final String KEY_FLIPTAGS = "flip_tags";
|
||||
public static final String KEY_BARMODE = "toolbar_mode";
|
||||
public static final String KEY_LANG = "language";
|
||||
public static final String KEY_CLASSICFONT = "classic_font";
|
||||
public static final String KEY_INTRO = "intro";
|
||||
public static final String KEY_BRIGHTNESS = "brightness";
|
||||
public static final String KEY_VERSION = "version";
|
||||
|
|
|
@ -114,16 +114,6 @@ public class ShatteredPixelDungeon extends Game {
|
|||
protected void onCreate( Bundle savedInstanceState ) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
/* if (android.os.Build.VERSION.SDK_INT >= 19) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY );
|
||||
}*/
|
||||
|
||||
updateImmersiveMode();
|
||||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
|
@ -188,8 +178,12 @@ public class ShatteredPixelDungeon extends Game {
|
|||
Assets.SND_DEGRADE,
|
||||
Assets.SND_MIMIC );
|
||||
|
||||
if (classicFont()) {
|
||||
RenderedText.setFont("pixelfont.ttf");
|
||||
} else {
|
||||
RenderedText.setFont("font.ttf");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged( boolean hasFocus ) {
|
||||
|
@ -359,6 +353,19 @@ public class ShatteredPixelDungeon extends Game {
|
|||
else return Languages.matchCode(code);
|
||||
}
|
||||
|
||||
public static void classicFont(boolean classic){
|
||||
Preferences.INSTANCE.put(Preferences.KEY_CLASSICFONT, classic);
|
||||
if (classic) {
|
||||
RenderedText.setFont("pixelfont.ttf");
|
||||
} else {
|
||||
RenderedText.setFont("font.ttf");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean classicFont(){
|
||||
return Preferences.INSTANCE.getBoolean(Preferences.KEY_CLASSICFONT, true);
|
||||
}
|
||||
|
||||
public static void lastClass( int value ) {
|
||||
Preferences.INSTANCE.put( Preferences.KEY_LAST_CLASS, value );
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@ windows.wndsettings$uitab.center=Center
|
|||
windows.wndsettings$uitab.flip_toolbar=Flip Toolbar
|
||||
windows.wndsettings$uitab.flip_indicators=Flip Indicators
|
||||
windows.wndsettings$uitab.quickslots=Quickslots
|
||||
windows.wndsettings$uitab.classic_font=Classic Font
|
||||
windows.wndsettings$audiotab.music_vol=Music Volume
|
||||
windows.wndsettings$audiotab.music_mute=Mute Music
|
||||
windows.wndsettings$audiotab.sfx_vol=SFX Volume
|
||||
|
|
|
@ -37,7 +37,12 @@ import com.watabou.noosa.ui.Component;
|
|||
public class ChangesScene extends PixelScene {
|
||||
|
||||
private static final String TXT_Update =
|
||||
"_v0.3.4a_\n" +
|
||||
"_v0.3.4b:_\n" +
|
||||
"- New font is now optional\n" +
|
||||
"- Fixed crash issues with Italian language\n" +
|
||||
"- Translation Updates\n" +
|
||||
"\n" +
|
||||
"_v0.3.4a:_\n" +
|
||||
"- Various bugfixes\n" +
|
||||
"- Fixed text issues on Turkish devices\n" +
|
||||
"- Huntress can equip her boomerang again\n" +
|
||||
|
@ -59,14 +64,11 @@ public class ChangesScene extends PixelScene {
|
|||
"\n" +
|
||||
"_v0.3.3:_\n" +
|
||||
"- Support for Google Play Games\n" +
|
||||
"- Tengu's maze is now different each time\n" +
|
||||
"- Items no longer auto-pickup when enemies are near\n" +
|
||||
"- Added support for reverse landscape\n" +
|
||||
"\n" +
|
||||
"_v0.3.2:_\n" +
|
||||
"- Prison reworked: new enemies, quests, bosses, etc.\n" +
|
||||
"- Mastery Book is now only available after floor 10\n" +
|
||||
"- Hunger damage now increases with hero level\n" +
|
||||
"- Prison rework: new enemies, quests, bosses, etc.\n" +
|
||||
"- Mastery Book only available after floor 10\n" +
|
||||
"- Hunger damage now scales with hero level\n" +
|
||||
"- Earlygame balance changes\n" +
|
||||
"- Warlock subclass overhauled\n" +
|
||||
"\n" +
|
||||
|
@ -76,7 +78,7 @@ public class ChangesScene extends PixelScene {
|
|||
"\n" +
|
||||
"_v0.3.0:_\n" +
|
||||
"- Wands completely reworked\n" +
|
||||
"- Mage class reworked, now starts with a unique staff\n" +
|
||||
"- Mage reworked, starts with a unique staff\n" +
|
||||
"- Battlemage subclass reworked\n" +
|
||||
"- Warlock subclass reworked\n" +
|
||||
"\n" +
|
||||
|
|
|
@ -38,16 +38,19 @@ import com.watabou.noosa.audio.Sample;
|
|||
public class WndSettings extends WndTabbed {
|
||||
|
||||
private static final int WIDTH = 112;
|
||||
private static final int HEIGHT = 112;
|
||||
private static final int HEIGHT = 124;
|
||||
private static final int SLIDER_HEIGHT = 25;
|
||||
private static final int BTN_HEIGHT = 20;
|
||||
private static final int GAP_SML = 2;
|
||||
private static final int GAP_LRG = 10;
|
||||
private static final int GAP_TINY = 2;
|
||||
private static final int GAP_SML = 5;
|
||||
private static final int GAP_LRG = 12;
|
||||
|
||||
private ScreenTab screen;
|
||||
private UITab ui;
|
||||
private AudioTab audio;
|
||||
|
||||
private static int last_index = 0;
|
||||
|
||||
public WndSettings() {
|
||||
super();
|
||||
|
||||
|
@ -65,6 +68,7 @@ public class WndSettings extends WndTabbed {
|
|||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
screen.visible = screen.active = value;
|
||||
if (value) last_index = 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -73,6 +77,7 @@ public class WndSettings extends WndTabbed {
|
|||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
ui.visible = ui.active = value;
|
||||
if (value) last_index = 1;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -81,6 +86,7 @@ public class WndSettings extends WndTabbed {
|
|||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
audio.visible = audio.active = value;
|
||||
if (value) last_index = 2;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -88,7 +94,7 @@ public class WndSettings extends WndTabbed {
|
|||
|
||||
layoutTabs();
|
||||
|
||||
select(0);
|
||||
select(last_index);
|
||||
|
||||
}
|
||||
|
||||
|
@ -173,7 +179,7 @@ public class WndSettings extends WndTabbed {
|
|||
Toolbar.updateLayout();
|
||||
}
|
||||
};
|
||||
btnSplit.setRect( 1, barDesc.y + barDesc.height(), 36, BTN_HEIGHT);
|
||||
btnSplit.setRect( 1, barDesc.y + barDesc.baseLine()+GAP_TINY, 36, 16);
|
||||
add(btnSplit);
|
||||
|
||||
RedButton btnGrouped = new RedButton(Messages.get(this, "group")){
|
||||
|
@ -183,7 +189,7 @@ public class WndSettings extends WndTabbed {
|
|||
Toolbar.updateLayout();
|
||||
}
|
||||
};
|
||||
btnGrouped.setRect( btnSplit.right()+1, barDesc.y + barDesc.height(), 36, BTN_HEIGHT);
|
||||
btnGrouped.setRect( btnSplit.right()+1, barDesc.y + barDesc.baseLine()+GAP_TINY, 36, 16);
|
||||
add(btnGrouped);
|
||||
|
||||
RedButton btnCentered = new RedButton(Messages.get(this, "center")){
|
||||
|
@ -193,7 +199,7 @@ public class WndSettings extends WndTabbed {
|
|||
Toolbar.updateLayout();
|
||||
}
|
||||
};
|
||||
btnCentered.setRect(btnGrouped.right()+1, barDesc.y + barDesc.height(), 36, BTN_HEIGHT);
|
||||
btnCentered.setRect(btnGrouped.right()+1, barDesc.y + barDesc.baseLine()+GAP_TINY, 36, 16);
|
||||
add(btnCentered);
|
||||
|
||||
CheckBox chkFlipToolbar = new CheckBox(Messages.get(this, "flip_toolbar")){
|
||||
|
@ -204,11 +210,11 @@ public class WndSettings extends WndTabbed {
|
|||
Toolbar.updateLayout();
|
||||
}
|
||||
};
|
||||
chkFlipToolbar.setRect(0, btnGrouped.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);
|
||||
chkFlipToolbar.setRect(0, btnGrouped.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||
chkFlipToolbar.checked(ShatteredPixelDungeon.flipToolbar());
|
||||
add(chkFlipToolbar);
|
||||
|
||||
CheckBox chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
|
||||
final CheckBox chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
|
@ -216,7 +222,7 @@ public class WndSettings extends WndTabbed {
|
|||
GameScene.layoutTags();
|
||||
}
|
||||
};
|
||||
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);
|
||||
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||
chkFlipTags.checked(ShatteredPixelDungeon.flipTags());
|
||||
add(chkFlipTags);
|
||||
|
||||
|
@ -228,8 +234,21 @@ public class WndSettings extends WndTabbed {
|
|||
}
|
||||
};
|
||||
slots.setSelectedValue(ShatteredPixelDungeon.quickSlots());
|
||||
slots.setRect(0, chkFlipTags.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
|
||||
slots.setRect(0, chkFlipTags.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
|
||||
add(slots);
|
||||
|
||||
CheckBox chkFont = new CheckBox(Messages.get(this, "classic_font")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.classicFont(checked());
|
||||
PixelScene.windowOnCreate = WndSettings.class;
|
||||
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass());
|
||||
}
|
||||
};
|
||||
chkFont.setRect(0, slots.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);
|
||||
chkFont.checked(ShatteredPixelDungeon.classicFont());
|
||||
add(chkFont);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user