Changeset - r1637:f1305a64c137
[Not reviewed]
master
0 2 0
Darkvater - 19 years ago 2005-04-03 13:35:43
darkvater@openttd.org
(svn r2141) - Fix: Keys now hopefully only activate the right windows. If console/querybox/chatbox is open, all input goes there, if closed to game itself.
2 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
main_gui.c
Show inline comments
 
@@ -1908,14 +1908,14 @@ static void MainToolbarWndProc(Window *w
 
		case WKC_CTRL  | 'S': _make_screenshot = 1; break;
 
		case WKC_CTRL  | 'G': _make_screenshot = 2; break;
 
		case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break;
 
		case 'A': ShowBuildRailToolbar(_last_built_railtype, 4); break; /* Invoke Autorail */
 
		case 'L': ShowTerraformToolbar(); break;
 
		default: return;
 
		}
 
		e->keypress.cont = false;
 
		}
 
	} break;
 

	
 
	case WE_PLACE_OBJ: {
 
		_place_proc(e->place.tile);
 
	} break;
 

	
 
@@ -2394,31 +2394,31 @@ void SetupColorsAndInitialWindow(void)
 
	width = _screen.width;
 
	height = _screen.height;
 

	
 
	// XXX: these are not done
 
	switch(_game_mode) {
 
	case GM_MENU:
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, 0, NULL);
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL);
 
		AssignWindowViewport(w, 0, 0, width, height, TILE_XY(32, 32), 0);
 
//		w = AllocateWindowDesc(&_toolb_intro_desc);
 
//		w->flags4 &= ~WF_WHITE_BORDER_MASK;
 
		ShowSelectGameWindow();
 
		break;
 
	case GM_NORMAL:
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, 0, NULL);
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL);
 
		AssignWindowViewport(w, 0, 0, width, height, TILE_XY(32, 32), 0);
 

	
 
		ShowVitalWindows();
 

	
 
		/* Bring joining GUI to front till the client is really joined */
 
		if (_networking && !_network_server)
 
			ShowJoinStatusWindowAfterJoin();
 

	
 
		break;
 
	case GM_EDITOR:
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, 0, NULL);
 
		w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL);
 
		AssignWindowViewport(w, 0, 0, width, height, 0, 0);
 

	
 
		w = AllocateWindowDesc(&_toolb_scen_desc);
 
		w->disabled_state = 1 << 9;
 
		CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
 

	
window.c
Show inline comments
 
@@ -1263,25 +1263,28 @@ static void HandleKeypress(uint32 key)
 
	we.keypress.event = WE_KEYPRESS;
 
	we.keypress.ascii = key & 0xFF;
 
	we.keypress.keycode = key >> 16;
 
	we.keypress.cont = true;
 

	
 
	// check if we have a query string window open before allowing hotkeys
 
	if(FindWindowById(WC_QUERY_STRING, 0)!=NULL || FindWindowById(WC_SEND_NETWORK_MSG, 0)!=NULL)
 
	if(FindWindowById(WC_QUERY_STRING, 0)!=NULL || FindWindowById(WC_SEND_NETWORK_MSG, 0)!=NULL || FindWindowById(WC_CONSOLE, 0)!=NULL)
 
		query_open = true;
 

	
 
	// Call the event, start with the uppermost window.
 
	for(w=_last_window; w != _windows;) {
 
		--w;
 
		// if a query window is open, only call the event for certain window types
 
		if(query_open && w->window_class!=WC_QUERY_STRING && w->window_class!=WC_SEND_NETWORK_MSG && w->window_class!=WC_MAIN_TOOLBAR)
 
		if(query_open && w->window_class!=WC_QUERY_STRING && w->window_class!=WC_SEND_NETWORK_MSG && w->window_class!=WC_CONSOLE)
 
			continue;
 
		w->wndproc(w, &we);
 
		if (!we.keypress.cont)
 
			break;
 
	}
 

	
 
	if (we.keypress.cont)
 
		FindWindowById(WC_MAIN_TOOLBAR, 0)->wndproc(w, &we);
 
}
 

	
 
extern void UpdateTileSelection(void);
 
extern bool VpHandlePlaceSizingDrag(void);
 

	
 
static void MouseLoop(int click, int mousewheel)
0 comments (0 inline, 0 general)