Browse Source

1.修改首页进入游戏弹窗修改

王鹏鹏 1 year ago
parent
commit
54a97f9e92
2 changed files with 32 additions and 31 deletions
  1. 2 1
      .idea/misc.xml
  2. 30 30
      game/src/main/java/com/yingyangfly/game/play/PlayGameActivity.kt

+ 2 - 1
.idea/misc.xml

@@ -516,7 +516,7 @@
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/activity_game_settlement.xml" value="0.536" />
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/activity_main.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/activity_play_game.xml" value="0.3953084274543875" />
-        <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/dialog_completion_training.xml" value="0.536" />
+        <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/dialog_completion_training.xml" value="0.4" />
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/dialog_count_down.xml" value="0.5676056338028169" />
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/dialog_exit_game.xml" value="0.2" />
         <entry key="..\:/workspace/hcp-pads/game/src/main/res/layout/dialog_game_loading.xml" value="0.23697916666666666" />
@@ -613,6 +613,7 @@
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/fragment_data_monitor.xml" value="0.8800000000000001" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/fragment_train_content.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/fragment_train_report.xml" value="0.41704857928505956" />
+        <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/item_brain_ability_type.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/item_data_monitor.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/item_free_training.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/workbenches/src/main/res/layout/item_free_training_type.xml" value="0.23697916666666666" />

+ 30 - 30
game/src/main/java/com/yingyangfly/game/play/PlayGameActivity.kt

@@ -536,15 +536,15 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
     private fun parsingData(gameDataBean: GameDataBean, isPass: String) {
         runOnUiThread {
             runOnUiThread {
-                if (TextUtils.equals("2", isPass)) {
-                    LiveEventBusUtil.send(RxBusCodes.QUITGAME, "")
-                    finish()
-                } else if (TextUtils.equals("3", isPass)) {
-                    val score: Int = gameTotalScore.toInt() + gameDataBean.curLevelScore.toInt()
-                    gameTotalScore = score.toString()
-                    if (TextUtils.equals("A", playClass)) {
-                        showCompletionTrainingDialog(gameDataBean)
-                    } else {
+                if (TextUtils.equals("A", playClass)) {
+                    showCompletionTrainingDialog(gameDataBean)
+                } else {
+                    if (TextUtils.equals("2", isPass)) {
+                        LiveEventBusUtil.send(RxBusCodes.QUITGAME, "")
+                        finish()
+                    } else if (TextUtils.equals("3", isPass)) {
+                        val score: Int = gameTotalScore.toInt() + gameDataBean.curLevelScore.toInt()
+                        gameTotalScore = score.toString()
                         //游戏通关
                         ARouter.getInstance().build(RouterUrlCommon.gameSettlement)
                             .withString("gameCode", gameCode)
@@ -552,29 +552,29 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
                             .withString("gameType", gameType)
                             .withTransition(R.anim.leftin, R.anim.leftout)
                             .navigation(mContext)
-                    }
-                } else {
-                    val score: Int = gameTotalScore.toInt() + gameDataBean.curLevelScore.toInt()
-                    gameTotalScore = score.toString()
-                    if (TextUtils.equals("A", playClass)) {
-                        showCompletionTrainingDialog(gameDataBean)
                     } else {
-                        //游戏成功/失败
-                        gameResultDialog = GameResultDialog()
-                        gameResultDialog?.setData(
-                            gameDataBean.curLevel,
-                            gameTotalScore,
-                            gameDataBean.curLevelScore,
-                            isPass
-                        )
-                        gameResultDialog?.onBackHomeDialogClickListener = {
-                            finish()
-                            LiveEventBusUtil.send(RxBusCodes.GAMEOVERTIME, "")
-                        }
-                        gameResultDialog?.onGameDialogClickListener = {
-                            loadJs(it)
+                        val score: Int = gameTotalScore.toInt() + gameDataBean.curLevelScore.toInt()
+                        gameTotalScore = score.toString()
+                        if (TextUtils.equals("A", playClass)) {
+                            showCompletionTrainingDialog(gameDataBean)
+                        } else {
+                            //游戏成功/失败
+                            gameResultDialog = GameResultDialog()
+                            gameResultDialog?.setData(
+                                gameDataBean.curLevel,
+                                gameTotalScore,
+                                gameDataBean.curLevelScore,
+                                isPass
+                            )
+                            gameResultDialog?.onBackHomeDialogClickListener = {
+                                finish()
+                                LiveEventBusUtil.send(RxBusCodes.GAMEOVERTIME, "")
+                            }
+                            gameResultDialog?.onGameDialogClickListener = {
+                                loadJs(it)
+                            }
+                            gameResultDialog?.show(supportFragmentManager, "gameResultDialog")
                         }
-                        gameResultDialog?.show(supportFragmentManager, "gameResultDialog")
                     }
                 }
             }