diff options
author | belugas <belugas@openttd.org> | 2006-09-23 02:39:24 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-09-23 02:39:24 +0000 |
commit | 1c56a5ae0fefac5636a7f93c3bed9285fca558d8 (patch) | |
tree | 94c5771fcfbd839db8eabe8b14662d04e44ab61c /player_gui.c | |
parent | 0f78b620fbb4e4ca744ceffffc43a9c0846bca12 (diff) | |
download | openttd-1c56a5ae0fefac5636a7f93c3bed9285fca558d8.tar.xz |
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
Diffstat (limited to 'player_gui.c')
-rw-r--r-- | player_gui.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/player_gui.c b/player_gui.c index f4e9fc598..bfe8da281 100644 --- a/player_gui.c +++ b/player_gui.c @@ -166,7 +166,7 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e) } break; case WE_CLICK: - switch (e->click.widget) { + switch (e->we.click.widget) { case 2: {/* toggle size */ byte mode = (byte)WP(w,def_d).data_1; bool stickied = !!(w->flags4 & WF_STICKY); @@ -361,7 +361,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) } case WE_CLICK: { - switch (e->click.widget) { + switch (e->we.click.widget) { /* Livery Class buttons */ case 2: case 3: @@ -370,7 +370,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) case 6: { LiveryScheme scheme; - WP(w, livery_d).livery_class = e->click.widget - 2; + WP(w, livery_d).livery_class = e->we.click.widget - 2; WP(w, livery_d).sel = 0; /* Select the first item in the list */ @@ -380,7 +380,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) break; } } - w->click_state = 1 << e->click.widget; + w->click_state = 1 << e->we.click.widget; w->height = 49 + livery_height[WP(w, livery_d).livery_class] * 14; w->widget[13].bottom = w->height - 1; w->widget[13].data = livery_height[WP(w, livery_d).livery_class] << 8 | 1; @@ -400,7 +400,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) case 13: { LiveryScheme scheme; - LiveryScheme j = (e->click.pt.y - 48) / 14; + LiveryScheme j = (e->we.click.pt.y - 48) / 14; for (scheme = 0; scheme <= j; scheme++) { if (livery_class[scheme] != WP(w, livery_d).livery_class) j++; @@ -409,7 +409,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) if (j >= LS_END) return; /* If clicking on the left edge, toggle using the livery */ - if (e->click.pt.x < 10) { + if (e->we.click.pt.x < 10) { DoCommandP(0, j | (2 << 8), !GetPlayer(w->window_number)->livery[j].in_use, NULL, CMD_SET_PLAYER_COLOR); } @@ -430,7 +430,7 @@ static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e) for (scheme = LS_DEFAULT; scheme < LS_END; scheme++) { if (HASBIT(WP(w, livery_d).sel, scheme)) { - DoCommandP(0, scheme | (e->dropdown.button == 10 ? 0 : 256), e->dropdown.index, NULL, CMD_SET_PLAYER_COLOR); + DoCommandP(0, scheme | (e->we.dropdown.button == 10 ? 0 : 256), e->we.dropdown.index, NULL, CMD_SET_PLAYER_COLOR); } } break; @@ -476,7 +476,7 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e) } break; case WE_CLICK: - switch (e->click.widget) { + switch (e->we.click.widget) { case 3: DeleteWindow(w); break; case 4: /* ok click */ DoCommandP(0, 0, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); @@ -484,7 +484,7 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e) break; case 5: /* male click */ case 6: /* female click */ - WP(w,facesel_d).gender = e->click.widget - 5; + WP(w,facesel_d).gender = e->we.click.widget - 5; SetWindowDirty(w); break; case 7: @@ -704,7 +704,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) } break; case WE_CLICK: - switch (e->click.widget) { + switch (e->we.click.widget) { case 3: { /* select face */ Window *wf = AllocateWindowDescFront(&_select_player_face_desc, w->window_number); if (wf != NULL) { @@ -779,7 +779,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) break; case WE_PLACE_OBJ: { - if (DoCommandP(e->place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) + if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) ResetObjectToPlace(); break; } @@ -790,7 +790,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) break; case WE_ON_EDIT_TEXT: { - char *b = e->edittext.str; + char *b = e->we.edittext.str; // empty string is allowed for password if (*b == '\0' && WP(w,def_d).byte_1 != 2) return; @@ -860,7 +860,7 @@ static void BuyCompanyWndProc(Window *w, WindowEvent *e) } case WE_CLICK: - switch (e->click.widget) { + switch (e->we.click.widget) { case 3: DeleteWindow(w); break; |