Merge branch 'template_train_replacement-sx' into jgrpp

Remove a duplicated declaration.

# Conflicts:
#	projects/openttd_vs100.vcxproj
#	projects/openttd_vs100.vcxproj.filters
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs80.vcproj
#	projects/openttd_vs90.vcproj
#	source.list
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/network/network_command.cpp
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/saveload/saveload.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/window_type.h
This commit is contained in:
Jonathan G Rennison
2016-02-14 17:55:51 +00:00
54 changed files with 4946 additions and 72 deletions

View File

@@ -25,6 +25,8 @@
#include "vehicle_gui_base.h"
#include "core/geometry_func.hpp"
#include "company_base.h"
#include "tbtr_template_gui_main.h"
#include "widgets/group_widget.h"
#include "core/smallvec_type.hpp"
@@ -439,7 +441,7 @@ public:
break;
case WID_GL_MANAGE_VEHICLES_DROPDOWN: {
Dimension d = this->GetActionDropdownSize(true, true);
Dimension d = this->GetActionDropdownSize(true, true, this->vli.vtype == VEH_TRAIN);
d.height += padding.height;
d.width += padding.width;
*size = maxdim(*size, d);
@@ -751,6 +753,7 @@ public:
case WID_GL_DELETE_GROUP: { // Delete the selected group
this->group_confirm = this->vli.index;
ShowQuery(STR_QUERY_GROUP_DELETE_CAPTION, STR_GROUP_DELETE_QUERY_TEXT, this, DeleteGroupCallback);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
break;
}
@@ -789,7 +792,7 @@ public:
break;
case WID_GL_MANAGE_VEHICLES_DROPDOWN: {
DropDownList *list = this->BuildActionDropdownList(true, Group::IsValidID(this->vli.index));
DropDownList *list = this->BuildActionDropdownList(true, Group::IsValidID(this->vli.index), this->vli.vtype == VEH_TRAIN);
ShowDropDownList(this, list, 0, WID_GL_MANAGE_VEHICLES_DROPDOWN);
break;
}
@@ -898,6 +901,7 @@ public:
virtual void OnQueryTextFinished(char *str)
{
if (str != NULL) DoCommandP(0, this->group_rename, 0, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), NULL, str);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
this->group_rename = INVALID_GROUP;
}
@@ -918,6 +922,11 @@ public:
assert(this->vehicles.Length() != 0);
switch (index) {
case ADI_TEMPLATE_REPLACE: // TemplateReplace Window
if (vli.vtype == VEH_TRAIN) {
ShowTemplateReplaceWindow(this->unitnumber_digits, this->resize.step_height);
}
break;
case ADI_REPLACE: // Replace window
ShowReplaceGroupVehicleWindow(this->vli.index, this->vli.vtype);
break;