| 793 | } |
| 794 | |
| 795 | void OnResize() override |
| 796 | { |
| 797 | this->vscroll->SetCapacityFromWidget(this, WID_GO_OPTIONSPANEL, WidgetDimensions::scaled.framerect.Vertical()); |
| 798 | UpdateHelpTextSize(); |
| 799 | |
| 800 | bool changed = false; |
| 801 | |
| 802 | NWidgetResizeBase *wid = this->GetWidget<NWidgetResizeBase>(WID_GO_BASE_GRF_DESCRIPTION); |
| 803 | int y = 0; |
| 804 | for (int i = 0; i < BaseGraphics::GetNumSets(); i++) { |
| 805 | std::string str = GetString(STR_JUST_RAW_STRING, BaseGraphics::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); |
| 806 | y = std::max(y, GetStringHeight(str, wid->current_x)); |
| 807 | } |
| 808 | changed |= wid->UpdateVerticalSize(y); |
| 809 | |
| 810 | wid = this->GetWidget<NWidgetResizeBase>(WID_GO_BASE_SFX_DESCRIPTION); |
| 811 | y = 0; |
| 812 | for (int i = 0; i < BaseSounds::GetNumSets(); i++) { |
| 813 | std::string str = GetString(STR_JUST_RAW_STRING, BaseSounds::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); |
| 814 | y = std::max(y, GetStringHeight(str, wid->current_x)); |
| 815 | } |
| 816 | changed |= wid->UpdateVerticalSize(y); |
| 817 | |
| 818 | wid = this->GetWidget<NWidgetResizeBase>(WID_GO_BASE_MUSIC_DESCRIPTION); |
| 819 | y = 0; |
| 820 | for (int i = 0; i < BaseMusic::GetNumSets(); i++) { |
| 821 | std::string str = GetString(STR_JUST_RAW_STRING, BaseMusic::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); |
| 822 | y = std::max(y, GetStringHeight(str, wid->current_x)); |
| 823 | } |
| 824 | changed |= wid->UpdateVerticalSize(y); |
| 825 | |
| 826 | wid = this->GetWidget<NWidgetResizeBase>(WID_GO_VIDEO_DRIVER_INFO); |
| 827 | std::string str = GetString(STR_GAME_OPTIONS_VIDEO_DRIVER_INFO, std::string{VideoDriver::GetInstance()->GetInfoString()}); |
| 828 | y = GetStringHeight(str, wid->current_x); |
| 829 | changed |= wid->UpdateVerticalSize(y); |
| 830 | |
| 831 | if (changed) this->ReInit(0, 0, this->flags.Test(WindowFlag::Centred)); |
| 832 | } |
| 833 | |
| 834 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 835 | { |
nothing calls this directly
no test coverage detected