diff --git a/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoAchievementLoader.java b/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoAchievementLoader.java index 76fc10d..a0c5582 100644 --- a/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoAchievementLoader.java +++ b/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoAchievementLoader.java @@ -20,25 +20,25 @@ public Map getProviderMap(Language language) { case CN: textMap.put(DemoAchievementId.STEP_1, JavaFeatureForGwt.listOf( "NO.1", - "拥有两个小森林。", + "拥有2级AUTO_PROVIDER。", "你完成了任务NO.1。" )); textMap.put(DemoAchievementId.STEP_2, JavaFeatureForGwt.listOf( "NO.2", - "拥有两个小工厂。", + "拥有2级AUTO_SELLER。", "你完成了任务NO.2。" )); break; default: textMap.put(DemoAchievementId.STEP_1, JavaFeatureForGwt.listOf( "NO.1", - "Own two small forests.", - "You completed Quest NO.1.\nThank you for your tireless efforts to protect our planet and make it a better place for future generations." + "Own lv.2 AUTO_PROVIDER.", + "You completed Quest NO.1." )); textMap.put(DemoAchievementId.STEP_2, JavaFeatureForGwt.listOf( "NO.2", - "Own two small factories.", - "You completed Quest NO.2.\nWe are thrilled to see the positive impact on our local economy with more jobs and increased business opportunities. Thank you to all who have contributed to our economic success." + "Own lv.2 AUTO_SELLER.", + "You completed Quest NO.2." )); break; } @@ -51,7 +51,7 @@ public Map getProviderMap(Language language) { DemoAchievementId.STEP_1, textMap, JavaFeatureForGwt.mapOf( - ConstructionPrototypeId.COOKIE_AUTO_SELLER, new SimpleEntry<>(1, 2) + ConstructionPrototypeId.COOKIE_AUTO_PROVIDER, new SimpleEntry<>(1, 2) ) ); OwnConstructionAchievement.Companion.quickAddOwnConstructionAchievement( diff --git a/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java b/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java index d730ca1..7b0cd9c 100644 --- a/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java +++ b/IdleDemo-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java @@ -28,7 +28,7 @@ protected RootSaveData genereateStarterRootSaveData() { Map map = new HashMap<>(); map.put( - ConstructionPrototypeId.COOKIE_CLICK_PROVIDER + "_" + UUID.randomUUID().toString(), + ConstructionPrototypeId.COOKIE_CLICK_PROVIDER + "_" + UUID.randomUUID(), ConstructionSaveData.builder() .prototypeId(ConstructionPrototypeId.COOKIE_CLICK_PROVIDER) .level(0) @@ -37,7 +37,7 @@ protected RootSaveData genereateStarterRootSaveData() { .build() ); map.put( - ConstructionPrototypeId.COOKIE_AUTO_PROVIDER + "_" + UUID.randomUUID().toString(), + ConstructionPrototypeId.COOKIE_AUTO_PROVIDER + "_" + UUID.randomUUID(), ConstructionSaveData.builder() .prototypeId(ConstructionPrototypeId.COOKIE_AUTO_PROVIDER) .level(1) @@ -46,7 +46,7 @@ protected RootSaveData genereateStarterRootSaveData() { .build() ); map.put( - ConstructionPrototypeId.COOKIE_AUTO_SELLER + "_" + UUID.randomUUID().toString(), + ConstructionPrototypeId.COOKIE_AUTO_SELLER + "_" + UUID.randomUUID(), ConstructionSaveData.builder() .prototypeId(ConstructionPrototypeId.COOKIE_AUTO_SELLER) .level(1) @@ -61,7 +61,7 @@ protected RootSaveData genereateStarterRootSaveData() { ); dirtGridPositions.forEach(it -> { map.put( - ConstructionPrototypeId.EMPTY_CELL + "_" + UUID.randomUUID().toString(), + ConstructionPrototypeId.EMPTY_CELL + "_" + UUID.randomUUID(), ConstructionSaveData.builder() .prototypeId(ConstructionPrototypeId.EMPTY_CELL) .level(0) @@ -70,10 +70,14 @@ protected RootSaveData genereateStarterRootSaveData() { .build() ); }); + + Map ownResources = new HashMap<>(); + ownResources.put(ResourceType.COIN, 500L); + return RootSaveData.builder() .gameplaySave(GameplaySaveData.builder() .constructionSaveDataMap(map) - .ownResoueces(new HashMap<>()) + .ownResources(ownResources) .unlockedResourceTypes(new HashSet<>()) .unlockedAchievementIds(new HashSet<>()) .build()) diff --git a/build.gradle b/build.gradle index 297057f..fcebbe4 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ allprojects { gdxFreeTypeGwtVersion = '1.9.10.1' gwtFrameworkVersion = '2.8.2' - hundunLibVersion = 'f5e40d5fb1' + hundunLibVersion = '77884f68d3' raeleusStripeVersion = '1.4.1' } diff --git a/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/component/AchievementMaskBoard.java b/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/component/AchievementMaskBoard.java index c0c307d..6590215 100644 --- a/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/component/AchievementMaskBoard.java +++ b/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/component/AchievementMaskBoard.java @@ -2,11 +2,13 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Sprite; +import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.ui.Button; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable; @@ -32,9 +34,9 @@ public AchievementMaskBoard(BaseIdlePlayScreen parent) { this.add(label).center().row(); Button textButton = new TextButton("continue", parent.getGame().getMainSkin()); - textButton.addListener(new ClickListener() { + textButton.addListener(new ChangeListener() { @Override - public void clicked(InputEvent event, float x, float y) { + public void changed(ChangeEvent event, Actor actor) { parent.hideAchievementMaskBoard(); } }); diff --git a/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/screen/play/BaseIdlePlayScreen.java b/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/screen/play/BaseIdlePlayScreen.java index 414a1ac..4fc8c3a 100644 --- a/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/screen/play/BaseIdlePlayScreen.java +++ b/idleshare/core/src/hundun/gdxgame/idleshare/core/starter/ui/screen/play/BaseIdlePlayScreen.java @@ -32,7 +32,7 @@ public abstract class BaseIdlePlayScreen, T_ @Getter protected final PlayScreenLayoutConst layoutConst; - + protected boolean hidden; // ====== need child lazy-init start ====== protected AchievementMaskBoard achievementMaskBoard; @@ -75,12 +75,15 @@ public void dispose() { public void hideAchievementMaskBoard() { game.getFrontend().log(this.getClass().getSimpleName(), "hideAchievementMaskBoard called"); achievementMaskBoard.setVisible(false); - Gdx.input.setInputProcessor(uiStage); + Gdx.input.setInputProcessor(provideDefaultInputProcessor()); logicFrameHelper.setLogicFramePause(false); } @Override public void showAchievementMaskBoard(AbstractAchievement prototype) { + if (this.hidden) { + return; + } game.getFrontend().log(this.getClass().getSimpleName(), "onAchievementUnlock called"); achievementMaskBoard.setAchievementPrototype(prototype); achievementMaskBoard.setVisible(true); @@ -153,9 +156,17 @@ public void show() { updateUIForShow(); + this.hidden = false; Gdx.app.log(this.getClass().getSimpleName(), "show done"); } + @Override + public void hide() { + super.hide(); + + this.hidden = true; + } + protected abstract void updateUIForShow(); protected abstract InputProcessor provideDefaultInputProcessor(); diff --git a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/export/IdleGameplayExport.java b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/export/IdleGameplayExport.java index ef2f827..199f760 100644 --- a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/export/IdleGameplayExport.java +++ b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/export/IdleGameplayExport.java @@ -28,12 +28,12 @@ public class IdleGameplayExport implements ILogicFrameListener, ISubSystemSettingSaveHandler { @Getter - private IdleGameplayContext gameplayContext; - private IBuiltinConstructionsLoader builtinConstructionsLoader; - private IBuiltinAchievementsLoader builtinAchievementsLoader; - private ChildGameConfig childGameConfig; + private final IdleGameplayContext gameplayContext; + private final IBuiltinConstructionsLoader builtinConstructionsLoader; + private final IBuiltinAchievementsLoader builtinAchievementsLoader; + private final ChildGameConfig childGameConfig; @Getter - private IGameDictionary gameDictionary; + private final IGameDictionary gameDictionary; @Setter @Getter private Language language; @@ -68,7 +68,7 @@ public void applyGameplaySaveData(GameplaySaveData gameplaySaveData) { }); gameplayContext.getStorageManager().setUnlockedResourceTypes(gameplaySaveData.getUnlockedResourceTypes()); - gameplayContext.getStorageManager().setOwnResoueces(gameplaySaveData.getOwnResoueces()); + gameplayContext.getStorageManager().setOwnResoueces(gameplaySaveData.getOwnResources()); gameplayContext.getAchievementManager().setUnlockedAchievementIds(gameplaySaveData.getUnlockedAchievementIds()); } @@ -83,7 +83,7 @@ public void currentSituationToGameplaySaveData(GameplaySaveData gameplaySaveData )) ); gameplaySaveData.setUnlockedResourceTypes(gameplayContext.getStorageManager().getUnlockedResourceTypes()); - gameplaySaveData.setOwnResoueces(gameplayContext.getStorageManager().getOwnResoueces()); + gameplaySaveData.setOwnResources(gameplayContext.getStorageManager().getOwnResoueces()); gameplaySaveData.setUnlockedAchievementIds(gameplayContext.getAchievementManager().getUnlockedAchievementIds()); } diff --git a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/data/GameplaySaveData.java b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/data/GameplaySaveData.java index 2e680b9..6382104 100644 --- a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/data/GameplaySaveData.java +++ b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/data/GameplaySaveData.java @@ -3,7 +3,6 @@ import java.util.Map; import java.util.Set; -import hundun.gdxgame.idleshare.gamelib.framework.model.construction.base.BaseConstruction; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.NoArgsConstructor; @@ -19,7 +18,7 @@ @NoArgsConstructor public class GameplaySaveData { String stageId; - Map ownResoueces; + Map ownResources; Set unlockedResourceTypes; Map constructionSaveDataMap; Set unlockedAchievementIds;