mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-17 17:00:29 +02:00
You can now open add object in the scenario editor.
This commit is contained in:
+1
-1
@@ -734,7 +734,7 @@ int Coord_Spillage_Number(COORDINATE coord, int maxsize);
|
|||||||
** MENUS.CPP
|
** MENUS.CPP
|
||||||
*/
|
*/
|
||||||
void Setup_Menu(int menu, char const *text[], unsigned long field, int index, int skip);
|
void Setup_Menu(int menu, char const *text[], unsigned long field, int index, int skip);
|
||||||
int Check_Menu(int menu, char const *text[], char *selection, long field, int index);
|
int Check_Menu(int menu, char const *text[], char *selection, long field, int index, KeyNumType _key = KN_NONE);
|
||||||
int Do_Menu(char const **strings, bool blue);
|
int Do_Menu(char const **strings, bool blue);
|
||||||
extern int UnknownKey;
|
extern int UnknownKey;
|
||||||
int Main_Menu(unsigned long timeout);
|
int Main_Menu(unsigned long timeout);
|
||||||
|
|||||||
+18
-7
@@ -209,7 +209,7 @@ void Setup_Menu(int menu, char const * text[], unsigned long field, int index, i
|
|||||||
/* INPUTS: */
|
/* INPUTS: */
|
||||||
/* RETURNS: */
|
/* RETURNS: */
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
int Check_Menu(int menu, char const * text[], char *, long field, int index)
|
int Check_Menu(int menu, char const * text[], char *, long field, int index, KeyNumType _key)
|
||||||
{
|
{
|
||||||
int maxitem,select,key,menuy,menux;
|
int maxitem,select,key,menuy,menux;
|
||||||
int mx1,mx2,my1,my2,tempy;
|
int mx1,mx2,my1,my2,tempy;
|
||||||
@@ -236,14 +236,20 @@ int Check_Menu(int menu, char const * text[], char *, long field, int index)
|
|||||||
** present. If no keystroke is pending then simple mouse tracking will
|
** present. If no keystroke is pending then simple mouse tracking will
|
||||||
** be done.
|
** be done.
|
||||||
*/
|
*/
|
||||||
key = 0;
|
if (_key == KN_NONE)
|
||||||
UnknownKey = 0;
|
{
|
||||||
if (Keyboard->Check()) {
|
key = 0;
|
||||||
|
UnknownKey = 0;
|
||||||
|
if (Keyboard->Check()) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
key = (Keyboard->Get() & ~(WWKEY_SHIFT_BIT|WWKEY_ALT_BIT|WWKEY_CTRL_BIT) ); /* mask off all but release bit */
|
key = (Keyboard->Get() & ~(WWKEY_SHIFT_BIT | WWKEY_ALT_BIT | WWKEY_CTRL_BIT)); /* mask off all but release bit */
|
||||||
#else
|
#else
|
||||||
key = (Keyboard->Get()&0x08FF); /* mask off all but release bit */
|
key = (Keyboard->Get() & 0x08FF); /* mask off all but release bit */
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
key = _key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -432,8 +438,13 @@ int Do_Menu(char const ** strings, bool )
|
|||||||
selection = -1;
|
selection = -1;
|
||||||
UnknownKey = 0;
|
UnknownKey = 0;
|
||||||
while (selection == -1) {
|
while (selection == -1) {
|
||||||
|
// jmarshall
|
||||||
|
KeyNumType _key = KN_NONE;
|
||||||
|
int _flags;
|
||||||
|
WWSDL_ProcessEvents(_key, _flags);
|
||||||
|
// jmarshall end
|
||||||
Call_Back();
|
Call_Back();
|
||||||
selection = Check_Menu(0, strings, NULL, 0xFFL, 0);
|
selection = Check_Menu(0, strings, NULL, 0xFFL, 0, _key);
|
||||||
if (UnknownKey != 0 || UnknownKey == KN_ESC || UnknownKey==KN_LMOUSE || UnknownKey==KN_RMOUSE) break;
|
if (UnknownKey != 0 || UnknownKey == KN_ESC || UnknownKey==KN_LMOUSE || UnknownKey==KN_RMOUSE) break;
|
||||||
}
|
}
|
||||||
Keyboard->Clear();
|
Keyboard->Clear();
|
||||||
|
|||||||
@@ -732,7 +732,7 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags) {
|
|||||||
}
|
}
|
||||||
else if (event.button.button == SDL_BUTTON_RIGHT) {
|
else if (event.button.button == SDL_BUTTON_RIGHT) {
|
||||||
flags = GadgetClass::RIGHTPRESS;
|
flags = GadgetClass::RIGHTPRESS;
|
||||||
key = KN_LMOUSE;
|
key = KN_RMOUSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user