Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include "company_func.h"
|
||||
#include "hotkeys.h"
|
||||
#include "newgrf.h"
|
||||
#include "newgrf_badge.h"
|
||||
#include "newgrf_badge_gui.h"
|
||||
#include "newgrf_object.h"
|
||||
#include "newgrf_text.h"
|
||||
#include "object.h"
|
||||
@@ -189,6 +189,8 @@ public:
|
||||
|
||||
case WID_BO_INFO:
|
||||
size.height = this->info_height;
|
||||
fill.height = this->has_class_picker ? 0 : 1;
|
||||
resize.height = this->has_class_picker ? 0 : 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -239,15 +241,19 @@ public:
|
||||
|
||||
/* Get the extra message for the GUI */
|
||||
if (spec->callback_mask.Test(ObjectCallbackMask::FundMoreText)) {
|
||||
uint16_t callback_res = GetObjectCallback(CBID_OBJECT_FUND_MORE_TEXT, 0, 0, spec, nullptr, INVALID_TILE, _object_gui.sel_view);
|
||||
std::array<int32_t, 16> regs100;
|
||||
uint16_t callback_res = GetObjectCallback(CBID_OBJECT_FUND_MORE_TEXT, 0, 0, spec, nullptr, INVALID_TILE, regs100, _object_gui.sel_view);
|
||||
if (callback_res != CALLBACK_FAILED && callback_res != 0x400) {
|
||||
if (callback_res > 0x400) {
|
||||
std::string str;
|
||||
if (callback_res == 0x40F) {
|
||||
str = GetGRFStringWithTextStack(spec->grf_prop.grffile, static_cast<GRFStringID>(regs100[0]), std::span{regs100}.subspan(1));
|
||||
} else if (callback_res > 0x400) {
|
||||
ErrorUnknownCallbackResult(spec->grf_prop.grfid, CBID_OBJECT_FUND_MORE_TEXT, callback_res);
|
||||
} else {
|
||||
std::string str = GetGRFStringWithTextStack(spec->grf_prop.grffile, GRFSTR_MISC_GRF_TEXT + callback_res, 6);
|
||||
if (!str.empty()) {
|
||||
tr.top = DrawStringMultiLine(tr, str, TC_ORANGE);
|
||||
}
|
||||
str = GetGRFStringWithTextStack(spec->grf_prop.grffile, GRFSTR_MISC_GRF_TEXT + callback_res, regs100);
|
||||
}
|
||||
if (!str.empty()) {
|
||||
tr.top = DrawStringMultiLine(tr, str, TC_ORANGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +321,7 @@ public:
|
||||
if (_object_gui.sel_type != std::numeric_limits<uint16_t>::max()) {
|
||||
_object_gui.sel_view = this->GetWidget<NWidgetBase>(widget)->GetParentWidget<NWidgetMatrix>()->GetCurrentElement();
|
||||
this->InvalidateData(PickerInvalidation::Position);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user