From e76e8ed82842bcf965d3d42b30de8ea1bbc97249 Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Tue, 23 Jun 2020 20:31:18 -0700 Subject: [PATCH] Right click mouse context menu in editor will close the editor menu if in root editor menu. Scenario Editor button workflow will no longer play music initially. Fixes to map placement dialog. --- code/REDALERT/MAPEDIT.CPP | 3 +++ code/REDALERT/MAPEDPLC.CPP | 7 +------ code/REDALERT/SCENARIO.CPP | 12 ++++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/REDALERT/MAPEDIT.CPP b/code/REDALERT/MAPEDIT.CPP index ab87f0e..9752e61 100644 --- a/code/REDALERT/MAPEDIT.CPP +++ b/code/REDALERT/MAPEDIT.CPP @@ -1594,6 +1594,9 @@ void MapEditClass::Main_Menu(void) Show_Mouse(); if (UnknownKey==KN_ESC || g_globalKeyNumType == KN_RMOUSE) { +// jmarshall - consume the RMOUSE DOWN + Buttons->Input(); +// jmarshall end break; } diff --git a/code/REDALERT/MAPEDPLC.CPP b/code/REDALERT/MAPEDPLC.CPP index 6016eae..3a4931c 100644 --- a/code/REDALERT/MAPEDPLC.CPP +++ b/code/REDALERT/MAPEDPLC.CPP @@ -70,7 +70,7 @@ void ImGui_Placement_Editor(void) { ImGuiStyle& style = ImGui::GetStyle(); style.FramePadding = ImVec2(0, 0); ImGui::SetNextWindowSize(ImVec2(480, 220)); - ImGui::SetNextWindowPos(ImVec2(0, 150)); + ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::Begin("Place Object", &toolActive, ImGuiWindowFlags_AlwaysAutoResize /*| ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoBackground*/); ImGui::Columns(3, "outer", true); ImGui::LabelText("Test", "Object Name"); @@ -429,8 +429,6 @@ int MapEditClass::Placement_Dialog(void) g_globalKeyFlags = 0; UserInput.Process_Input(); - Device_Present(); - /* ** Refresh display if needed */ @@ -442,9 +440,6 @@ int MapEditClass::Placement_Dialog(void) Hide_Mouse(); // Dialog_Box(D_DIALOG_X, D_DIALOG_Y, D_DIALOG_W, D_DIALOG_H); // Draw_Caption(TXT_PLACE_OBJECT, D_DIALOG_X, D_DIALOG_Y, D_DIALOG_W); -// jmarshall - temp render a black background here so the tool works. - LogicPage->Fill_Rect(D_DIALOG_X, D_DIALOG_Y, D_DIALOG_X + D_DIALOG_W, D_DIALOG_Y + D_DIALOG_H, 0); -// jamrshall end /* ** Display the current object: diff --git a/code/REDALERT/SCENARIO.CPP b/code/REDALERT/SCENARIO.CPP index b700ee3..aa6c41d 100644 --- a/code/REDALERT/SCENARIO.CPP +++ b/code/REDALERT/SCENARIO.CPP @@ -63,6 +63,7 @@ #ifdef WIN32 #include "tcpip.h" #include "ccdde.h" +#include "audiomix.h" extern bool SpawnedFromWChat; #endif @@ -421,12 +422,19 @@ bool Start_Scenario(char * name, bool briefing) Show_Mouse(); Play_Movie(Scen.ActionMovie, Scen.TransitTheme); } - } - Debug_SkipBriefing = false; + } if (Scen.TransitTheme == THEME_NONE) { Theme.Queue_Song(THEME_FIRST); } +// jmarshall + // If we are skipping the briefing, pausing the music(assuming in editor mode). + if (Debug_SkipBriefing) { + AudMix_SetMusicState(false); + } +// jmarshall end + + Debug_SkipBriefing = false; /* ** Set the options values, since the palette has been initialized by Read_Scenario