mirror of https://github.com/OpenTTD/OpenTTD
(svn r15879) -Codechange: add an invisible widget on advanced company face window to determine where to draw the strings instead refering to other widgets. Required for rtl languages.
parent
3bebfc6fd3
commit
5f2c5b5855
|
@ -842,6 +842,7 @@ enum SelectCompanyManagerFaceWidgets {
|
|||
SCMFW_WIDGET_GLASSES_L,
|
||||
SCMFW_WIDGET_GLASSES,
|
||||
SCMFW_WIDGET_GLASSES_R,
|
||||
SCMFW_WIDGET_LABELS,
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_select_company_manager_face_widgets[] = {
|
||||
|
@ -930,7 +931,7 @@ static const NWidgetPart _nested_select_company_manager_face_adv_widgets[] = {
|
|||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(80, 0),
|
||||
NWidget(WWT_EMPTY, COLOUR_GREY, SCMFW_WIDGET_LABELS), SetMinimalSize(75, 146), SetPadding(0, 4, 0, 1),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SCMFW_WIDGET_HAS_MOUSTACHE_EARRING), SetMinimalSize(43, 12), SetDataTip(STR_EMPTY, STR_FACE_MOUSTACHE_EARRING_TIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SCMFW_WIDGET_HAS_GLASSES), SetMinimalSize(43, 12), SetDataTip(STR_EMPTY, STR_FACE_GLASSES_TIP),
|
||||
|
@ -1047,6 +1048,7 @@ static const Widget _select_company_manager_face_adv_widgets[] = {
|
|||
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 175, 183, 122, 133, SPR_ARROW_LEFT, STR_FACE_GLASSES_TIP_2}, // SCMFW_WIDGET_GLASSES_L
|
||||
{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 184, 208, 122, 133, STR_EMPTY, STR_FACE_GLASSES_TIP_2}, // SCMFW_WIDGET_GLASSES
|
||||
{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 209, 217, 122, 133, SPR_ARROW_RIGHT, STR_FACE_GLASSES_TIP_2}, // SCMFW_WIDGET_GLASSES_R
|
||||
{ WWT_EMPTY, RESIZE_NONE, COLOUR_GREY, 96, 170, 60, 205, 0x0, STR_NULL}, // SCMFW_WIDGET_LABELS
|
||||
{ WIDGETS_END},
|
||||
};
|
||||
|
||||
|
@ -1070,7 +1072,7 @@ class SelectCompanyManagerFaceWindow : public Window
|
|||
void DrawFaceStringLabel(byte widget_index, StringID str, uint8 val, bool is_bool_widget)
|
||||
{
|
||||
/* Write the label in gold (0x2) to the left of the button. */
|
||||
DrawString(0, this->widget[widget_index].left - (is_bool_widget ? 5 : 14), this->widget[widget_index].top + 1, str, TC_GOLD, SA_RIGHT);
|
||||
DrawString(this->widget[SCMFW_WIDGET_LABELS].left, this->widget[SCMFW_WIDGET_LABELS].right, this->widget[widget_index].top + 1, str, TC_GOLD, SA_RIGHT);
|
||||
|
||||
if (!this->IsWidgetDisabled(widget_index)) {
|
||||
if (is_bool_widget) {
|
||||
|
|
Loading…
Reference in New Issue