mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Disabled scroll in editor when user is interacting with the top menu.
This commit is contained in:
@@ -109,7 +109,11 @@ void ScrollClass::AI(KeyNumType &input, int x, int y)
|
||||
int screen_width = SeenBuff.Get_Width();
|
||||
int screen_height = SeenBuff.Get_Height();
|
||||
|
||||
bool at_screen_edge = (y == 0 || x == 0 || x >= screen_width - 1 || y >= screen_height - 1);
|
||||
bool at_screen_edge = false;
|
||||
|
||||
if (!Debug_Map || !Debug_LockScroll) {
|
||||
at_screen_edge = (y == 0 || x == 0 || x >= screen_width - 1 || y >= screen_height - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Verify that the mouse is over a scroll region.
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "function.h"
|
||||
#include "image.h"
|
||||
|
||||
bool Debug_LockScroll = false;
|
||||
|
||||
void SidebarEditor::init() {
|
||||
metalplt = LoadEditorImage("metalplt.shp");
|
||||
|
||||
@@ -36,10 +38,12 @@ void SidebarEditor::draw_it(void) {
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
style.FramePadding = ImVec2(0, 0);
|
||||
|
||||
Debug_LockScroll = false;
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
{
|
||||
if (ImGui::BeginMenu("File"))
|
||||
{
|
||||
Debug_LockScroll = true;
|
||||
if (ImGui::MenuItem("New Scenario")) { mainmenu_selection = 0; }
|
||||
if (ImGui::MenuItem("Load Scenario")) { mainmenu_selection = 1; }
|
||||
if (ImGui::MenuItem("Save Scenario")) { mainmenu_selection = 2; }
|
||||
@@ -48,6 +52,7 @@ void SidebarEditor::draw_it(void) {
|
||||
}
|
||||
if (ImGui::BeginMenu("Map"))
|
||||
{
|
||||
Debug_LockScroll = true;
|
||||
if (ImGui::MenuItem("Size Map")) { mainmenu_selection = 3; }
|
||||
if (ImGui::MenuItem("Scenario Options")) { mainmenu_selection = 5; }
|
||||
if (ImGui::MenuItem("AI Options")) { mainmenu_selection = 6; }
|
||||
@@ -55,12 +60,14 @@ void SidebarEditor::draw_it(void) {
|
||||
}
|
||||
if (ImGui::BeginMenu("Objects"))
|
||||
{
|
||||
Debug_LockScroll = true;
|
||||
if (ImGui::MenuItem("Add Game Object")) { mainmenu_selection = 4; }
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
if (ImGui::BeginMenu("Run"))
|
||||
{
|
||||
Debug_LockScroll = true;
|
||||
if (ImGui::MenuItem("Play Scenario")) { mainmenu_selection = 7; }
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
@@ -13,4 +13,6 @@ private:
|
||||
Image_t* LoadEditorImage(const char* name);
|
||||
private:
|
||||
Image_t* metalplt;
|
||||
};
|
||||
};
|
||||
|
||||
extern bool Debug_LockScroll;
|
||||
Reference in New Issue
Block a user