(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.

This commit is contained in:
rubidium
2008-05-17 23:11:06 +00:00
parent b101faea20
commit d284ba2283
13 changed files with 85 additions and 81 deletions

View File

@@ -926,7 +926,7 @@ public:
ResetObjectToPlace();
}
virtual bool OnKeyPress(uint16 key, uint16 keycode)
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
static const KeyToEvent keytoevent[] = {
{'D', OrderClick_Skip},
@@ -939,15 +939,15 @@ public:
//('?', OrderClick_Service},
};
if (this->vehicle->owner != _local_player) return true;
if (this->vehicle->owner != _local_player) return ES_NOT_HANDLED;
for (uint i = 0; i < lengthof(keytoevent); i++) {
if (keycode == keytoevent[i].keycode) {
keytoevent[i].proc(this, -1);
return false;
return ES_HANDLED;
}
}
return true;
return ES_NOT_HANDLED;
}
virtual void OnPlaceObject(Point pt, TileIndex tile)