View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006229 | The Dark Mod | GUI | public | 11.01.2023 21:12 | 16.01.2023 22:03 |
| Reporter | Daft Mugi | Assigned To | stgatilov | ||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | TDM 2.09 | ||||
| Target Version | TDM 2.11 | Fixed in Version | TDM 2.11 | ||
| Summary | 0006229: Objectives screen starts without difficulty highlighted | ||||
| Description | After clicking "Start This Mission", the objectives screen does not start with the difficulty highlighted. The difficulties are listed on the left, but the current difficulty level is not highlighted. For example, "A New Job" should have "New to Stealth" highlighted, but it is not. Attached two screenshots: 1. Shows the issue. ("New to Stealth" is selected, but "New to Stealth" is not highlighted.) 2. Shows how it should look. (Same as when "New to Stealth" is clicked.) | ||||
| Steps To Reproduce | 1. Start game. 2. Click "Start This Mission". 3. Look at the Objectives Screen. | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
|
I've attached a fix. 1. mainmenu_objectives.gui 2. patch version of mainmenu_objectives.gui mainmenu_objectives.gui (12,678 bytes)
// For vim users, don't remove: vim:ts=4:sw=4:cindent
/* =============================================================================================
*
* This file is part of The Dark Mod's Main Menu GUI
*
* Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4.
*
* ============================================================================================= */
windowDef ObjectivesMenu
{
rect 0,0,640,640
visible 0
windowDef ObjectivesMenuParchment
{
rect ("gui::ingame" ? 0 : 50), -75, 640, 640
matcolor 1,1,1,1
background "guis/assets/objectives/parchment_untitled"
}
// This is called whenever the user switches to this screen
windowDef ObjectivesStateInit
{
noTime 1
// Init methods have onTime 10 instead of onTime 0.
onTime 10
{
set "cmd" "log 'ObjectivesStateInit called.'";
set "gui::ObjStartIdx" "0";
// Show our parent windowDef
set "ObjectivesMenu::visible" "1";
// stgatilov: background layers must never be enabled/disabled manually!
// unfortunately, we have to leave this hack here for compatibility with old missions:
// They override mainmenu_briefing.gui, which enables the figures in End code =(
set "MainMenuBackgroundFigures::visible" "0";
// Issue the open request to the SDK
set "cmd" "log 'Issuing objective_open_request call.'";
set "cmd" "objective_open_request";
set "notime" 1;
}
}
// Called when the MainMenuModeSelect script switches states.
windowDef ObjectivesStateEnd
{
noTime 1
onTime 0
{
set "cmd" "log 'ObjectivesStateEnd called.'";
set "ObjectivesMenu::visible" "0";
set "notime" "1";
}
}
/***************************************************************************
*
* Actual objectives
*
**************************************************************************/
windowDef ObjectivesHolder
{
#define OBJ_OFFSET_X ("gui::ingame" ? 110 : 160)
#define OBJ_FULL_WIDTH 460
#define OBJ_FULL_HEIGHT 355
rect OBJ_OFFSET_X, 60, OBJ_FULL_WIDTH, OBJ_FULL_HEIGHT
//backcolor 0.2,0.5,1.0,1 //for debugging
#include "guis/tdm_objectives_core.gui"
}
/***************************************************************************
*
* The Difficulty selection buttons (only visible in start game)
*
**************************************************************************/
windowDef DifficultySelection
{
rect 0,0,640,640
visible "gui::DifficultyIsVisible"
notime 1
windowDef Difficulty0
{
rect 12,80,123,62
forecolor 1,1,1,1
text "gui::diff0Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onTime 0
{
if ("gui::diffSelect" == 0)
{
set "forecolor" "1,1,1,1";
}
}
onAction
{
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "0";
set "cmd" "log 'Selected difficulty level 0.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
windowDef Difficulty1
{
rect 12,208,123,62
forecolor 0.6,0.6,0.6,0.7
text "gui::diff1Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onTime 0
{
if ("gui::diffSelect" == 1)
{
set "forecolor" "1,1,1,1";
}
}
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "1";
set "cmd" "log 'Selected difficulty level 1.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
windowDef Difficulty2
{
rect 12,336,123,62
forecolor 0.6,0.6,0.6,0.7
text "gui::diff2Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onTime 0
{
if ("gui::diffSelect" == 2)
{
set "forecolor" "1,1,1,1";
}
}
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "2";
set "cmd" "log 'Selected difficulty level 2.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
}
/***************************************************************************
*
* The "Resume Game" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesResumeButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesResumeButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesResumeButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
// The "objective_close_request" will be caught by the SDK code and shut down this GUI
set "cmd" "play sound/meta/menu/mnu_select;";
resetTime "ObjectivesDelayedCloseRequest" 0;
}
}
// Sends an objective close request after a short delay
windowDef ObjectivesDelayedCloseRequest
{
rect 0,0,0,0
notime 1
onTime 400
{
set "cmd" "close";
set "notime" 1;
}
}
// Called by the SDK when displaying the objectives in the pre-mission menu
onNamedEvent ObjMenuShowDifficultyOptions
{
// Display the Difficulty choices
set "gui::DifficultyIsVisible" "1";
// Hide the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "0";
}
// Called by the SDK when displaying the objectives in-game
onNamedEvent ObjMenuHideDifficultyOptions
{
// Hide the Difficulty choices
set "gui::DifficultyIsVisible" "0";
// Display the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "1";
}
/***************************************************************************
*
* The "Main Menu" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesMainmenuButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
}
windowDef ObjectivesMainmenuButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesMainmenuButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesMainmenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
// Switch to the main menu
set "gui::targetmode" MM_STATE_MAINMENU;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Buy Equipment" or "Start Mission" Buttons
*
**************************************************************************/
windowDef ObjectivesStartMissionButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
onMouseEnter
{
transition "ObjectivesStartMissionButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesStartMissionButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Starting mission.'";
}
}
windowDef ObjectivesBuyEquipmentButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
onMouseEnter
{
transition "ObjectivesBuyEquipmentButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBuyEquipmentButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Entering shop.'";
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Briefing/Back" Button (only visible in start menu)
*
**************************************************************************/
windowDef ObjectivesBriefingButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_07202" // Back
visible ("gui::inGame" == 0)
}
windowDef ObjectivesBriefingButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_07202" // Back
visible ("gui::inGame" == 0)
onMouseEnter
{
transition "ObjectivesBriefingButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBriefingButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select";
// Switch to briefing
set "gui::targetmode" MM_STATE_BACKWARD;
resetTime "MainMenuModeSelect" 0;
}
}
} // ObjectivesMenu
r16727-fix-objectives-screen.diff (4,391 bytes)
diff --git guis/mainmenu_objectives.gui guis/mainmenu_objectives.gui
index e02f7c3..4ec6c6d 100644
--- guis/mainmenu_objectives.gui
+++ guis/mainmenu_objectives.gui
@@ -11,7 +11,7 @@ windowDef ObjectivesMenu
{
rect 0,0,640,640
visible 0
-
+
windowDef ObjectivesMenuParchment
{
rect ("gui::ingame" ? 0 : 50), -75, 640, 640
@@ -92,18 +92,10 @@ windowDef ObjectivesMenu
visible "gui::DifficultyIsVisible"
notime 1
- onTime 0
- {
- // set the default color for all values, will be corrected below
- set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
- }
-
windowDef Difficulty0
{
rect 12,80,123,62
- forecolor 0.6,0.6,0.6,.7
+ forecolor 1,1,1,1
text "gui::diff0Name"
textscale 0.36
textalign 0
@@ -134,7 +126,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 0)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -143,7 +135,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 0)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,0.7" "50" ;
+ transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
@@ -151,13 +143,21 @@ windowDef ObjectivesMenu
windowDef Difficulty1
{
rect 12,208,123,62
- forecolor 1,1,1,.7
+ forecolor 0.6,0.6,0.6,0.7
text "gui::diff1Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
+ onTime 0
+ {
+ if ("gui::diffSelect" == 1)
+ {
+ set "forecolor" "1,1,1,1";
+ }
+ }
+
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
@@ -174,7 +174,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 1)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -183,7 +183,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 1)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
+ transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
@@ -191,7 +191,7 @@ windowDef ObjectivesMenu
windowDef Difficulty2
{
rect 12,336,123,62
- forecolor 1,1,1,.7
+ forecolor 0.6,0.6,0.6,0.7
text "gui::diff2Name"
textscale 0.36
textalign 0
@@ -205,11 +205,11 @@ windowDef ObjectivesMenu
set "forecolor" "1,1,1,1";
}
}
-
+
onAction
{
- set "Difficulty0::forecolor" "0.6,0.6,0.6,.7";
- set "Difficulty1::forecolor" "0.6,0.6,0.6,.7";
+ set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
+ set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "2";
@@ -222,7 +222,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 2)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" "0.6,0.6,0.6,0.7" "1,1,1,0.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -231,7 +231,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 2)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
+ transition "forecolor" "1,1,1,0.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
@@ -357,7 +357,7 @@ windowDef ObjectivesMenu
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
-
+
// Switch to the main menu
set "gui::targetmode" MM_STATE_MAINMENU;
resetTime "MainMenuModeSelect" 0;
@@ -409,7 +409,7 @@ windowDef ObjectivesMenu
{
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
-
+
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Starting mission.'";
}
@@ -458,7 +458,7 @@ windowDef ObjectivesMenu
}
}
-
+
/***************************************************************************
*
* The "Briefing/Back" Button (only visible in start menu)
@@ -498,7 +498,7 @@ windowDef ObjectivesMenu
onAction
{
set "cmd" "play sound/meta/menu/mnu_select";
-
+
// Switch to briefing
set "gui::targetmode" MM_STATE_BACKWARD;
resetTime "MainMenuModeSelect" 0;
|
|
|
I found another issue with the objectives screen. After a mission is completed and the player navigates back to the objectives screen, it will have the first difficulty selected on the left even though the objectives list shows a different difficulty level. To reproduce: 1. Start mission on difficulty 2. 2. Complete mission. 3. Click "Start This Mission". 4. On the objectives screen, difficulty 0 will be highlighted but have difficulty 2 objectives. This may require a separate bug tracker, because the behavior is the same with and without the patch I provided earlier. I didn't have time to investigate this more. I'll look at it again tomorrow. |
|
|
I've attached v2 of my patch. The code is cleaned up. And, once the patch for 0006233 is complete, it will show the correct difficulty after mission completion. mainmenu_objectives-2.gui (13,829 bytes)
// For vim users, don't remove: vim:ts=4:sw=4:cindent
/* =============================================================================================
*
* This file is part of The Dark Mod's Main Menu GUI
*
* Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4.
*
* ============================================================================================= */
windowDef ObjectivesMenu
{
rect 0,0,640,640
visible 0
windowDef ObjectivesMenuParchment
{
rect ("gui::ingame" ? 0 : 50), -75, 640, 640
matcolor 1,1,1,1
background "guis/assets/objectives/parchment_untitled"
}
// This is called whenever the user switches to this screen
windowDef ObjectivesStateInit
{
noTime 1
// Init methods have onTime 10 instead of onTime 0.
onTime 10
{
set "cmd" "log 'ObjectivesStateInit called.'";
set "gui::ObjStartIdx" "0";
// Show our parent windowDef
set "ObjectivesMenu::visible" "1";
// stgatilov: background layers must never be enabled/disabled manually!
// unfortunately, we have to leave this hack here for compatibility with old missions:
// They override mainmenu_briefing.gui, which enables the figures in End code =(
set "MainMenuBackgroundFigures::visible" "0";
// Issue the open request to the SDK
set "cmd" "log 'Issuing objective_open_request call.'";
set "cmd" "objective_open_request";
set "notime" "1";
}
}
// Called when the MainMenuModeSelect script switches states.
windowDef ObjectivesStateEnd
{
noTime 1
onTime 0
{
set "cmd" "log 'ObjectivesStateEnd called.'";
set "ObjectivesMenu::visible" "0";
set "notime" "1";
}
}
/***************************************************************************
*
* Actual objectives
*
**************************************************************************/
windowDef ObjectivesHolder
{
#define OBJ_OFFSET_X ("gui::ingame" ? 110 : 160)
#define OBJ_FULL_WIDTH 460
#define OBJ_FULL_HEIGHT 355
rect OBJ_OFFSET_X, 60, OBJ_FULL_WIDTH, OBJ_FULL_HEIGHT
//backcolor 0.2,0.5,1.0,1 //for debugging
#include "guis/tdm_objectives_core.gui"
}
/***************************************************************************
*
* The Difficulty selection buttons (only visible in start game)
*
**************************************************************************/
windowDef DifficultySelection
{
#define DIFFICULTY_NAV_COLOR 0.6,0.6,0.6,0.7
#define SDIFFICULTY_NAV_COLOR "0.6,0.6,0.6,0.7"
#define SDIFFICULTY_NAV_HOVER "1,1,1,0.9"
#define SDIFFICULTY_NAV_SELECTED "1,1,1,1"
#define DIFFICULTY_NAV_RECT_0 12,80,123,62
#define DIFFICULTY_NAV_RECT_1 12,208,123,62
#define DIFFICULTY_NAV_RECT_2 12,336,123,62
#define DIFFICULTY_NAV_TEXTSCALE 0.36
#define DIFFICULTY_NAV_TEXTALIGN 0
#define SDIFFICULTY_NAV_FONT "fonts/carleton"
rect 0,0,640,640
visible "gui::DifficultyIsVisible"
notime 1
windowDef Difficulty0
{
rect DIFFICULTY_NAV_RECT_0
forecolor DIFFICULTY_NAV_COLOR
text "gui::diff0Name"
textscale DIFFICULTY_NAV_TEXTSCALE
textalign DIFFICULTY_NAV_TEXTALIGN
font SDIFFICULTY_NAV_FONT
onTime 0
{
if ("gui::diffSelect" == 0) {
set "forecolor" SDIFFICULTY_NAV_SELECTED;
} else {
set "forecolor" SDIFFICULTY_NAV_COLOR;
}
set "notime" "1";
}
onAction
{
set "Difficulty1::forecolor" SDIFFICULTY_NAV_COLOR;
set "Difficulty2::forecolor" SDIFFICULTY_NAV_COLOR;
set "forecolor" SDIFFICULTY_NAV_SELECTED;
set "gui::diffSelect" "0";
set "cmd" "log 'Selected difficulty level 0.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
windowDef Difficulty1
{
rect DIFFICULTY_NAV_RECT_1
forecolor DIFFICULTY_NAV_COLOR
text "gui::diff1Name"
textscale DIFFICULTY_NAV_TEXTSCALE
textalign DIFFICULTY_NAV_TEXTALIGN
font SDIFFICULTY_NAV_FONT
onTime 0
{
if ("gui::diffSelect" == 1) {
set "forecolor" SDIFFICULTY_NAV_SELECTED;
} else {
set "forecolor" SDIFFICULTY_NAV_COLOR;
}
set "notime" "1";
}
onAction
{
set "Difficulty0::forecolor" SDIFFICULTY_NAV_COLOR;
set "Difficulty2::forecolor" SDIFFICULTY_NAV_COLOR;
set "forecolor" SDIFFICULTY_NAV_SELECTED;
set "gui::diffSelect" "1";
set "cmd" "log 'Selected difficulty level 1.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
windowDef Difficulty2
{
rect DIFFICULTY_NAV_RECT_2
forecolor DIFFICULTY_NAV_COLOR
text "gui::diff2Name"
textscale DIFFICULTY_NAV_TEXTSCALE
textalign DIFFICULTY_NAV_TEXTALIGN
font SDIFFICULTY_NAV_FONT
onTime 0
{
if ("gui::diffSelect" == 2) {
set "forecolor" SDIFFICULTY_NAV_SELECTED;
} else {
set "forecolor" SDIFFICULTY_NAV_COLOR;
}
set "notime" "1";
}
onAction
{
set "Difficulty0::forecolor" SDIFFICULTY_NAV_COLOR;
set "Difficulty1::forecolor" SDIFFICULTY_NAV_COLOR;
set "forecolor" SDIFFICULTY_NAV_SELECTED;
set "gui::diffSelect" "2";
set "cmd" "log 'Selected difficulty level 2.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
}
/***************************************************************************
*
* The "Resume Game" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesResumeButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesResumeButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesResumeButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
// The "objective_close_request" will be caught by the SDK code and shut down this GUI
set "cmd" "play sound/meta/menu/mnu_select;";
resetTime "ObjectivesDelayedCloseRequest" 0;
}
}
// Sends an objective close request after a short delay
windowDef ObjectivesDelayedCloseRequest
{
rect 0,0,0,0
notime 1
onTime 400
{
set "cmd" "close";
set "notime" "1";
}
}
// Called by the SDK when displaying the objectives in the pre-mission menu
onNamedEvent ObjMenuShowDifficultyOptions
{
// Display the Difficulty choices
set "gui::DifficultyIsVisible" "1";
// Hide the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "0";
}
// Called by the SDK when displaying the objectives in-game
onNamedEvent ObjMenuHideDifficultyOptions
{
// Hide the Difficulty choices
set "gui::DifficultyIsVisible" "0";
// Display the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "1";
}
/***************************************************************************
*
* The "Main Menu" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesMainmenuButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
}
windowDef ObjectivesMainmenuButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesMainmenuButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesMainmenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
// Switch to the main menu
set "gui::targetmode" MM_STATE_MAINMENU;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Buy Equipment" or "Start Mission" Buttons
*
**************************************************************************/
windowDef ObjectivesStartMissionButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
onMouseEnter
{
transition "ObjectivesStartMissionButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesStartMissionButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Starting mission.'";
}
}
windowDef ObjectivesBuyEquipmentButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
onMouseEnter
{
transition "ObjectivesBuyEquipmentButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBuyEquipmentButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Entering shop.'";
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Briefing/Back" Button (only visible in start menu)
*
**************************************************************************/
windowDef ObjectivesBriefingButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_07202" // Back
visible ("gui::inGame" == 0)
}
windowDef ObjectivesBriefingButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_07202" // Back
visible ("gui::inGame" == 0)
onMouseEnter
{
transition "ObjectivesBriefingButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBriefingButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select";
// Switch to briefing
set "gui::targetmode" MM_STATE_BACKWARD;
resetTime "MainMenuModeSelect" 0;
}
}
} // ObjectivesMenu
r16727-fix-objectives-screen-v2.diff (7,708 bytes)
diff --git guis/mainmenu_objectives.gui guis/mainmenu_objectives.gui
index e02f7c3..13c1a47 100644
--- guis/mainmenu_objectives.gui
+++ guis/mainmenu_objectives.gui
@@ -11,7 +11,7 @@ windowDef ObjectivesMenu
{
rect 0,0,640,640
visible 0
-
+
windowDef ObjectivesMenuParchment
{
rect ("gui::ingame" ? 0 : 50), -75, 640, 640
@@ -43,7 +43,7 @@ windowDef ObjectivesMenu
set "cmd" "log 'Issuing objective_open_request call.'";
set "cmd" "objective_open_request";
- set "notime" 1;
+ set "notime" "1";
}
}
@@ -88,45 +88,50 @@ windowDef ObjectivesMenu
windowDef DifficultySelection
{
+ #define DIFFICULTY_NAV_COLOR 0.6,0.6,0.6,0.7
+ #define SDIFFICULTY_NAV_COLOR "0.6,0.6,0.6,0.7"
+ #define SDIFFICULTY_NAV_HOVER "1,1,1,0.9"
+ #define SDIFFICULTY_NAV_SELECTED "1,1,1,1"
+
+ #define DIFFICULTY_NAV_RECT_0 12,80,123,62
+ #define DIFFICULTY_NAV_RECT_1 12,208,123,62
+ #define DIFFICULTY_NAV_RECT_2 12,336,123,62
+
+ #define DIFFICULTY_NAV_TEXTSCALE 0.36
+ #define DIFFICULTY_NAV_TEXTALIGN 0
+ #define SDIFFICULTY_NAV_FONT "fonts/carleton"
+
rect 0,0,640,640
visible "gui::DifficultyIsVisible"
notime 1
- onTime 0
- {
- // set the default color for all values, will be corrected below
- set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
- }
-
windowDef Difficulty0
{
- rect 12,80,123,62
- forecolor 0.6,0.6,0.6,.7
+ rect DIFFICULTY_NAV_RECT_0
+ forecolor DIFFICULTY_NAV_COLOR
text "gui::diff0Name"
- textscale 0.36
- textalign 0
- font "fonts/carleton"
- notime 1
+ textscale DIFFICULTY_NAV_TEXTSCALE
+ textalign DIFFICULTY_NAV_TEXTALIGN
+ font SDIFFICULTY_NAV_FONT
onTime 0
{
- if ("gui::diffSelect" == 0)
- {
- set "forecolor" "1,1,1,1";
+ if ("gui::diffSelect" == 0) {
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ } else {
+ set "forecolor" SDIFFICULTY_NAV_COLOR;
}
+ set "notime" "1";
}
onAction
{
- set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
- set "forecolor" "1,1,1,1";
- set "gui::diffSelect" "0";
+ set "Difficulty1::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "Difficulty2::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ set "gui::diffSelect" "0";
set "cmd" "log 'Selected difficulty level 0.'";
-
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
@@ -134,7 +139,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 0)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -143,38 +148,46 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 0)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,0.7" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
windowDef Difficulty1
{
- rect 12,208,123,62
- forecolor 1,1,1,.7
+ rect DIFFICULTY_NAV_RECT_1
+ forecolor DIFFICULTY_NAV_COLOR
text "gui::diff1Name"
- textscale 0.36
- textalign 0
- font "fonts/carleton"
- notime 1
+ textscale DIFFICULTY_NAV_TEXTSCALE
+ textalign DIFFICULTY_NAV_TEXTALIGN
+ font SDIFFICULTY_NAV_FONT
+
+ onTime 0
+ {
+ if ("gui::diffSelect" == 1) {
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ } else {
+ set "forecolor" SDIFFICULTY_NAV_COLOR;
+ }
+ set "notime" "1";
+ }
onAction
{
- set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
- set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
- set "forecolor" "1,1,1,1";
- set "gui::diffSelect" "1";
+ set "Difficulty0::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "Difficulty2::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ set "gui::diffSelect" "1";
set "cmd" "log 'Selected difficulty level 1.'";
-
- set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
+ set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 1)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -183,46 +196,46 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 1)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
windowDef Difficulty2
{
- rect 12,336,123,62
- forecolor 1,1,1,.7
+ rect DIFFICULTY_NAV_RECT_2
+ forecolor DIFFICULTY_NAV_COLOR
text "gui::diff2Name"
- textscale 0.36
- textalign 0
- font "fonts/carleton"
- notime 1
+ textscale DIFFICULTY_NAV_TEXTSCALE
+ textalign DIFFICULTY_NAV_TEXTALIGN
+ font SDIFFICULTY_NAV_FONT
onTime 0
{
- if ("gui::diffSelect" == 2)
- {
- set "forecolor" "1,1,1,1";
+ if ("gui::diffSelect" == 2) {
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ } else {
+ set "forecolor" SDIFFICULTY_NAV_COLOR;
}
+ set "notime" "1";
}
-
+
onAction
{
- set "Difficulty0::forecolor" "0.6,0.6,0.6,.7";
- set "Difficulty1::forecolor" "0.6,0.6,0.6,.7";
- set "forecolor" "1,1,1,1";
- set "gui::diffSelect" "2";
+ set "Difficulty0::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "Difficulty1::forecolor" SDIFFICULTY_NAV_COLOR;
+ set "forecolor" SDIFFICULTY_NAV_SELECTED;
+ set "gui::diffSelect" "2";
set "cmd" "log 'Selected difficulty level 2.'";
-
- set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
+ set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 2)
{
- transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_COLOR SDIFFICULTY_NAV_HOVER "50";
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
@@ -231,7 +244,7 @@ windowDef ObjectivesMenu
{
if ("gui::diffSelect" != 2)
{
- transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
+ transition "forecolor" SDIFFICULTY_NAV_HOVER SDIFFICULTY_NAV_COLOR "50" ;
}
}
}
@@ -294,7 +307,7 @@ windowDef ObjectivesMenu
onTime 400
{
set "cmd" "close";
- set "notime" 1;
+ set "notime" "1";
}
}
@@ -357,7 +370,7 @@ windowDef ObjectivesMenu
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
-
+
// Switch to the main menu
set "gui::targetmode" MM_STATE_MAINMENU;
resetTime "MainMenuModeSelect" 0;
@@ -409,7 +422,7 @@ windowDef ObjectivesMenu
{
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
-
+
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Starting mission.'";
}
@@ -458,7 +471,7 @@ windowDef ObjectivesMenu
}
}
-
+
/***************************************************************************
*
* The "Briefing/Back" Button (only visible in start menu)
@@ -498,7 +511,7 @@ windowDef ObjectivesMenu
onAction
{
set "cmd" "play sound/meta/menu/mnu_select";
-
+
// Switch to briefing
set "gui::targetmode" MM_STATE_BACKWARD;
resetTime "MainMenuModeSelect" 0;
|
|
|
I committed a fix somewhat similar to your first diff in svn rev 16740. Speaking of the old GUI, it's probably not a good idea to clean or refactor it too much, especially during beta. Also, the new fix works even after selecting another mission. |
|
|
I don't have access to the asset svn, so I can't see how my patch was applied. It's really important that the newest patch is applied as it handles some edge cases. Also, the refactoring will make it much easier to read for the next person, and it's not that much. It's much less code and much less complicated than other code getting committed during beta. I spent a lot of time making sure it was correct. If something is wrong, we'll catch it before 2.11 release. |
|
|
Oh, sorry. Attached the files. The main difference I guess is to do initialization in "Init" function of the state. difficulty_highlight_fix.diff (1,689 bytes)
Index: mainmenu_objectives.gui
===================================================================
--- mainmenu_objectives.gui (revision 16739)
+++ mainmenu_objectives.gui (revision 16740)
@@ -43,6 +43,9 @@
set "cmd" "log 'Issuing objective_open_request call.'";
set "cmd" "objective_open_request";
+ // #6229: highlight proper difficulty initially
+ set "DifficultySelection::notime" "0";
+
set "notime" 1;
}
}
@@ -92,12 +95,26 @@
visible "gui::DifficultyIsVisible"
notime 1
- onTime 0
+ // #6229: objective_open_request sets diffSelect
+ // so should wait a bit (10 ms) for it to finish
+ onTime 10
{
- // set the default color for all values, will be corrected below
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
+ if ("gui::diffSelect" == 0)
+ {
+ set "Difficulty0::forecolor" "1,1,1,1";
+ }
+ if ("gui::diffSelect" == 1)
+ {
+ set "Difficulty1::forecolor" "1,1,1,1";
+ }
+ if ("gui::diffSelect" == 2)
+ {
+ set "Difficulty2::forecolor" "1,1,1,1";
+ }
+ set "notime" "1";
}
windowDef Difficulty0
@@ -110,14 +127,6 @@
font "fonts/carleton"
notime 1
- onTime 0
- {
- if ("gui::diffSelect" == 0)
- {
- set "forecolor" "1,1,1,1";
- }
- }
-
onAction
{
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
@@ -198,14 +207,6 @@
font "fonts/carleton"
notime 1
- onTime 0
- {
- if ("gui::diffSelect" == 2)
- {
- set "forecolor" "1,1,1,1";
- }
- }
-
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,.7";
mainmenu_objectives-3.gui (13,018 bytes)
// For vim users, don't remove: vim:ts=4:sw=4:cindent
/* =============================================================================================
*
* This file is part of The Dark Mod's Main Menu GUI
*
* Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4.
*
* ============================================================================================= */
windowDef ObjectivesMenu
{
rect 0,0,640,640
visible 0
windowDef ObjectivesMenuParchment
{
rect ("gui::ingame" ? 0 : 50), -75, 640, 640
matcolor 1,1,1,1
background "guis/assets/objectives/parchment_untitled"
}
// This is called whenever the user switches to this screen
windowDef ObjectivesStateInit
{
noTime 1
// Init methods have onTime 10 instead of onTime 0.
onTime 10
{
set "cmd" "log 'ObjectivesStateInit called.'";
set "gui::ObjStartIdx" "0";
// Show our parent windowDef
set "ObjectivesMenu::visible" "1";
// stgatilov: background layers must never be enabled/disabled manually!
// unfortunately, we have to leave this hack here for compatibility with old missions:
// They override mainmenu_briefing.gui, which enables the figures in End code =(
set "MainMenuBackgroundFigures::visible" "0";
// Issue the open request to the SDK
set "cmd" "log 'Issuing objective_open_request call.'";
set "cmd" "objective_open_request";
// #6229: highlight proper difficulty initially
set "DifficultySelection::notime" "0";
set "notime" 1;
}
}
// Called when the MainMenuModeSelect script switches states.
windowDef ObjectivesStateEnd
{
noTime 1
onTime 0
{
set "cmd" "log 'ObjectivesStateEnd called.'";
set "ObjectivesMenu::visible" "0";
set "notime" "1";
}
}
/***************************************************************************
*
* Actual objectives
*
**************************************************************************/
windowDef ObjectivesHolder
{
#define OBJ_OFFSET_X ("gui::ingame" ? 110 : 160)
#define OBJ_FULL_WIDTH 460
#define OBJ_FULL_HEIGHT 355
rect OBJ_OFFSET_X, 60, OBJ_FULL_WIDTH, OBJ_FULL_HEIGHT
//backcolor 0.2,0.5,1.0,1 //for debugging
#include "guis/tdm_objectives_core.gui"
}
/***************************************************************************
*
* The Difficulty selection buttons (only visible in start game)
*
**************************************************************************/
windowDef DifficultySelection
{
rect 0,0,640,640
visible "gui::DifficultyIsVisible"
notime 1
// #6229: objective_open_request sets diffSelect
// so should wait a bit (10 ms) for it to finish
onTime 10
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
if ("gui::diffSelect" == 0)
{
set "Difficulty0::forecolor" "1,1,1,1";
}
if ("gui::diffSelect" == 1)
{
set "Difficulty1::forecolor" "1,1,1,1";
}
if ("gui::diffSelect" == 2)
{
set "Difficulty2::forecolor" "1,1,1,1";
}
set "notime" "1";
}
windowDef Difficulty0
{
rect 12,80,123,62
forecolor 0.6,0.6,0.6,.7
text "gui::diff0Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onAction
{
set "Difficulty1::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "0";
set "cmd" "log 'Selected difficulty level 0.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 0)
{
transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,0.7" "50" ;
}
}
}
windowDef Difficulty1
{
rect 12,208,123,62
forecolor 1,1,1,.7
text "gui::diff1Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,0.7";
set "Difficulty2::forecolor" "0.6,0.6,0.6,0.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "1";
set "cmd" "log 'Selected difficulty level 1.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 1)
{
transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
}
}
}
windowDef Difficulty2
{
rect 12,336,123,62
forecolor 1,1,1,.7
text "gui::diff2Name"
textscale 0.36
textalign 0
font "fonts/carleton"
notime 1
onAction
{
set "Difficulty0::forecolor" "0.6,0.6,0.6,.7";
set "Difficulty1::forecolor" "0.6,0.6,0.6,.7";
set "forecolor" "1,1,1,1";
set "gui::diffSelect" "2";
set "cmd" "log 'Selected difficulty level 2.'";
set "cmd" "play sound/meta/menu/mnu_select; diffSelect";
}
onMouseEnter
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" "0.6,0.6,0.6,.7" "1,1,1,.9" "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
}
onMouseExit
{
if ("gui::diffSelect" != 2)
{
transition "forecolor" "1,1,1,.9" "0.6,0.6,0.6,.7" "50" ;
}
}
}
}
/***************************************************************************
*
* The "Resume Game" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesResumeButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02102" // Resume Mission
visible ("gui::inGame" == 1)
}
windowDef ObjectivesResumeButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesResumeButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesResumeButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesResumeButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
// The "objective_close_request" will be caught by the SDK code and shut down this GUI
set "cmd" "play sound/meta/menu/mnu_select;";
resetTime "ObjectivesDelayedCloseRequest" 0;
}
}
// Sends an objective close request after a short delay
windowDef ObjectivesDelayedCloseRequest
{
rect 0,0,0,0
notime 1
onTime 400
{
set "cmd" "close";
set "notime" 1;
}
}
// Called by the SDK when displaying the objectives in the pre-mission menu
onNamedEvent ObjMenuShowDifficultyOptions
{
// Display the Difficulty choices
set "gui::DifficultyIsVisible" "1";
// Hide the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "0";
}
// Called by the SDK when displaying the objectives in-game
onNamedEvent ObjMenuHideDifficultyOptions
{
// Hide the Difficulty choices
set "gui::DifficultyIsVisible" "0";
// Display the objective checkboxes
set "gui::ObjectiveBoxIsVisible" "1";
}
/***************************************************************************
*
* The "Main Menu" Button (only visible in-game)
*
**************************************************************************/
windowDef ObjectivesMainmenuButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
}
windowDef ObjectivesMainmenuButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02114" // Main Menu
visible ("gui::inGame" == 1)
onMouseEnter
{
transition "ObjectivesMainmenuButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesMainmenuButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesMainmenuButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
// Switch to the main menu
set "gui::targetmode" MM_STATE_MAINMENU;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Buy Equipment" or "Start Mission" Buttons
*
**************************************************************************/
windowDef ObjectivesStartMissionButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02253" // Start Mission
textalignx -2
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
}
windowDef ObjectivesStartMissionButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 1)
onMouseEnter
{
transition "ObjectivesStartMissionButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesStartMissionButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesStartMissionButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Starting mission.'";
}
}
windowDef ObjectivesBuyEquipmentButtonH
{
MM_POS_OBJ_FORWARD_BUTTON_GLOW
MM_FONT_RIGHT_GLOW
MM_BUTTON_HUGE
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButton
{
MM_POS_OBJ_FORWARD_BUTTON
MM_FONT_RIGHT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_02205" // Buy Equipment
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
}
windowDef ObjectivesBuyEquipmentButtonAction
{
MM_POS_OBJ_FORWARD_ACTION
visible ("gui::inGame" == 0 && "gui::SkipShop" == 0)
onMouseEnter
{
transition "ObjectivesBuyEquipmentButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBuyEquipmentButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBuyEquipmentButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select;";
set "cmd" "log 'Entering shop.'";
set "gui::targetmode" MM_STATE_FORWARD;
resetTime "MainMenuModeSelect" 0;
}
}
/***************************************************************************
*
* The "Briefing/Back" Button (only visible in start menu)
*
**************************************************************************/
windowDef ObjectivesBriefingButtonH
{
MM_POS_OBJ_BACK_BUTTON_GLOW
MM_FONT_LEFT_GLOW
MM_BUTTON_HUGE
text "#str_07202" // Back
visible ("gui::inGame" == 0)
}
windowDef ObjectivesBriefingButton
{
MM_POS_OBJ_BACK_BUTTON
MM_FONT_LEFT
MM_BUTTON_HUGE
forecolor GLOW_WHITE_COLOR
text "#str_07202" // Back
visible ("gui::inGame" == 0)
onMouseEnter
{
transition "ObjectivesBriefingButton::forecolor" SGLOW_WHITE_COLOR SBOLDGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SINVISIBLE SGLOW_BRIGHTRED_COLOR "50" ;
set "cmd" "play sound/meta/menu/mnu_hover;";
}
onMouseExit
{
transition "ObjectivesBriefingButton::forecolor" SBOLDGLOW_WHITE_COLOR SGLOW_WHITE_COLOR "50" ;
transition "ObjectivesBriefingButtonH::forecolor" SGLOW_BRIGHTRED_COLOR SINVISIBLE "50" ;
}
onAction
{
set "cmd" "play sound/meta/menu/mnu_select";
// Switch to briefing
set "gui::targetmode" MM_STATE_BACKWARD;
resetTime "MainMenuModeSelect" 0;
}
}
} // ObjectivesMenu
|
|
|
Thank you for the files! =) I like the way you did it, and I learned more about how to write that kind of logic in gui files. "Ah! That's how it should be. Huzzah!" |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 11.01.2023 21:12 | Daft Mugi | New Issue | |
| 11.01.2023 21:12 | Daft Mugi | File Added: newjob (2023-01-11 15-01-35) (0 0 0).jpg | |
| 11.01.2023 21:12 | Daft Mugi | File Added: newjob (2023-01-11 15-01-49) (0 0 0).jpg | |
| 15.01.2023 06:32 | Daft Mugi | Note Added: 0015774 | |
| 15.01.2023 06:32 | Daft Mugi | File Added: mainmenu_objectives.gui | |
| 15.01.2023 06:32 | Daft Mugi | File Added: r16727-fix-objectives-screen.diff | |
| 15.01.2023 08:42 | Daft Mugi | Note Added: 0015775 | |
| 16.01.2023 06:51 | Daft Mugi | Relationship added | related to 0006233 |
| 16.01.2023 07:00 | Daft Mugi | Note Added: 0015782 | |
| 16.01.2023 07:00 | Daft Mugi | File Added: mainmenu_objectives-2.gui | |
| 16.01.2023 07:00 | Daft Mugi | File Added: r16727-fix-objectives-screen-v2.diff | |
| 16.01.2023 08:35 | stgatilov | Note Added: 0015785 | |
| 16.01.2023 09:37 | Daft Mugi | Note Added: 0015789 | |
| 16.01.2023 20:19 | stgatilov | Note Added: 0015791 | |
| 16.01.2023 20:19 | stgatilov | File Added: difficulty_highlight_fix.diff | |
| 16.01.2023 20:19 | stgatilov | File Added: mainmenu_objectives-3.gui | |
| 16.01.2023 21:19 | Daft Mugi | Note Added: 0015794 | |
| 16.01.2023 22:02 | stgatilov | Assigned To | => stgatilov |
| 16.01.2023 22:02 | stgatilov | Status | new => assigned |
| 16.01.2023 22:02 | stgatilov | Product Version | SVN => TDM 2.09 |
| 16.01.2023 22:02 | stgatilov | Fixed in Version | => TDM 2.11 |
| 16.01.2023 22:02 | stgatilov | Target Version | => TDM 2.11 |
| 16.01.2023 22:02 | stgatilov | Status | assigned => resolved |
| 16.01.2023 22:02 | stgatilov | Resolution | open => fixed |
| 16.01.2023 22:03 | stgatilov | Relationship replaced | has duplicate 0006233 |