diff --git a/android/build.gradle b/android/build.gradle index 6793b95a6..dea00ca6b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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" diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java index a2702fba0..38191169d 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java @@ -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 diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java index 8a54d190a..e723df273 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java @@ -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<>()); diff --git a/build.gradle b/build.gradle index 832cc6afc..2d4610675 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/core/src/main/assets/interfaces/LanterLing.png b/core/src/main/assets/interfaces/LanterLing.png index c1622c605..019f28d38 100644 Binary files a/core/src/main/assets/interfaces/LanterLing.png and b/core/src/main/assets/interfaces/LanterLing.png differ diff --git a/core/src/main/assets/interfaces/boss_hp.png b/core/src/main/assets/interfaces/boss_hp.png index 6d5d4d386..aac5f4042 100644 Binary files a/core/src/main/assets/interfaces/boss_hp.png and b/core/src/main/assets/interfaces/boss_hp.png differ diff --git a/core/src/main/assets/interfaces/chrome.png b/core/src/main/assets/interfaces/chrome.png index ba63f06ec..db652b7c9 100644 Binary files a/core/src/main/assets/interfaces/chrome.png and b/core/src/main/assets/interfaces/chrome.png differ diff --git a/core/src/main/assets/interfaces/status_pane-puresoul.png b/core/src/main/assets/interfaces/status_pane-puresoul.png deleted file mode 100644 index a22ea8460..000000000 Binary files a/core/src/main/assets/interfaces/status_pane-puresoul.png and /dev/null differ diff --git a/core/src/main/assets/interfaces/status_pane-puresoul_dark.png b/core/src/main/assets/interfaces/status_pane-puresoul_dark.png deleted file mode 100644 index e5dc3b758..000000000 Binary files a/core/src/main/assets/interfaces/status_pane-puresoul_dark.png and /dev/null differ diff --git a/core/src/main/assets/interfaces/status_pane.png b/core/src/main/assets/interfaces/status_pane.png index a22ea8460..dd53e4043 100644 Binary files a/core/src/main/assets/interfaces/status_pane.png and b/core/src/main/assets/interfaces/status_pane.png differ diff --git a/core/src/main/assets/interfaces/status_pane_normal.png b/core/src/main/assets/interfaces/status_pane_normal.png index 4161e1d37..c4afb2643 100644 Binary files a/core/src/main/assets/interfaces/status_pane_normal.png and b/core/src/main/assets/interfaces/status_pane_normal.png differ diff --git a/core/src/main/assets/interfaces/toolbar.png b/core/src/main/assets/interfaces/toolbar.png index 1fb89beb9..2ed78c153 100644 Binary files a/core/src/main/assets/interfaces/toolbar.png and b/core/src/main/assets/interfaces/toolbar.png differ diff --git a/core/src/main/assets/interfaces/toolbar_normal.png b/core/src/main/assets/interfaces/toolbar_normal.png index dbb1f1ad4..b3e49dcad 100644 Binary files a/core/src/main/assets/interfaces/toolbar_normal.png and b/core/src/main/assets/interfaces/toolbar_normal.png differ diff --git a/core/src/main/assets/messages/misc/misc.properties b/core/src/main/assets/messages/misc/misc.properties index c3c86d034..5e88cadc9 100644 --- a/core/src/main/assets/messages/misc/misc.properties +++ b/core/src/main/assets/messages/misc/misc.properties @@ -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 场游戏,你的名声已经传到地表三巨头的耳里。小心夜路遇到他们哦。 diff --git a/core/src/main/assets/messages/ui/ui.properties b/core/src/main/assets/messages/ui/ui.properties index 44cdf8b58..708e1f5e3 100644 --- a/core/src/main/assets/messages/ui/ui.properties +++ b/core/src/main/assets/messages/ui/ui.properties @@ -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// \ No newline at end of file diff --git a/core/src/main/assets/messages/windows/windows.properties b/core/src/main/assets/messages/windows/windows.properties index 576995bb9..cbf576691 100644 --- a/core/src/main/assets/messages/windows/windows.properties +++ b/core/src/main/assets/messages/windows/windows.properties @@ -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=网络相关设置 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index 5532d20c9..a1b1aac11 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -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"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java index 122789c1e..cbac632c3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java @@ -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; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/QuickSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/QuickSlot.java index d4a57d93e..0471c6fc7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/QuickSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/QuickSlot.java @@ -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. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDAction.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDAction.java index cb226f785..7d9979a00 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDAction.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDAction.java @@ -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 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java index 557f65bbd..93d1179f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java @@ -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 ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Rat.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Rat.java index eb186b180..f84ce3ac7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Rat.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Rat.java @@ -37,7 +37,7 @@ public class Rat extends Mob { HP = HT = 8; defenseSkill = 2; - maxLvl = 30; + maxLvl = 5; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/utils/Constants.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/utils/Constants.java index 6877fa834..400270d2c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/utils/Constants.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/utils/Constants.java @@ -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"); - } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/lightblack/OilLantern.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/lightblack/OilLantern.java index 49fea8753..caf5b778b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/lightblack/OilLantern.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/lightblack/OilLantern.java @@ -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(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EyeRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EyeRoom.java index 402e2d3f6..296eb5b58 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EyeRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EyeRoom.java @@ -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 ) ), diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/YinYangRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/YinYangRoom.java index 3ac78240a..24ec204fa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/YinYangRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/YinYangRoom.java @@ -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()); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 15741978c..3e12ed3bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -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(){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java index 4488a38a8..20286c4db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java @@ -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(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/Beta.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/Beta.java index 02d2160a6..e69de29bb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/Beta.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/Beta.java @@ -1,5 +0,0 @@ -package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase; - -public class Beta { - public static FireBaseService service; -} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java index c3ec72457..82ba40bdc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java @@ -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); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/JoinIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/JoinIndicator.java index 0d6a45234..7185dc1db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/JoinIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/JoinIndicator.java @@ -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() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index 20ddf8d88..6bc82cd24 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -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]; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java index 5f7e460eb..2a0e2e426 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ToobarV.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ToobarV.java new file mode 100644 index 000000000..046e70b71 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ToobarV.java @@ -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); + } + } + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java index f49e66c1c..b4ad8fbd0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/mlpd/vM0_6_7_X_Changes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/mlpd/vM0_6_7_X_Changes.java index d8907674c..b10828825 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/mlpd/vM0_6_7_X_Changes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/mlpd/vM0_6_7_X_Changes.java @@ -143,7 +143,7 @@ public class vM0_6_7_X_Changes { } public static void add_v0_6_55_Changes( ArrayList 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), ("炼金界面优化"), ("炼金指南进行优化。"))); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java index 7f5ec7df5..27b440881 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java @@ -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); diff --git a/gradle.properties b/gradle.properties index 95d128a89..fe57b0fa7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,5 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +android.suppressUnsupportedCompileSdk=33 \ No newline at end of file diff --git a/services/analyticsfirebase/.gitignore b/services/analyticsfirebase/.gitignore deleted file mode 100644 index 42afabfd2..000000000 --- a/services/analyticsfirebase/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/services/analyticsfirebase/build.gradle b/services/analyticsfirebase/build.gradle deleted file mode 100644 index b67007851..000000000 --- a/services/analyticsfirebase/build.gradle +++ /dev/null @@ -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' -} \ No newline at end of file diff --git a/services/analyticsfirebase/consumer-rules.pro b/services/analyticsfirebase/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/analyticsfirebase/proguard-rules.pro b/services/analyticsfirebase/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/services/analyticsfirebase/proguard-rules.pro +++ /dev/null @@ -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 \ No newline at end of file diff --git a/services/analyticsfirebase/src/androidTest/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleInstrumentedTest.java b/services/analyticsfirebase/src/androidTest/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleInstrumentedTest.java deleted file mode 100644 index 9b982c52a..000000000 --- a/services/analyticsfirebase/src/androidTest/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleInstrumentedTest.java +++ /dev/null @@ -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 Testing documentation - */ -@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()); - } -} \ No newline at end of file diff --git a/services/analyticsfirebase/src/main/AndroidManifest.xml b/services/analyticsfirebase/src/main/AndroidManifest.xml deleted file mode 100644 index a5918e68a..000000000 --- a/services/analyticsfirebase/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/services/analyticsfirebase/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseLing.java b/services/analyticsfirebase/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseLing.java deleted file mode 100644 index b94bdf594..000000000 --- a/services/analyticsfirebase/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseLing.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase; - -public class FireBaseLing { -} diff --git a/services/analyticsfirebase/src/test/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleUnitTest.java b/services/analyticsfirebase/src/test/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleUnitTest.java deleted file mode 100644 index 187b73c69..000000000 --- a/services/analyticsfirebase/src/test/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/ExampleUnitTest.java +++ /dev/null @@ -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 Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file diff --git a/services/news/shatteredNews/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/news/GameNesImpl.java b/services/news/shatteredNews/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/news/GameNesImpl.java index 447f6fc26..b708a0d68 100644 --- a/services/news/shatteredNews/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/news/GameNesImpl.java +++ b/services/news/shatteredNews/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/news/GameNesImpl.java @@ -8,8 +8,4 @@ public class GameNesImpl{ return newsChecker; } - public static boolean supportsNews(){ - return true; - } - } diff --git a/services/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseService.java b/services/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseService.java deleted file mode 100644 index bd0b0e176..000000000 --- a/services/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/analyticsfirebase/FireBaseService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.shatteredpixel.shatteredpixeldungeon.services.analyticsfirebase; -public class FireBaseService { -} diff --git a/settings.gradle b/settings.gradle index 6ae8f88fd..da66e41ac 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,4 +11,3 @@ include ':services' //news include ':services:news:shatteredNews' -include ':services:analyticsfirebase'