Update V0.6.4.0-Beta12

This commit is contained in:
LingASDJ 2023-08-22 21:27:52 +08:00
parent bab2a554c7
commit 670dbaf732
49 changed files with 1023 additions and 308 deletions

View File

@ -3,7 +3,10 @@ apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion appAndroidCompileSDK
compileSdkVersion 30
buildToolsVersion "30.0.2"
// compileSdkVersion appAndroidCompileSDK
compileOptions.sourceCompatibility = compileOptions.targetCompatibility = appJavaCompatibility
sourceSets.main.assets.srcDirs = [new File(project(':core').projectDir, "/src/main/assets")]
@ -81,8 +84,6 @@ dependencies {
implementation project(path: ':services:news:shatteredNews')
implementation project(path: ':services:analyticsfirebase')
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"

View File

@ -33,7 +33,6 @@ import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.badlogic.gdx.backends.android.AndroidAudio;
import com.badlogic.gdx.backends.android.AsynchronousAndroidAudio;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.services.news.GameNesImpl;
@ -48,8 +47,6 @@ public class AndroidGame extends AndroidApplication {
public static AndroidApplication instance;
public FirebaseAnalytics mFirebaseAnalytics;
private static AndroidPlatformSupport support;
@Override

View File

@ -198,7 +198,8 @@ public class AndroidPlatformSupport extends PlatformSupport {
} else if (Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/DroidSans.ttf"));
}
if (!systemfont) {
if (basicFontGenerator == null) {
basicFontGenerator = fallbackFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
}
@ -206,7 +207,7 @@ public class AndroidPlatformSupport extends PlatformSupport {
fallbackFontGenerator = basicFontGenerator;
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
}
}
//android 7.0+. all asian fonts are nicely contained in one spot
if (Gdx.files.absolute("/system/fonts/NotoSansCJK-Regular.ttc").exists()) {
@ -216,9 +217,6 @@ public class AndroidPlatformSupport extends PlatformSupport {
case JAPANESE:
typeFace = 0;
break;
// case KOREAN:
// typeFace = 1;
// break;
case HARDCHINESE:
case CHINESE:
default:
@ -284,6 +282,19 @@ public class AndroidPlatformSupport extends PlatformSupport {
break;
}
KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/fusion_pixel.ttf"));
} else {
switch (SPDSettings.language()) {
case CHINESE:
fallbackFontGenerator = SCFontGenerator;
break;
case HARDCHINESE:
fallbackFontGenerator = TCFontGenerator;
break;
case JAPANESE:
fallbackFontGenerator = JPFontGenerator;
break;
}
KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansCJK-Regular.ttc"));
}
if (basicFontGenerator != null) fonts.put(basicFontGenerator, new HashMap<>());

View File

@ -18,8 +18,8 @@ allprojects {
appName = 'Magic Ling Pixel Dungeon'
appPackageName = 'com.ansdomagiclingpixeldungeon.ling'
appVersionCode =903000
appVersionName = '0.6.4.0-Beta9'
appVersionCode =906000
appVersionName = '0.6.4.0-Beta-XII'
appJavaCompatibility = JavaVersion.VERSION_11

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -155,7 +155,7 @@ badges$badge.games_played_1.desc=进行 10 场游戏,你已经知悉了地牢
badges$badge.games_played_2.title=进阶调查者
badges$badge.games_played_2.desc=进行 50 场游戏,你已经熟悉了地牢的潜规则。
badges$badge.games_played_3.title=资深调查家
badges$badge.games_played_3.desc=进行 250 场游戏,你的威望已经在地牢中传颂。
badges$badge.games_played_3.desc=进行 75 场游戏,你的威望已经在地牢中传颂。
badges$badge.games_played_4.title=大师调查员
badges$badge.games_played_4.desc=进行 100 场游戏,你的名声已经传到地表三巨头的耳里。小心夜路遇到他们哦。

View File

@ -550,6 +550,6 @@ ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x80=1.修复灯火值不扣减的错
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x81=1.优化灯火体验\n其他错误修复。
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x82=1.修复商店抢劫的一些错误\n2.修复部分崩溃错误\n3.修复Beta2古神无限循环的错误\n4.修复黄金时代的一些错误\n5.修复部分徽章获取错误问题\n6.修复部分成就无法获得的问题\n7.改善部分房间不会在1层生成为隐藏层\n7.修复商人的一些错误\n8.修复部分怪物掉落问题\n8.修复部分错误
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x82=1.修复商店抢劫的一些错误\n2.修复部分崩溃错误\n3.修复Beta2古神无限循环的错误\n4.修复黄金时代的一些错误\n5.修复部分徽章获取错误问题\n6.修复部分成就无法获得的问题\n7.改善部分房间不会在1层生成为隐藏层\n7.修复商人的一些错误\n8.修复部分怪物掉落问题\n9.修复部分错误\n10.修复系统字体导致游戏的闪退的重大错误\n11.PC布局优化,整体UI优化
//ui.changelist.mlpd.vm0_5_x_changes.xxx//

View File

@ -83,7 +83,7 @@ windows.wndshopking.yes=是的
windows.wndshopking.no=还没有
windows.wndshopking.notbad=当你准备好后,我会带你前往雪凛峡谷的最深的区域……
windows.wndsettings$extendtab.quickslots=快捷栏设置
windows.wndsettings$extendtab.quickslots=快捷栏设置(V1)
windows.wndsettings$extendtab.wxts=温馨提示:进入游戏后才能调整快捷栏\n\n这是因为技术问题但是这里已经提醒你了。\n\n当你进入游戏后,这里就会变成快捷栏设置区!
windows.wnddlc.mode=娱乐模式
@ -374,16 +374,20 @@ windows.wndsettings$displaytab.visual_grid=可视网格
windows.wndsettings$displaytab.off=关闭
windows.wndsettings$displaytab.high=高亮
windows.wndsettings$uitab.title=界面设置
windows.wndsettings$uitab.size=界面尺寸
windows.wndsettings$uitab.ui_mode=界面模式
windows.wndsettings$uitab.scale=界面尺寸
windows.wndsettings$uitab.mobile=移动端风格
windows.wndkeybindings.quickslot_switch=切换
windows.wndsettings$uitab.full=PC端风格
windows.wndsettings$uitab.toolbar_settings=工具栏设置
windows.wndsettings$uitab.mode=工具栏模式:
windows.wndsettings$uitab.split=分散
windows.wndsettings$uitab.group=组合
windows.wndsettings$uitab.center=居中
windows.wndsettings$uitab.flip_toolbar=翻转工具栏
windows.wndsettings$uitab.flip_indicators=翻转指示器
windows.wndsettings$uitab.quickslots=快捷栏
windows.wndsettings$uitab.quickslot_swapper=使用V1快捷栏
windows.wndsettings$uitab.swapper_desc=仅手机端布局可在V1,V2快捷栏进行切换\n而PC端布局只能使用V2快捷栏。{\n_注意仅V2快捷栏支持三类布局,使用V1会无效。_
windows.wndsettings$uitab.system_font=系统字体
windows.wndsettings$uitab.key_bindings=键位设置
windows.wndsettings$datatab.title=网络相关设置

View File

@ -131,8 +131,6 @@ public class Assets {
public static final String STATUS = "interfaces/status_pane.png";
public static final String TOOLBARDRAK = "interfaces/toolbar_normal.png";
public static final String STATUS_DARK = "interfaces/status_pane_normal.png";
public static final String STATUSSOUL = "interfaces/status_pane-puresoul.png";
public static final String STATUSSOUL_DARK = "interfaces/status_pane-puresoul_dark.png";
public static final String MENU = "interfaces/menu_pane.png";
public static final String MENU_BTN = "interfaces/menu_button.png";
public static final String TOOLBAR = "interfaces/toolbar.png";

View File

@ -1009,10 +1009,10 @@ public class Badges {
if (Rankings.INSTANCE.totalNumber >= 50) {
badge = Badge.GAMES_PLAYED_2;
}
if (Rankings.INSTANCE.totalNumber >= 250) {
if (Rankings.INSTANCE.totalNumber >= 75) {
badge = Badge.GAMES_PLAYED_3;
}
if (Rankings.INSTANCE.totalNumber >= 1000) {
if (Rankings.INSTANCE.totalNumber >= 100) {
badge = Badge.GAMES_PLAYED_4;
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.custom.utils.Constants;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.watabou.utils.Bundlable;
import com.watabou.utils.Bundle;
@ -38,8 +37,12 @@ public class QuickSlot {
*/
//note that the current max size is coded at 4, due to UI constraints, but it could be much much bigger with no issue.
public static int SIZE = Constants.MAX_QUICKSLOTS;
private Item[] slots = new Item[SIZE];
public static int SIZE = 12;
public static int VSIZE = 9;
public int quickslots;
private Item[] slots = new Item[SIZE];
//direct array interaction methods, everything should build from these methods.

View File

@ -55,6 +55,8 @@ public class SPDAction extends GameAction {
public static final GameAction SE = new SPDAction("se");
public static final GameAction WAIT = new SPDAction("wait");
public static final GameAction SLPD = new SPDAction("slpd");
public static final GameAction INVENTORY = new SPDAction("inventory");
public static final GameAction QUICKSLOT_1 = new SPDAction("quickslot_1");
public static final GameAction QUICKSLOT_2 = new SPDAction("quickslot_2");
@ -101,6 +103,8 @@ public class SPDAction extends GameAction {
defaultBindings.put( Input.Keys.D, SPDAction.E );
defaultBindings.put( Input.Keys.SPACE, SPDAction.WAIT );
defaultBindings.put( Input.Keys.K, SPDAction.SLPD );
defaultBindings.put( Input.Keys.UP, SPDAction.N );
defaultBindings.put( Input.Keys.LEFT, SPDAction.W );
defaultBindings.put( Input.Keys.DOWN, SPDAction.S );

View File

@ -137,6 +137,8 @@ public class SPDSettings extends GameSettings {
private static final String ATBSettings = "ATBsettings";
private static final String V1TOOL = "v1tool";
public static void fullscreen( boolean value ) {
put( KEY_FULLSCREEN, value );
@ -231,7 +233,7 @@ public class SPDSettings extends GameSettings {
}
public static int interfaceSize(){
int size = getInt( KEY_UI_SIZE, DeviceCompat.isDesktop() ? 2 : 0 );
int size = getInt( KEY_UI_SIZE, DeviceCompat.isDesktop() ? 1 : 0 );
if (size > 0){
//force mobile UI if there is not enough space for full UI
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
@ -240,6 +242,10 @@ public class SPDSettings extends GameSettings {
size = 0;
}
}
if(size == 2){
size = 1;
}
return size;
}
@ -429,6 +435,10 @@ public class SPDSettings extends GameSettings {
}
}
public static void systemFont(boolean value){
put(KEY_SYSTEMFONT, value);
}
public static boolean systemFont(){
return getBoolean(KEY_SYSTEMFONT,
(language() == Languages.CHINESE || language() == Languages.JAPANESE));
@ -544,4 +554,10 @@ public class SPDSettings extends GameSettings {
public static void ClassPage(boolean value) {
put( KEY_PAGE, value );
}
public static boolean quickSwapper() {
return getBoolean(V1TOOL, false);
}
public static void quickSwapper(boolean value ){ put( V1TOOL, value ); }
}

View File

@ -37,7 +37,7 @@ public class Rat extends Mob {
HP = HT = 8;
defenseSkill = 2;
maxLvl = 30;
maxLvl = 5;
}
@Override

View File

@ -1,15 +1,9 @@
package com.shatteredpixel.shatteredpixeldungeon.custom.utils;
import com.watabou.noosa.Game;
public class Constants {
public static final int MAX_DEPTH = 26;
public static final int MAX_QUICKSLOTS = 12;
public static final int MOX_QUICKSLOTS = 8;
public static final int MOX_QUICKSLOTS = 4;
public static final int MIN_QUICKSLOTS = 3;
public static boolean gameIsAndroid(){
return Game.platform.getClass().getSimpleName().contains("Android");
}
}

View File

@ -1,7 +1,4 @@
package com.shatteredpixel.shatteredpixeldungeon.items.lightblack;
//
// Decompiled by Jadx - 759ms
//
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
@ -71,14 +68,14 @@ public class OilLantern extends Item {
}
public void storeInBundle(Bundle bundle) {
OilLantern.super.storeInBundle(bundle);
super.storeInBundle(bundle);
bundle.put(ACTIVE, this.active);
bundle.put(CHARGE, this.charge);
bundle.put(FLASKS, this.flasks);
}
public void restoreFromBundle(Bundle bundle) {
OilLantern.super.restoreFromBundle(bundle);
super.restoreFromBundle(bundle);
this.active = bundle.getBoolean(ACTIVE);
this.charge = bundle.getInt(CHARGE);
this.flasks = bundle.getInt(FLASKS);
@ -146,7 +143,7 @@ public class OilLantern extends Item {
}
public void refills(Hero hero) {
this.flasks--;
this.plingks--;
this.charge += Math.min(MIX_CHARGE,100);
hero.spend(TIME_TO_USE);
hero.busy();

View File

@ -12,7 +12,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.SRPDHBLR;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -83,8 +82,7 @@ public class EyeRoom extends SpecialRoom {
int chestPos = (top + 6) * level.width() + left + 6;
/** 套五个宝箱 */
level.drop( new Gold(),chestPos).type = Heap.Type.TELECRYSTL;
/** 套4个宝箱 */
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.POTION ) ), CrystalMimic.class));
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.SCROLL ) ), CrystalMimic.class));
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.WEAPON ) ),

View File

@ -8,6 +8,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -120,11 +121,11 @@ public class YinYangRoom extends SpecialRoom {
if(Dungeon.depth == 1){
door.set(Door.Type.REGULAR);
} else {
door.set(Door.Type.HIDDEN);
door.set(Door.Type.LOCKED);
}
}
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
level.addItemToSpawn( new CrystalKey( Dungeon.depth ) );
level.addItemToSpawn( new PotionOfLevitation());

View File

@ -120,6 +120,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Tag;
import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.Toast;
import com.shatteredpixel.shatteredpixeldungeon.ui.ToobarV;
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -217,7 +218,8 @@ public class GameScene extends PixelScene {
private InventoryPane inventory;
private static boolean invVisible = true;
private Toolbar toolbar;
private ToobarV toolbar;
private Toolbar toolbarv1;
private Toast prompt;
private AttackIndicator attack;
@ -414,19 +416,35 @@ public class GameScene extends PixelScene {
bringToFront(status);
}
toolbar = new Toolbar();
toolbar.camera = uiCamera;
add( toolbar );
/**Toolbar V1+V2 */
if(SPDSettings.quickSwapper()) {
toolbarv1 = new Toolbar();
toolbarv1.camera = uiCamera;
add(toolbarv1);
} else {
toolbar = new ToobarV();
toolbar.camera = uiCamera;
add( toolbar );
}
if (uiSize == 2) {
inventory = new InventoryPane();
inventory.camera = uiCamera;
inventory.setPos(uiCamera.width - inventory.width(), uiCamera.height - inventory.height());
add(inventory);
toolbar.setRect( 0, uiCamera.height - toolbar.height() - inventory.height(), uiCamera.width, toolbar.height() );
if(SPDSettings.quickSwapper()) {
toolbarv1.setRect(0, uiCamera.height - toolbarv1.height() - inventory.height(), uiCamera.width,
toolbarv1.height());
} else {
toolbar.setRect(0, uiCamera.height - toolbar.height() - inventory.height(), uiCamera.width, toolbar.height());
}
} else {
toolbar.setRect( 0, uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
if(SPDSettings.quickSwapper()) {
toolbarv1.setRect(0, uiCamera.height - toolbarv1.height(), uiCamera.width, toolbarv1.height());
} else {
toolbar.setRect(0, uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height());
}
}
layoutTags();
@ -935,7 +953,9 @@ public class GameScene extends PixelScene {
float invWidth = (scene.inventory != null && scene.inventory.visible) ? scene.inventory.width() : 0;
float y = SPDSettings.interfaceSize() == 0 ? scene.toolbar.top()-2 : scene.status.top()-2;
float y = SPDSettings.interfaceSize() == 0 ? SPDSettings.quickSwapper()? scene.toolbarv1.top()-2:
scene.toolbar.top()-2 :
scene.status.top()-2;
if (tagsOnLeft) {
scene.log.setRect(tagWidth, y, uiCamera.width - tagWidth - insets.right - invWidth, 0);
} else if (invWidth > 0) {
@ -944,7 +964,7 @@ public class GameScene extends PixelScene {
scene.log.setRect(insets.left, y, uiCamera.width - tagWidth - insets.left, 0);
}
float pos = scene.toolbar.top();
float pos = SPDSettings.quickSwapper()?scene.toolbarv1.top():scene.toolbar.top();
if (tagsOnLeft && SPDSettings.interfaceSize() > 0){
pos = scene.status.top();
}
@ -1190,7 +1210,13 @@ public class GameScene extends PixelScene {
}
public static void pickUp( Item item, int pos ) {
if (scene != null) scene.toolbar.pickup( item, pos );
if (scene != null){
if (SPDSettings.quickSwapper()) {
scene.toolbarv1.pickup(item, pos);
} else {
scene.toolbar.pickup(item, pos);
}
}
}
public static void pickUpJournal( Item item, int pos ) {
@ -1308,10 +1334,19 @@ public class GameScene extends PixelScene {
if (scene != null && scene.inventory != null){
if (scene.inventory.visible){
scene.inventory.visible = scene.inventory.active = invVisible = false;
scene.toolbar.setPos(scene.toolbar.left(), uiCamera.height-scene.toolbar.height());
if(SPDSettings.quickSwapper()){
scene.toolbarv1.setPos(scene.toolbarv1.left(), uiCamera.height-scene.toolbarv1.height());
} else {
scene.toolbar.setPos(scene.toolbar.left(), uiCamera.height-scene.toolbar.height());
}
} else {
scene.inventory.visible = scene.inventory.active = invVisible = true;
scene.toolbar.setPos(scene.toolbar.left(), scene.inventory.top()-scene.toolbar.height());
if(SPDSettings.quickSwapper()) {
scene.toolbarv1.setPos(scene.toolbarv1.left(), scene.inventory.top() - scene.toolbarv1.height());
} else {
scene.toolbar.setPos(scene.toolbar.left(), scene.inventory.top() - scene.toolbar.height());
}
}
layoutTags();
}
@ -1605,7 +1640,18 @@ public class GameScene extends PixelScene {
selectCell( defaultCellListener );
QuickSlotButton.cancel();
InventoryPane.cancelTargeting();
if (scene != null && scene.toolbar != null) scene.toolbar.examining = false;
if(SPDSettings.quickSwapper()){
if (scene != null && scene.toolbarv1 != null){
scene.toolbarv1.examining = false;
}
} else {
if (scene != null && scene.toolbar != null){
scene.toolbar.examining = false;
}
}
}
public static void checkKeyHold(){

View File

@ -147,12 +147,12 @@ public class PixelScene extends Scene {
renderedTextPageSize = 1024;
}
//asian languages have many more unique characters, so increase texture size to anticipate that
if
(Messages.lang() == Languages.CHINESE ||
//asian languages have many more unique characters, so increase texture size to anticipate that
if (Messages.lang() == Languages.CHINESE ||
Messages.lang() == Languages.JAPANESE){
renderedTextPageSize *= 2;
}
Game.platform.setupFontGenerators(renderedTextPageSize, false);
Game.platform.setupFontGenerators(renderedTextPageSize, SPDSettings.systemFont());
Tooltip.resetLastUsedTime();

View File

@ -1,5 +0,0 @@
package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase;
public class Beta {
public static FireBaseService service;
}

View File

@ -166,11 +166,15 @@ public class BossHealthBar extends Component {
float health = boss.HP;
float shield = boss.shielding();
float max = boss.HT;
int maxHp = boss.HP;
hp.scale.x = Math.max( 0, (health-shield)/max);
shieldedHP.scale.x = health/max;
rawShielding.scale.x = shield/max;
if (hp.scale.x < 0.25f){
bleed( true );
}
if (shield <= 0){
hpText.text(health + "/" + max);
}

View File

@ -66,7 +66,7 @@ public class JoinIndicator extends Button {
bg.hardlight(0x00ffff);
add(bg);
add(slot = new Toolbar.Tool(48, 26, 48, 72) {
add(slot = new Toolbar.Tool(48, 26, 24, 72) {
@Override
protected void onClick() {

View File

@ -70,6 +70,10 @@ public class QuickSlotButton extends Button {
reset();
}
public void slotMargins( int left, int top, int right, int bottom){
slot.setMargins(left, top, right, bottom);
}
public static void reset() {
instance = new QuickSlotButton[Constants.MAX_QUICKSLOTS];

View File

@ -104,7 +104,7 @@ public class StatusPane extends Component {
public JoinIndicator joinxxx;
public LanterFireCator lanter;
private static String asset = Assets.Interfaces.STATUS;
private static String asset = Assets.Interfaces.STATUS_DARK;
private boolean large;
@ -164,8 +164,10 @@ public class StatusPane extends Component {
else hg = new Image(asset, 0, 45, 49, 4);
add( hg );
if (large) icehp = new Image(asset, 0, 128, 128, 7);
else icehp = new Image(asset, 0, 49, 52, 4);
if (large)
icehp = new Image(asset, 0, 135, 128, 6);
else icehp = new Image(asset, 0, 49, 52, 4);
add( icehp );
lanterfirevae = new Image(Assets.Interfaces.LANTERLING);
@ -175,7 +177,6 @@ public class StatusPane extends Component {
hpText.alpha(0.6f);
add(hpText);
hgText = new BitmapText(PixelScene.pixelFont);
hgText.alpha(0.6f);
add(hgText);
@ -280,14 +281,18 @@ public class StatusPane extends Component {
PixelScene.align(hpText);
hg.x= x + 30;
hg.y= y + 10;
hg.y= y + 10f;
hgText.x = x+80;
hgText.y = hg.y;
PixelScene.align(hgText);
icehp.x = x+ 30;
icehp.y = y + 4;
icehp.y = y + 2f;
icehpText.x = x+80;
icehpText.y = icehp.y-0.6f;
PixelScene.align(icehpText);
expText.x = exp.x + (128 - expText.width())/2f;
expText.y = exp.y;
@ -378,6 +383,12 @@ public class StatusPane extends Component {
public void update() {
super.update();
if (SPDSettings.ClassUI()) {
asset = Assets.Interfaces.STATUS;
} else {
asset = Assets.Interfaces.STATUS_DARK;
}
int maxHunger = (int) Hunger.STARVING;
int maxPureSole = Dungeon.hero.lanterfire;
int mtPureSole = 100;

View File

@ -0,0 +1,632 @@
package com.shatteredpixel.shatteredpixeldungeon.ui;
import static com.shatteredpixel.shatteredpixeldungeon.QuickSlot.VSIZE;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTerrainTilemap;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndKeyBindings;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuickBag;
import com.watabou.gltextures.TextureCache;
import com.watabou.input.GameAction;
import com.watabou.noosa.Camera;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Gizmo;
import com.watabou.noosa.Image;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.Point;
import com.watabou.utils.PointF;
public class ToobarV extends Component {
private Tool btnWait;
private Tool btnExamine;
private Tool btnInventory;
private SwitchQuickSlotTool btnSwitchSlot;
private QuickslotTool[] btnQuick;
private int numVisibleSlots;
private PickedUpItem pickedUp;
private boolean lastEnabled = true;
public boolean examining = false;
private static ToobarV instance;
public enum Mode {
SPLIT,
GROUP,
CENTER
}
public ToobarV() {
super();
instance = this;
height = btnInventory.height();
}
@Override
protected void createChildren() {
numVisibleSlots = 2;
if (PixelScene.uiCamera.width > 120) numVisibleSlots++;
if (PixelScene.uiCamera.width > 138) numVisibleSlots++;
if (PixelScene.uiCamera.width > 156) numVisibleSlots++;
if (PixelScene.uiCamera.width > 174) numVisibleSlots++;
if (PixelScene.uiCamera.width > 192) numVisibleSlots++;
if (PixelScene.uiCamera.width > 210) numVisibleSlots++;
if (PixelScene.uiCamera.width > 228) numVisibleSlots++;
if (numVisibleSlots < VSIZE) {
numVisibleSlots--;
add( btnSwitchSlot = new SwitchQuickSlotTool( 125, 0, 16, 16) );
}
btnQuick = new QuickslotTool[VSIZE];
for (int i = 0; i < btnQuick.length; i++){
add( btnQuick[i] = new QuickslotTool(64, 0, 22, 24, i) );
}
add(btnWait = new Tool(24, 0, 20, 26) {
@Override
protected void onClick() {
if (Dungeon.hero.ready && !GameScene.cancel()) {
examining = false;
Dungeon.hero.rest(false);
}
}
@Override
public GameAction keyAction() {
return SPDAction.WAIT;
}
@Override
protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "wait"));
}
protected boolean onLongClick() {
if (Dungeon.hero.ready && !GameScene.cancel()) {
examining = false;
Dungeon.hero.rest(true);
}
return true;
}
});
add(new Button(){
@Override
protected void onClick() {
if (Dungeon.hero.ready && !GameScene.cancel()) {
examining = false;
Dungeon.hero.rest(true);
}
}
@Override
public GameAction keyAction() {
if (btnWait.active) return SPDAction.REST;
else return null;
}
});
add(btnExamine = new Tool(44, 0, 20, 26) {
@Override
protected void onClick() {
if (Dungeon.hero.ready) {
if (!examining && !GameScene.cancel()) {
GameScene.selectCell(informer);
examining = true;
} else if (examining) {
informer.onSelect(null);
Dungeon.hero.search(true);
}
}
}
@Override
public GameAction keyAction() {
return SPDAction.EXAMINE;
}
@Override
protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "examine"));
}
@Override
protected boolean onLongClick() {
Dungeon.hero.search(true);
return true;
}
});
addToBack(btnInventory = new Tool(0, 0, 24, 26) {
private GoldIndicator gold;
@Override
protected void onClick() {
if (Dungeon.hero.ready || !Dungeon.hero.isAlive()) {
if (!GameScene.cancel()) {
GameScene.show(new WndBag(Dungeon.hero.belongings.backpack));
}
}
}
@Override
public GameAction keyAction() {
return SPDAction.INVENTORY;
}
@Override
protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "inventory"));
}
@Override
protected boolean onLongClick() {
GameScene.show(new WndQuickBag(null));
return true;
}
@Override
protected void createChildren() {
super.createChildren();
gold = new GoldIndicator();
add(gold);
}
@Override
protected void layout() {
super.layout();
gold.fill(this);
}
});
add(pickedUp = new PickedUpItem());
}
@Override
protected void layout() {
float right = width;
final int quickSlots = numVisibleSlots == QuickSlot.VSIZE ? 0 : Dungeon.quickslot.quickslots;
int slotIndex;
for(int i = 0; i < numVisibleSlots; i++) {
slotIndex = boundIndex(quickSlots + i);
if (i == 0 && !SPDSettings.flipToolbar() ||
i == numVisibleSlots -1 && SPDSettings.flipToolbar()){
btnQuick[slotIndex].border(0, 2);
btnQuick[slotIndex].frame(106, 0, 19, 24);
} else if (i == 0 && SPDSettings.flipToolbar() ||
i == numVisibleSlots -1 && !SPDSettings.flipToolbar()){
btnQuick[slotIndex].border(2, 1);
btnQuick[slotIndex].frame(86, 0, 20, 24);
} else {
btnQuick[slotIndex].border(0, 1);
btnQuick[slotIndex].frame(88, 0, 18, 24);
}
}
boolean[] visible = new boolean[QuickSlot.VSIZE];
slotIndex = boundIndex(quickSlots);
visible[slotIndex] = true;
if (SPDSettings.interfaceSize() == 0) {
switch (Mode.valueOf(SPDSettings.toolbarMode())) {
case SPLIT:
btnWait.setPos(x, y);
btnExamine.setPos(btnWait.right(), y);
btnInventory.setPos(right - btnInventory.width(), y);
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
for (int i = 1; i < numVisibleSlots; i++) {
slotIndex = boundIndex(quickSlots + i);
visible[slotIndex] = true;
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
}
if (numVisibleSlots < QuickSlot.VSIZE)
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
break;
//center = group but.. well.. centered, so all we need to do is pre-emptively set the right side further in.
case CENTER:
float toolbarWidth = btnWait.width() + btnExamine.width() + btnInventory.width();
for (int i = 0; i < numVisibleSlots; i++) {
toolbarWidth += btnQuick[boundIndex(quickSlots + i)].width();
}
if (numVisibleSlots < QuickSlot.VSIZE) toolbarWidth += btnSwitchSlot.width();
right = (width + toolbarWidth) / 2;
case GROUP:
btnWait.setPos(right - btnWait.width(), y);
btnExamine.setPos(btnWait.left() - btnExamine.width(), y);
btnInventory.setPos(btnExamine.left() - btnInventory.width(), y);
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
for (int i = 1; i < numVisibleSlots; i++) {
slotIndex = boundIndex(quickSlots + i);
visible[slotIndex] = true;
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
}
if (numVisibleSlots < QuickSlot.VSIZE)
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
break;
}
} else {
btnWait.setPos(x, y);
btnExamine.setPos(btnWait.right(), y);
btnInventory.setPos(right - btnInventory.width(), y);
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
for (int i = 1; i < numVisibleSlots; i++) {
slotIndex = boundIndex(quickSlots + i);
visible[slotIndex] = true;
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
}
if (numVisibleSlots < QuickSlot.VSIZE)
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
}
for (int i = 0; i < visible.length; i ++) {
btnQuick[i].visible = visible[i];
if (!visible[i]) btnQuick[i].setPos(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
right = width;
if (SPDSettings.interfaceSize() > 0){
btnInventory.setPos( right- btnInventory.width(), y);
btnWait.setPos(right - btnInventory.width(), y/3);
btnExamine.setPos(right - btnInventory.width(), btnWait.bottom());
float toolbarWidth = btnWait.width() + btnExamine.width() + btnInventory.width();
for (int i = 0; i < numVisibleSlots; i++) {
toolbarWidth += btnQuick[boundIndex(quickSlots + i)].width();
}
if (numVisibleSlots < QuickSlot.VSIZE) toolbarWidth += btnSwitchSlot.width();
right = (width + toolbarWidth)/2;
}
if (SPDSettings.flipToolbar()) {
btnWait.setPos( (right - btnWait.right()), y);
btnExamine.setPos( (right - btnExamine.right()), y);
btnInventory.setPos( (right - btnInventory.right()), y);
for(int i = 0; i < numVisibleSlots; i++) {
slotIndex = boundIndex(quickSlots + i);
btnQuick[slotIndex].setPos( right - btnQuick[slotIndex].right(), y+2);
}
if (numVisibleSlots < QuickSlot.VSIZE) btnSwitchSlot.setPos(right - btnSwitchSlot.right(), y+10);
}
}
public static void updateLayout(){
if (instance != null) instance.layout();
}
@Override
public void update() {
super.update();
if (lastEnabled != (Dungeon.hero.ready && Dungeon.hero.isAlive())) {
lastEnabled = (Dungeon.hero.ready && Dungeon.hero.isAlive());
for (Gizmo tool : members.toArray(new Gizmo[0])) {
if (tool instanceof Tool) {
((Tool)tool).enable( lastEnabled );
}
}
}
if (!Dungeon.hero.isAlive()) {
btnInventory.enable(true);
}
}
public void pickup(Item item, int cell ) {
pickedUp.reset( item,
cell,
btnInventory.centerX(),
btnInventory.centerY());
}
private int boundIndex(int index) {
int result = index;
while (result < 0) result += QuickSlot.VSIZE;
while (result >= QuickSlot.VSIZE) result -= QuickSlot.VSIZE;
return result;
}
@SuppressWarnings("FieldMayBeFinal")
private static CellSelector.Listener informer = new CellSelector.Listener() {
@Override
public void onSelect( Integer cell ) {
instance.examining = false;
GameScene.examineCell( cell );
}
@Override
public String prompt() {
return Messages.get(Toolbar.class, "examine_prompt");
}
};
private static class SwitchQuickSlotTool extends Tool {
Tool bg;
ColorBlock[] fill;
public SwitchQuickSlotTool(int x, int y, int width, int height) {
super(x, y, width, height);
}
@Override
protected void onClick() {
//
}
private Toolbar.Tool slot;
@Override
protected void createChildren() {
super.createChildren();
bg = new Tool(72, 26, 16, 16){
@Override
protected void onClick() {
super.onClick();
Dungeon.quickslot.quickslots = instance.boundIndex(Dungeon.quickslot.quickslots + instance.numVisibleSlots);
instance.layout();
}
@Override
protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "quickslot_switch"));
}
@Override
protected boolean onLongClick() {
GameScene.show(new WndQuickBag(null));
return true;
}
@Override
protected void onPointerDown() {
Sample.INSTANCE.play( Assets.Sounds.CLICK, 0.7f, 0.7f, 1.2f );
super.onPointerDown();
}
@Override
public GameAction keyAction() {
return SPDAction.SLPD;
}
};
fill = new ColorBlock[9];
for (int i = 0; i < fill.length; i ++) {
fill[i] = new ColorBlock(4, 4, SPDSettings.ClassUI() ? 0xFF00ffff : 0xffffff00);
add(fill[i]);
}
add(bg);
}
protected void setFill(int quickslots) {
boolean[] visible = new boolean[9];
for (int i = 0; i < instance.numVisibleSlots; i ++) {
visible[instance.boundIndex(i + quickslots)] = true;
}
fill[0].x = fill[3].x = fill[6].x = x + 2;
fill[1].x = fill[4].x = fill[7].x = x + 6;
fill[2].x = fill[5].x = fill[8].x = x + 10;
fill[0].y = fill[1].y = fill[2].y = y + 2;
fill[3].y = fill[4].y = fill[5].y = y + 6;
fill[6].y = fill[7].y = fill[8].y = y + 10;
for (int i = 0; i < visible.length; i ++) {
PixelScene.align(fill[i]);
fill[i].visible = visible[i];
}
}
@Override
protected void layout(){
super.layout();
bg.x = x;
bg.y = y;
PixelScene.align(bg);
setFill(Dungeon.quickslot.quickslots);
}
}
private static class Tool extends Button {
private static final int BGCOLOR = 0x7B8073;
private Image base;
@Override
public void update() {
super.update();
if (SPDSettings.ClassUI()) {
base.texture = TextureCache.get(Assets.Interfaces.TOOLBAR);
} else {
base.texture = TextureCache.get(Assets.Interfaces.TOOLBARDRAK);
}
}
public Tool( int x, int y, int width, int height ) {
super();
hotArea.blockLevel = PointerArea.ALWAYS_BLOCK;
frame(x, y, width, height);
}
public void frame( int x, int y, int width, int height) {
base.frame( x, y, width, height );
this.width = width;
this.height = height;
}
@Override
protected void createChildren() {
super.createChildren();
base = new Image( Assets.Interfaces.TOOLBAR );
add( base );
}
@Override
protected void layout() {
super.layout();
base.x = x;
base.y = y;
}
@Override
protected void onPointerDown() {
base.brightness( 1.4f );
}
@Override
protected void onPointerUp() {
if (active) {
base.resetColor();
} else {
base.tint( BGCOLOR, 0.7f );
}
}
public void enable( boolean value ) {
if (value != active) {
if (value) {
base.resetColor();
} else {
base.tint( BGCOLOR, 0.7f );
}
active = value;
}
}
}
@SuppressWarnings("FieldMayBeFinal")
private static class QuickslotTool extends Tool {
private QuickSlotButton slot;
private int borderLeft = 2;
private int borderRight = 2;
public QuickslotTool( int x, int y, int width, int height, int slotNum ) {
super( x, y, width, height );
slot = new QuickSlotButton( slotNum );
add( slot );
}
public void border( int left, int right ){
borderLeft = left;
borderRight = right;
layout();
}
@Override
protected void layout() {
super.layout();
slot.setRect( x, y, width, height );
slot.slotMargins(borderLeft, 4, borderRight, 2);
}
@Override
public void enable( boolean value ) {
super.enable( value );
slot.enable( value );
}
}
public static class PickedUpItem extends ItemSprite {
private static final float DURATION = 0.5f;
private float startScale;
private float startX, startY;
private float endX, endY;
private float left;
public PickedUpItem() {
super();
originToCenter();
active =
visible =
false;
}
public void reset( Item item, int cell, float endX, float endY ) {
view( item );
active =
visible =
true;
PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell);
Point screen = Camera.main.cameraToScreen(tile.x, tile.y);
PointF start = camera().screenToCamera(screen.x, screen.y);
x = this.startX = start.x - width() / 2;
y = this.startY = start.y - width() / 2;
this.endX = endX - width() / 2;
this.endY = endY - width() / 2;
left = DURATION;
scale.set( startScale = Camera.main.zoom / camera().zoom );
}
@Override
public void update() {
super.update();
if ((left -= Game.elapsed) <= 0) {
visible =
active =
false;
if (emitter != null) emitter.on = false;
} else {
float p = left / DURATION;
scale.set( startScale * (float)Math.sqrt( p ) );
x = startX*p + endX*(1-p);
y = startY*p + endY*(1-p);
}
}
}
}

View File

@ -232,7 +232,7 @@ public class Toolbar extends Component {
*/
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
float hMin = Game.height / PixelScene.MIN_HEIGHT_FULL;
final int maxHorizontalQuickslots = PixelScene.landscape() ? 8 : 4;
final int maxHorizontalQuickslots = PixelScene.landscape() ? 9 : 3;
float right = width;
if (SPDSettings.interfaceSize() > 0){
btnInventory.setPos(right - btnInventory.width(), y);
@ -479,7 +479,8 @@ public class Toolbar extends Component {
@Override
protected void layout() {
super.layout();
slot.setRect( x + borderLeft, y + 2, width - borderLeft-borderRight, height - 4 );
slot.setRect( x, y, width, height );
slot.slotMargins(borderLeft, 4, borderRight, 2);
}
@Override

View File

@ -143,7 +143,7 @@ public class vM0_6_7_X_Changes {
}
public static void add_v0_6_55_Changes( ArrayList<ChangeInfo> changeInfos ) {
ChangeInfo changes = new ChangeInfo("v0.6.4.0-Beta2-9", true, "");
ChangeInfo changes = new ChangeInfo("v0.6.4.0-BetaI-XI", true, "");
changes.hardlight(Window.TITLE_COLOR);
changeInfos.add(changes);
@ -162,6 +162,9 @@ public class vM0_6_7_X_Changes {
"现实仍然有很多东西,我是时候调节一下了。\n"+
"那么还是祝各位游戏中冒险愉快吧!")));
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), ("快捷栏V1/V2"),
("快捷栏降至9个并且V1是魔绫原版快捷栏V2是碳素那边借鉴优化的快捷栏。任君挑选。")));
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.ALCH_PAGE), ("炼金界面优化"),
("炼金指南进行优化。")));

View File

@ -41,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.OptionSlider;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.ui.ToobarV;
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.ColorBlock;
@ -406,14 +407,12 @@ public class WndSettings extends WndTabbed {
RenderedTextBlock title;
ColorBlock sep1;
OptionSlider optUISize;
RenderedTextBlock barDesc;
RedButton btnSplit;
CheckBox chkFlipToolbar;
OptionSlider optUIMode;
OptionSlider optUIScale;
RedButton btnToolbarSettings;
CheckBox chkFlipTags;
ColorBlock sep2;
ColorBlock sep3;
RedButton btnKeyBindings;
CheckBox chkFont;
@Override
protected void createChildren() {
@ -427,10 +426,9 @@ public class WndSettings extends WndTabbed {
//add slider for UI size only if device has enough space to support it
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
float hMin = Game.height / PixelScene.MIN_HEIGHT_FULL;
Boolean landscape = SPDSettings.landscape();
if (Math.min(wMin, hMin) >= 2*Game.density){
optUISize = new OptionSlider(
Messages.get(this, "size"),
if (Math.min(wMin, hMin) >= 2*Game.density && !SPDSettings.quickSwapper()){
optUIMode = new OptionSlider(
Messages.get(this, "ui_mode"),
Messages.get(this, "mobile"),
Messages.get(this, "full"),
0,
@ -442,141 +440,245 @@ public class WndSettings extends WndTabbed {
ShatteredPixelDungeon.seamlessResetScene();
}
};
optUISize.setSelectedValue(SPDSettings.interfaceSize());
add(optUISize);
optUIMode.setSelectedValue(SPDSettings.interfaceSize());
add(optUIMode);
}
if ((int)Math.ceil(2* Game.density) < PixelScene.maxDefaultZoom) {
optUIScale = new OptionSlider(Messages.get(this, "scale"),
(int)Math.ceil(2* Game.density)+ "X",
PixelScene.maxDefaultZoom + "X",
(int)Math.ceil(2* Game.density),
PixelScene.maxDefaultZoom ) {
@Override
protected void onChange() {
if (getSelectedValue() != SPDSettings.scale()) {
SPDSettings.scale(getSelectedValue());
ShatteredPixelDungeon.seamlessResetScene();
}
}
};
optUIScale.setSelectedValue(PixelScene.defaultZoom);
add(optUIScale);
}
if (SPDSettings.interfaceSize() == 0) {
barDesc = PixelScene.renderTextBlock(Messages.get(this, "mode"), 9);
add(barDesc);
btnSplit = new RedButton(Messages.get(this, "split")) {
btnToolbarSettings = new RedButton(Messages.get(this, "toolbar_settings"), 9){
@Override
protected void onClick() {
SPDSettings.toolbarMode(Toolbar.Mode.SPLIT.name());
Toolbar.updateLayout();
ShatteredPixelDungeon.scene().addToFront(new Window(){
RenderedTextBlock barDesc;
RedButton btnSplit; RedButton btnGrouped; RedButton btnCentered;
CheckBox chkQuickSwapper;
RenderedTextBlock swapperDesc;
CheckBox chkFlipToolbar;
CheckBox chkFlipTags;
{
barDesc = PixelScene.renderTextBlock(Messages.get(WndSettings.UITab.this, "mode"), 9);
add(barDesc);
btnSplit = new RedButton(Messages.get(WndSettings.UITab.this, "split")) {
@Override
protected void onClick() {
textColor(TITLE_COLOR);
btnGrouped.textColor(WHITE);
btnCentered.textColor(WHITE);
SPDSettings.toolbarMode(ToobarV.Mode.SPLIT.name());
ToobarV.updateLayout();
}
};
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.SPLIT.name())) {
btnSplit.textColor(TITLE_COLOR);
}
add(btnSplit);
btnGrouped = new RedButton(Messages.get(WndSettings.UITab.this, "group")) {
@Override
protected void onClick() {
btnSplit.textColor(WHITE);
textColor(TITLE_COLOR);
btnCentered.textColor(WHITE);
SPDSettings.toolbarMode(ToobarV.Mode.GROUP.name());
ToobarV.updateLayout();
}
};
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.GROUP.name())) {
btnGrouped.textColor(TITLE_COLOR);
}
add(btnGrouped);
btnCentered = new RedButton(Messages.get(WndSettings.UITab.this, "center")) {
@Override
protected void onClick() {
btnSplit.textColor(WHITE);
btnGrouped.textColor(WHITE);
textColor(TITLE_COLOR);
SPDSettings.toolbarMode(ToobarV.Mode.CENTER.name());
ToobarV.updateLayout();
}
};
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.CENTER.name())) {
btnCentered.textColor(TITLE_COLOR);
}
add(btnCentered);
if(SPDSettings.quickSwapper()){
btnSplit.alpha(0.5f);
btnGrouped.alpha(0.5f);
btnCentered.alpha(0.5f);
btnCentered.active = false;
btnGrouped.active = false;
btnSplit.active = false;
}
chkQuickSwapper = new CheckBox(Messages.get(WndSettings.UITab.this, "quickslot_swapper")) {
@Override
protected void onClick() {
super.onClick();
SPDSettings.quickSwapper(checked());
ShatteredPixelDungeon.resetScene();
}
};
chkQuickSwapper.checked(SPDSettings.quickSwapper());
add(chkQuickSwapper);
swapperDesc = PixelScene.renderTextBlock(Messages.get(WndSettings.UITab.this, "swapper_desc"), 5);
swapperDesc.hardlight(0x888888);
add(swapperDesc);
chkFlipToolbar = new CheckBox(Messages.get(WndSettings.UITab.this, "flip_toolbar")) {
@Override
protected void onClick() {
super.onClick();
SPDSettings.flipToolbar(checked());
//ToobarV.updateLayout();
}
};
chkFlipToolbar.checked(SPDSettings.flipToolbar());
add(chkFlipToolbar);
chkFlipTags = new CheckBox(Messages.get(WndSettings.UITab.this, "flip_indicators")){
@Override
protected void onClick() {
super.onClick();
SPDSettings.flipTags(checked());
GameScene.layoutTags();
}
};
chkFlipTags.checked(SPDSettings.flipTags());
add(chkFlipTags);
//layout
resize(WIDTH_P, 0);
barDesc.setPos((width - barDesc.width()) / 2f, GAP);
PixelScene.align(barDesc);
int btnWidth = (int) (width - 2 * GAP) / 3;
btnSplit.setRect(0, barDesc.bottom() + GAP, btnWidth, BTN_HEIGHT-2);
btnGrouped.setRect(btnSplit.right() + GAP, btnSplit.top(), btnWidth, BTN_HEIGHT-2);
btnCentered.setRect(btnGrouped.right() + GAP, btnSplit.top(), btnWidth, BTN_HEIGHT-2);
chkQuickSwapper.setRect(0, btnGrouped.bottom() + GAP, width, BTN_HEIGHT);
swapperDesc.maxWidth(width);
swapperDesc.setPos(0, chkQuickSwapper.bottom()+1);
if (width > 200) {
chkFlipToolbar.setRect(0, swapperDesc.bottom() + GAP, width / 2 - 1, BTN_HEIGHT);
chkFlipTags.setRect(chkFlipToolbar.right() + GAP, chkFlipToolbar.top(), width / 2 - 1, BTN_HEIGHT);
} else {
chkFlipToolbar.setRect(0, swapperDesc.bottom() + GAP, width, BTN_HEIGHT);
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP, width, BTN_HEIGHT);
}
resize(WIDTH_P, (int)chkFlipTags.bottom());
}
});
}
};
if (SPDSettings.toolbarMode().equals(Toolbar.Mode.SPLIT.name()))
btnSplit.textColor(TITLE_COLOR);
add(btnSplit);
add(btnToolbarSettings);
chkFlipToolbar = new CheckBox(Messages.get(this, "flip_toolbar")) {
} else {
chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")) {
@Override
protected void onClick() {
super.onClick();
SPDSettings.flipToolbar(checked());
Toolbar.updateLayout();
SPDSettings.flipTags(checked());
GameScene.layoutTags();
}
};
chkFlipToolbar.checked(SPDSettings.flipToolbar());
add(chkFlipToolbar);
}
chkFlipTags.checked(SPDSettings.flipTags());
add(chkFlipTags);
chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
@Override
protected void onClick() {
super.onClick();
SPDSettings.flipTags(checked());
GameScene.layoutTags();
}
};
chkFlipTags.checked(SPDSettings.flipTags());
add(chkFlipTags);
}
sep2 = new ColorBlock(1, 1, 0xFF000000);
add(sep2);
// chkFont = new CheckBox(Messages.get(this, "system_font")){
// @Override
// protected void onClick() {
// super.onClick();
// ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
// @Override
// public void beforeCreate() {
// SPDSettings.systemFont();
// }
//
// @Override
// public void afterCreate() {
// //do nothing
// }
// });
// }
// };
// chkFont.checked(SPDSettings.systemFont());
// add(chkFont);
chkFont = new CheckBox(Messages.get(this, "system_font")){
@Override
protected void onClick() {
super.onClick();
ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
@Override
public void beforeCreate() {
SPDSettings.systemFont(checked());
}
if (DeviceCompat.hasHardKeyboard()){
sep3 = new ColorBlock(1, 1, 0xFF000000);
add(sep3);
btnKeyBindings = new RedButton(Messages.get(this, "key_bindings")){
@Override
protected void onClick() {
super.onClick();
ShatteredPixelDungeon.scene().addToFront(new WndKeyBindings());
}
};
add(btnKeyBindings);
}
@Override
public void afterCreate() {
//do nothing
}
});
}
};
chkFont.checked(SPDSettings.systemFont());
add(chkFont);
}
@Override
protected void layout() {
title.setPos((width - title.width())/2, y + GAP);
sep1.size(width, 1);
sep1.y = title.bottom() + 2*GAP;
sep1.y = title.bottom() + 3*GAP;
height = sep1.y + 1;
if (optUISize != null){
optUISize.setRect(0, height + GAP, width, SLIDER_HEIGHT);
height = optUISize.bottom();
if (optUIMode != null && optUIScale != null && width > 200){
optUIMode.setRect(0, height + GAP, width/2-1, SLIDER_HEIGHT);
optUIScale.setRect(width/2+1, height + GAP, width/2-1, SLIDER_HEIGHT);
height = optUIScale.bottom();
} else {
if (optUIMode != null) {
optUIMode.setRect(0, height + GAP, width, SLIDER_HEIGHT);
height = optUIMode.bottom();
}
if (optUIScale != null) {
optUIScale.setRect(0, height + GAP, width, SLIDER_HEIGHT);
height = optUIScale.bottom();
}
}
if (barDesc != null) {
barDesc.setPos((width - barDesc.width()) / 2f, height + GAP);
PixelScene.align(barDesc);
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
btnSplit.setRect(0, barDesc.bottom() + GAP, width, 16);
} else {
btnSplit.setRect(500, barDesc.bottom() + GAP, width, 16);
}
if (width > 200) {
chkFlipToolbar.setRect(0, btnSplit.bottom() + GAP, width / 2 - 1, BTN_HEIGHT);
chkFlipTags.setRect(chkFlipToolbar.right() + GAP, chkFlipToolbar.top(), width / 2 - 1, BTN_HEIGHT);
} else {
chkFlipToolbar.setRect(0, btnSplit.bottom() + GAP, width, BTN_HEIGHT);
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP, width, BTN_HEIGHT);
}
if (btnToolbarSettings != null) {
btnToolbarSettings.setRect(0, height + GAP, width, BTN_HEIGHT);
height = btnToolbarSettings.bottom();
} else {
chkFlipTags.setRect(0, height + GAP, width, BTN_HEIGHT);
height = chkFlipTags.bottom();
}
sep2.size(width, 1);
sep2.y = chkFlipTags.bottom() + 2;
sep2.y = height + GAP;
if (btnKeyBindings != null){
if (width > 200){
chkFlipTags.setSize(width/2-1, BTN_HEIGHT);
sep3.size(1, BTN_HEIGHT + 2*GAP);
sep3.x = chkFlipTags.right() + 0.5f;
sep3.y = sep2.y+1;
PixelScene.align(sep3);
btnKeyBindings.setRect(chkFlipTags.right()+2, chkFlipTags.top(), width/2 - 1, BTN_HEIGHT);
} else {
sep3.size(width, 1);
sep3.y = chkFlipTags.bottom() + 2;
btnKeyBindings.setRect(0, sep3.y + 1 + GAP, width, BTN_HEIGHT);
}
height = btnKeyBindings.bottom();
} else {
height = chkFlipTags.bottom();
}
chkFont.setRect(0, sep2.y + 1 + GAP, width, BTN_HEIGHT);
height = chkFont.bottom();
}
}
@ -640,7 +742,12 @@ public class WndSettings extends WndTabbed {
@Override
protected void onChange() {
SPDSettings.quickslots(getSelectedValue());
Toolbar.updateLayout();
if(SPDSettings.quickSwapper()){
Toolbar.updateLayout();
} else {
ToobarV.updateLayout();
}
}
};
quickslots.setSelectedValue(SPDSettings.quickslots());
@ -662,11 +769,16 @@ public class WndSettings extends WndTabbed {
bottom = sep1.y + 1;
if(!SPDSettings.quickSwapper()){
quickslots.active = false;
quickslots.visible = false;
}
if (width > 200){
ClassUI.setRect(0, bottom, width, SLIDER_HEIGHT);
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
optFPSLimit.setRect(0, optSplashScreen.bottom() + GAP, width/2, SLIDER_HEIGHT);
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
if ((Game.scene() == null || Game.scene().getClass() != GameScene.class) && SPDSettings.quickSwapper()) {
quickslots.setRect(optFPSLimit.right(), optFPSLimit.top(), width/2, SLIDER_HEIGHT);
wxts.visible = false;
} else {
@ -677,7 +789,7 @@ public class WndSettings extends WndTabbed {
ClassUI.setRect(0, bottom + GAP, width, SLIDER_HEIGHT);
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
optFPSLimit.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
if (Game.scene() == null || Game.scene().getClass() != GameScene.class) {
if ((Game.scene() == null || Game.scene().getClass() != GameScene.class) && SPDSettings.quickSwapper()) {
quickslots.visible = false;
} else {
quickslots.setRect(0, optFPSLimit.bottom() + GAP, width, SLIDER_HEIGHT);

View File

@ -11,3 +11,4 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
android.useAndroidX=true
android.enableJetifier=true
android.suppressUnsupportedCompileSdk=33

View File

@ -1 +0,0 @@
/build

View File

@ -1,37 +0,0 @@
plugins {
id 'com.android.library'
}
android {
namespace 'com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase'
compileSdk 33
defaultConfig {
minSdk 19
targetSdk 33
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
implementation project(':SPD-classes')
api project(':services')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

View File

@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -1,26 +0,0 @@
package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase;
import static org.junit.Assert.assertEquals;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase.test", appContext.getPackageName());
}
}

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View File

@ -1,4 +0,0 @@
package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase;
public class FireBaseLing {
}

View File

@ -1,17 +0,0 @@
package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -8,8 +8,4 @@ public class GameNesImpl{
return newsChecker;
}
public static boolean supportsNews(){
return true;
}
}

View File

@ -1,3 +0,0 @@
package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase;
public class FireBaseService {
}

View File

@ -11,4 +11,3 @@ include ':services'
//news
include ':services:news:shatteredNews'
include ':services:analyticsfirebase'