327 |
327 |
328 SetVScrollCount(w, gl->l.list_length); |
328 SetVScrollCount(w, gl->l.list_length); |
329 SetVScroll2Count(w, gv->l.list_length); |
329 SetVScroll2Count(w, gv->l.list_length); |
330 |
330 |
331 /* Disable all lists management button when the list is empty */ |
331 /* Disable all lists management button when the list is empty */ |
332 SetWindowWidgetsDisabledState(w, gv->l.list_length == 0, |
332 SetWindowWidgetsDisabledState(w, gv->l.list_length == 0 || _local_player != owner, |
333 GRP_WIDGET_STOP_ALL, |
333 GRP_WIDGET_STOP_ALL, |
334 GRP_WIDGET_START_ALL, |
334 GRP_WIDGET_START_ALL, |
335 GRP_WIDGET_MANAGE_VEHICLES, |
335 GRP_WIDGET_MANAGE_VEHICLES, |
336 GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN, |
336 GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN, |
337 WIDGET_LIST_END); |
337 WIDGET_LIST_END); |
338 |
338 |
339 /* Disable the group specific function when we select the default group or all vehicles */ |
339 /* Disable the group specific function when we select the default group or all vehicles */ |
340 SetWindowWidgetsDisabledState(w, IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel), |
340 SetWindowWidgetsDisabledState(w, IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel) || _local_player != owner, |
341 GRP_WIDGET_DELETE_GROUP, |
341 GRP_WIDGET_DELETE_GROUP, |
342 GRP_WIDGET_RENAME_GROUP, |
342 GRP_WIDGET_RENAME_GROUP, |
343 GRP_WIDGET_REPLACE_PROTECTION, |
343 GRP_WIDGET_REPLACE_PROTECTION, |
344 WIDGET_LIST_END); |
344 WIDGET_LIST_END); |
|
345 |
|
346 /* Disable remaining buttons for non-local player |
|
347 * Needed while changing _local_player, eg. by cheats |
|
348 * All procedures (eg. move vehicle to another group) |
|
349 * verify, whether you are the owner of the vehicle, |
|
350 * so it doesn't have to be disabled |
|
351 */ |
|
352 SetWindowWidgetsDisabledState(w, _local_player != owner, |
|
353 GRP_WIDGET_CREATE_GROUP, |
|
354 GRP_WIDGET_AVAILABLE_VEHICLES, |
|
355 WIDGET_LIST_END); |
|
356 |
345 |
357 |
346 /* If selected_group == DEFAULT_GROUP || ALL_GROUP, draw the standard caption |
358 /* If selected_group == DEFAULT_GROUP || ALL_GROUP, draw the standard caption |
347 We list all vehicles or ungrouped vehicles */ |
359 We list all vehicles or ungrouped vehicles */ |
348 if (IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel)) { |
360 if (IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel)) { |
349 SetDParam(0, p->index); |
361 SetDParam(0, p->index); |