Bug 557 - Restarting the game to start scene will not reset the previously clicked button
Summary: Restarting the game to start scene will not reset the previously clicked button
Status: RESOLVED FIXED
Alias: None
Product: CS3343_Kunkun_Loves_English
Classification: Unclassified
Component: Scene (show other bugs)
Version: 1.0
Hardware: Macintosh Mac OS
: High critical
Assignee: shangpguo2
URL:
Depends on:
Blocks:
 
Reported: 2021-11-13 15:50 HKT by xuezhwang2-c
Modified: 2021-11-19 20:36 HKT (History)
2 users (show)

See Also:


Attachments
Result (330.71 KB, image/png)
2021-11-13 15:55 HKT, xuezhwang2-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xuezhwang2-c 2021-11-13 15:50:49 HKT
1. General Description

When I finish playing the game in Toefl mode and come to the end scene, I clicked the restart button. Nevertheless, after it transit to the starting scene, I found that the button I clicked before, i.e. TOEFL button, is grey which means somehow it is not reset back to normal.

2. steps to reproduce:

(1) Enter the game and click TOEFL mode
(2) Finish the game, either win or lose
(3) When it transits to the ending scene, click restart button to go back to starting scene.

3. Actual Result:

In starting scene, you will find the TOEFL button is grey and after few second, you automatically enter the TOEFL game again without clicking anything.

4. Expected Result:

It is expected that after transiting to starting scene, user could choose a mode to play with as if they just enter the game. 

5. suspected issues:

I doubt it is because the restart button has the same position with the TOFEL button in the starting scene. When you transit the scene, the state "mouse.isClicked" is not cleared.
Comment 1 xuezhwang2-c 2021-11-13 15:55:14 HKT
Created attachment 75 [details]
Result
Comment 2 shangpguo2 2021-11-19 20:34:30 HKT
Hi, Xuezhen! Thanks for reporting this bug. 

After checking, I think the issue is not caused by what you proposed. It is because "private static Button startButtons[] = new Button[GlobalConstants.NUM_GAME_MODE];" in the LoginScene.java. Since it is static, even it can reduce some time to load the picture. (we don't need to load pictures from file system every time we go back to login scene.) Nevertheless, the state that we store in the button will not change. 

After changing the code to "private Button startButtons[] = new Button[GlobalConstants.NUM_GAME_MODE];", the problem is fixed.