OpenTTDDevBlackBook/Window/WindowEvents

From OpenTTD

Jump to: navigation, search
HAL (Hardware Abstraction Layer)

Audio
Music
Graphic

Window System

Using the Window System
Events used by the Window System
Colour codes that exist in OpenTTD

Patches

HOWTO - Add a patch option

The Map / Scenario

Understanding the Dynamic Landscape Array
Understanding the SaveGame Handler
HOWTO - Create good Scenarios
HOWTO - Add New Town Name Generators

The actual simulation

Vehicles
Using Orders
Pathfinding
Ratings
Train Acceleration

Language and Strings

Using OpenTTD Strings

Multiplayer

The Core Interface

Starting a Server
Connecting to a Server
Using the list of LAN/Internet Games

The OpenTTD TCP Protocol
The OpenTTD UDP Protocol
HOWTO - Debug desyncs

Ingame Console

The Console Window
Using Console Scripting
HOWTO - Add Functions/Commands to the Console
HOWTO - Add Variables to the Console
HOWTO - Direct Variable Access using ICONSOLE_VAR_POINTER
OpenTTD Console Commands
OpenTTD Console Variables
Development History

enum WindowEvents {
	WE_CLICK = 0,
	WE_PAINT = 1,
	WE_MOUSELOOP = 2,
	WE_TICK = 3,
	WE_4 = 4,
	WE_TIMEOUT = 5,
	WE_PLACE_OBJ = 6,
	WE_ABORT_PLACE_OBJ = 7,
	WE_DESTROY = 8,
	WE_ON_EDIT_TEXT = 9,
	WE_POPUPMENU_SELECT = 10,
	WE_POPUPMENU_OVER = 11,
	WE_DRAGDROP = 12,
	WE_PLACE_DRAG = 13,
	WE_PLACE_MOUSEUP = 14,
	WE_PLACE_PRESIZE = 15,
	WE_DROPDOWN_SELECT = 16,
	WE_RCLICK = 17,
	WE_KEYPRESS = 18,
	WE_CREATE = 19,
};


WE_CLICK
Is sent whenever a mouseclick has been done on a widget.
WE_PAINT
Is sent whenever a window has to be drawn.
WE_MOUSELOOP
Is sent every mouseloop, eg. every frame that a mousemove can be detected
WE_TICK
Gets sent every tick. 74 ticks is about 1 ingame day. (Roughly 2 seconds). When game is paused, no ticks occur
WE_4
(Should be renamed) Is sent every 100 times UpdateWindows() is called.
WE_TIMEOUT
Is sent when a window times out. Usually used to unclick buttons.
WE_PLACE_OBJ
Is sent when someone clicks on a build button.
WE_ABORT_PLACE_OBJ
Is sent whenever someone cancels building something.
WE_DESTROY
Is sent whenever a window gets destroyed.
WE_ON_EDIT_TEXT
Is sent whenever a bit of text gets edited in a textfield. (Example: The company name)
WE_POPUPMENU_SELECT
Image:ToDoIcon.png
To Do
Whoever added this template didn't specify what was to be done, so it should be removed or updated with the correct action.


WE_POPUPMENU_OVER
Image:ToDoIcon.png
To Do
Whoever added this template didn't specify what was to be done, so it should be removed or updated with the correct action.


WE_DRAGDROP
Is sent when the mousebutton gets released while dragging something. (Example: Selling vehicles)
WE_PLACE_DRAG
Is sent when there is a building selected. This draws the little white squares indicating where the building will be placed.
WE_PLACE_MOUSEUP
Is sent when the mousebutton gets released.
WE_PLACE_PRESIZE
Image:ToDoIcon.png
To Do
Whoever added this template didn't specify what was to be done, so it should be removed or updated with the correct action.


WE_DROPDOWN_SELECT
Is sent whenever something is selected in a dropdown list.
WE_RCLICK
Is sent whenever the right mouse button is clicked on a window or widget. (Example: Tooltips!)
WE_KEYPRESS
Is sent to the active window when a key is pressed.
WE_CREATE
Is sent when a window gets created.
Personal tools