Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -1539,8 +1539,8 @@ bool ConditionallyHiddenSettingEntry::UpdateFilterState(SettingFilter &filter, b
|
||||
*/
|
||||
void SettingsContainer::Init(byte level)
|
||||
{
|
||||
for (EntryVector::iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
(*it)->Init(level);
|
||||
for (auto &it : this->entries) {
|
||||
it->Init(level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1555,16 +1555,16 @@ void SettingsContainer::ResetAll()
|
||||
/** Recursively close all folds of sub-pages */
|
||||
void SettingsContainer::FoldAll()
|
||||
{
|
||||
for (EntryVector::iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
(*it)->FoldAll();
|
||||
for (auto &it : this->entries) {
|
||||
it->FoldAll();
|
||||
}
|
||||
}
|
||||
|
||||
/** Recursively open all folds of sub-pages */
|
||||
void SettingsContainer::UnFoldAll()
|
||||
{
|
||||
for (EntryVector::iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
(*it)->UnFoldAll();
|
||||
for (auto &it : this->entries) {
|
||||
it->UnFoldAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1575,8 +1575,8 @@ void SettingsContainer::UnFoldAll()
|
||||
*/
|
||||
void SettingsContainer::GetFoldingState(bool &all_folded, bool &all_unfolded) const
|
||||
{
|
||||
for (EntryVector::const_iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
(*it)->GetFoldingState(all_folded, all_unfolded);
|
||||
for (auto &it : this->entries) {
|
||||
it->GetFoldingState(all_folded, all_unfolded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1607,8 +1607,8 @@ bool SettingsContainer::UpdateFilterState(SettingFilter &filter, bool force_visi
|
||||
*/
|
||||
bool SettingsContainer::IsVisible(const BaseSettingEntry *item) const
|
||||
{
|
||||
for (EntryVector::const_iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
if ((*it)->IsVisible(item)) return true;
|
||||
for (const auto &it : this->entries) {
|
||||
if (it->IsVisible(item)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1617,8 +1617,8 @@ bool SettingsContainer::IsVisible(const BaseSettingEntry *item) const
|
||||
uint SettingsContainer::Length() const
|
||||
{
|
||||
uint length = 0;
|
||||
for (EntryVector::const_iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
length += (*it)->Length();
|
||||
for (const auto &it : this->entries) {
|
||||
length += it->Length();
|
||||
}
|
||||
return length;
|
||||
}
|
||||
@@ -1632,8 +1632,8 @@ uint SettingsContainer::Length() const
|
||||
BaseSettingEntry *SettingsContainer::FindEntry(uint row_num, uint *cur_row)
|
||||
{
|
||||
BaseSettingEntry *pe = nullptr;
|
||||
for (EntryVector::iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
pe = (*it)->FindEntry(row_num, cur_row);
|
||||
for (const auto &it : this->entries) {
|
||||
pe = it->FindEntry(row_num, cur_row);
|
||||
if (pe != nullptr) {
|
||||
break;
|
||||
}
|
||||
@@ -1649,8 +1649,8 @@ BaseSettingEntry *SettingsContainer::FindEntry(uint row_num, uint *cur_row)
|
||||
uint SettingsContainer::GetMaxHelpHeight(int maxw)
|
||||
{
|
||||
uint biggest = 0;
|
||||
for (EntryVector::const_iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
biggest = std::max(biggest, (*it)->GetMaxHelpHeight(maxw));
|
||||
for (const auto &it : this->entries) {
|
||||
biggest = std::max(biggest, it->GetMaxHelpHeight(maxw));
|
||||
}
|
||||
return biggest;
|
||||
}
|
||||
@@ -1671,11 +1671,9 @@ uint SettingsContainer::GetMaxHelpHeight(int maxw)
|
||||
*/
|
||||
uint SettingsContainer::Draw(GameSettings *settings_ptr, int left, int right, int y, uint first_row, uint max_row, BaseSettingEntry *selected, uint cur_row, uint parent_last) const
|
||||
{
|
||||
for (EntryVector::const_iterator it = this->entries.begin(); it != this->entries.end(); ++it) {
|
||||
cur_row = (*it)->Draw(settings_ptr, left, right, y, first_row, max_row, selected, cur_row, parent_last);
|
||||
if (cur_row >= max_row) {
|
||||
break;
|
||||
}
|
||||
for (const auto &it : this->entries) {
|
||||
cur_row = it->Draw(settings_ptr, left, right, y, first_row, max_row, selected, cur_row, parent_last);
|
||||
if (cur_row >= max_row) break;
|
||||
}
|
||||
return cur_row;
|
||||
}
|
||||
@@ -2802,7 +2800,7 @@ struct GameSettingsWindow : Window {
|
||||
this->closing_dropdown = false;
|
||||
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_GS_OPTIONSPANEL);
|
||||
int rel_y = (pt.y - (int)wid->pos_y - WidgetDimensions::scaled.framerect.top) % wid->resize_y;
|
||||
int rel_y = (pt.y - wid->pos_y - WidgetDimensions::scaled.framerect.top) % wid->resize_y;
|
||||
|
||||
Rect wi_rect;
|
||||
wi_rect.left = pt.x - (_current_text_dir == TD_RTL ? SETTING_BUTTON_WIDTH - 1 - x : x);
|
||||
|
Reference in New Issue
Block a user