diff options
author | rubidium <rubidium@openttd.org> | 2007-09-09 10:34:32 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-09-09 10:34:32 +0000 |
commit | efea7622acb6dbf5b4a75be3e0b0c6d016e5feb1 (patch) | |
tree | 3c503e126418430925368a8acd79eb761219d6ef /src/group_gui.cpp | |
parent | ed3b1d398aaa6643d255eb792b8226d35eafceed (diff) | |
download | openttd-efea7622acb6dbf5b4a75be3e0b0c6d016e5feb1.tar.xz |
(svn r11067) -Codechange: also make it possible to use the advanced vehicle list for other players. Patch by SmatZ.
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r-- | src/group_gui.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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)) { |