View Issue Details

IDProjectCategoryView StatusLast Update
0006233The Dark ModGUIpublic16.01.2023 22:04
ReporterDaft Mugi Assigned Tostgatilov  
Status closedResolutionduplicate 
Product VersionSVN 
Target VersionTDM 2.11Fixed in VersionTDM 2.11 
Summary0006233: Incorrect difficulty highlighted after mission completion
DescriptionAfter a mission is completed and the player navigates back to the objectives screen,
it will have the first difficulty (easiest) selected on the left even though the objectives list
shows a different difficulty level.
Steps To ReproduceTo reproduce (method 1):
1. Start mission on difficulty 1 or 2.
2. Complete mission.
3. Click "Start This Mission".
4. On the objectives screen, difficulty 0 will be highlighted but have difficulty 1 or 2 as its objectives list.

To reproduce (method 2), if you already have a "Mission Final Save" save:
1. Load "Mission Final Save" save that either has difficulty 1 or 2.
2. Click "Start This Mission".
3. On the objectives screen, difficulty 0 will be highlighted but have difficulty 1 or 2 as its objectives list.
Additional InformationThe main issue is that after completing a mission, the GUI windowDefs are not reinitialized with the proper "forecolor".
The "diffSelect" is set properly, but the "Difficulty0", "Difficulty1", "Difficulty2" windowDefs do
not get the corresponding "forecolor".
TagsNo tags attached.


duplicate of 0006229 resolvedstgatilov Objectives screen starts without difficulty highlighted 


Daft Mugi

Daft Mugi

16.01.2023 07:02

reporter   ~0015783

I've attached a patch.
It is meant to be paired with the patch for 0006229.
r10247-fix-objective-screen.diff (940 bytes)   
diff --git game/Objectives/MissionData.cpp game/Objectives/MissionData.cpp
index db0f87f..2794032 100644
--- game/Objectives/MissionData.cpp
+++ game/Objectives/MissionData.cpp
@@ -2460,6 +2460,11 @@ void CMissionData::HandleMainMenuCommands(const idStr& cmd, idUserInterface* gui
 				// Let the GUI know what the current difficulty level is
 				gui->SetStateInt("diffSelect", gameLocal.m_DifficultyManager.GetDifficultyLevel());
+				// #6233: ResetWindowTime is needed for reinitializing which difficulty is selected
+				gui->ResetWindowTime("Difficulty0");
+				gui->ResetWindowTime("Difficulty1");
+				gui->ResetWindowTime("Difficulty2");
 				// Clear the flag so that the objectives get updated
@@ -2806,4 +2811,4 @@ void CMissionData::SetSecretsFound( float secrets )
 void CMissionData::SetSecretsTotal( float secrets )
 	m_Stats.secretsTotal = (int)secrets;
\ No newline at end of file


16.01.2023 08:39

administrator   ~0015786

svn rev 16740 from 0006229 also fixes that.
No need to hack C++ code, just do all initialization every time.

BTW, there is console command "tdm_end_mission" which is useful for reproducing such things.
Daft Mugi

Daft Mugi

16.01.2023 09:27

reporter   ~0015788

Are you sure it works for you? It never works for me, because the "forecolor" does not get set correctly.
Thank you for teaching me about "tdm_end_mission" as that also puts the GUI in the bugged state.
0006229 does not fix it.
For example, when "diffSelect 2", Difficulty0 always has its "forecolor" set to 1,1,1,1 with the difficulty 2 objective list.

The only way I found to make the "forecolor" match the "diffSelect" state was to reset its timer, because "onTime 0" has the logic to set the "forecolor" correctly.
I think there should be a better way than resetting the timer, though.

Even though "diffSelect" and "gameLocal.m_DifficultyManager" are set correctly, the nav items do not have the correct "forecolor".
How can the "forecolor" be set correctly after mission completion?
Daft Mugi

Daft Mugi

16.01.2023 21:01

reporter   ~0015792

Thank you for sharing the changed file in 0006229.
My first test was a success!
I'm happy that the C++ is not necessary. =)

Issue History

Date Modified Username Field Change
16.01.2023 06:50 Daft Mugi New Issue
16.01.2023 06:51 Daft Mugi Relationship added related to 0006229
16.01.2023 07:02 Daft Mugi Note Added: 0015783
16.01.2023 07:02 Daft Mugi File Added: r10247-fix-objective-screen.diff
16.01.2023 08:39 stgatilov Note Added: 0015786
16.01.2023 09:27 Daft Mugi Note Added: 0015788
16.01.2023 21:01 Daft Mugi Note Added: 0015792
16.01.2023 22:03 stgatilov Relationship replaced duplicate of 0006229
16.01.2023 22:04 stgatilov Target Version => TDM 2.11
16.01.2023 22:04 stgatilov Assigned To => stgatilov
16.01.2023 22:04 stgatilov Status new => closed
16.01.2023 22:04 stgatilov Resolution open => duplicate
16.01.2023 22:04 stgatilov Fixed in Version => TDM 2.11