From efea7622acb6dbf5b4a75be3e0b0c6d016e5feb1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 9 Sep 2007 10:34:32 +0000 Subject: (svn r11067) -Codechange: also make it possible to use the advanced vehicle list for other players. Patch by SmatZ. --- src/group_gui.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/group_gui.cpp') diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 7b994af9d..dff1f0ea0 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -329,7 +329,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) SetVScroll2Count(w, gv->l.list_length); /* Disable all lists management button when the list is empty */ - SetWindowWidgetsDisabledState(w, gv->l.list_length == 0, + SetWindowWidgetsDisabledState(w, gv->l.list_length == 0 || _local_player != owner, GRP_WIDGET_STOP_ALL, GRP_WIDGET_START_ALL, GRP_WIDGET_MANAGE_VEHICLES, @@ -337,12 +337,24 @@ static void GroupWndProc(Window *w, WindowEvent *e) WIDGET_LIST_END); /* Disable the group specific function when we select the default group or all vehicles */ - SetWindowWidgetsDisabledState(w, IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel), + SetWindowWidgetsDisabledState(w, IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel) || _local_player != owner, GRP_WIDGET_DELETE_GROUP, GRP_WIDGET_RENAME_GROUP, GRP_WIDGET_REPLACE_PROTECTION, WIDGET_LIST_END); + /* Disable remaining buttons for non-local player + * Needed while changing _local_player, eg. by cheats + * All procedures (eg. move vehicle to another group) + * verify, whether you are the owner of the vehicle, + * so it doesn't have to be disabled + */ + SetWindowWidgetsDisabledState(w, _local_player != owner, + GRP_WIDGET_CREATE_GROUP, + GRP_WIDGET_AVAILABLE_VEHICLES, + WIDGET_LIST_END); + + /* If selected_group == DEFAULT_GROUP || ALL_GROUP, draw the standard caption We list all vehicles or ungrouped vehicles */ if (IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel)) { -- cgit v1.2.3-54-g00ecf