mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r14786) -Fix: road/rail/water/airport toolbar opened over terraform toolbar when toolbar linking is turned on.
This commit is contained in:
parent
b3f2f40db7
commit
5b3a2ed2ab
|
@ -10,6 +10,7 @@
|
||||||
#include "company_base.h"
|
#include "company_base.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "window_gui.h"
|
#include "window_gui.h"
|
||||||
|
#include "window_func.h"
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
|
@ -328,16 +329,24 @@ static const WindowDesc _terraform_desc = {
|
||||||
void ShowTerraformToolbar(Window *link)
|
void ShowTerraformToolbar(Window *link)
|
||||||
{
|
{
|
||||||
if (!IsValidCompanyID(_current_company)) return;
|
if (!IsValidCompanyID(_current_company)) return;
|
||||||
|
|
||||||
Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
||||||
if (w != NULL && link != NULL) {
|
if (link == NULL) return;
|
||||||
/* Align the terraform toolbar under the main toolbar and put the linked
|
|
||||||
* toolbar to left of it
|
if (w == NULL) {
|
||||||
*/
|
w = FindWindowById(WC_SCEN_LAND_GEN, 0);
|
||||||
|
} else {
|
||||||
w->top = 22;
|
w->top = 22;
|
||||||
w->SetDirty();
|
w->SetDirty();
|
||||||
link->left = w->left - link->width;
|
|
||||||
link->SetDirty();
|
|
||||||
}
|
}
|
||||||
|
if (w == NULL) return;
|
||||||
|
|
||||||
|
/* Align the terraform toolbar under the main toolbar and put the linked
|
||||||
|
* toolbar to left of it
|
||||||
|
*/
|
||||||
|
link->top = w->top;
|
||||||
|
link->left = w->left - link->width;
|
||||||
|
link->SetDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte _terraform_size = 1;
|
static byte _terraform_size = 1;
|
||||||
|
|
Loading…
Reference in New Issue