|
@@ -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")
|
|
|
}
|
|
|
}
|
|
|
}
|