[Client] Update GUIController to C++11

pull/249/merge
Koncord 8 years ago
parent aa1f5c3cd3
commit a110ec1767

@ -98,15 +98,15 @@ void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox &
std::string buf; std::string buf;
for (size_t i = 0; i < guiMessageBox.data.size(); i++) for(const auto &data : guiMessageBox.data)
{ {
if (guiMessageBox.data[i] == '\n') if (data == '\n')
{ {
list.push_back(buf); list.push_back(buf);
buf.erase(); buf.erase();
continue; continue;
} }
buf += guiMessageBox.data[i]; buf += data;
} }
list.push_back(buf); list.push_back(buf);
@ -373,13 +373,11 @@ void mwmp::GUIController::setGlobalMapMarkerTooltip(MWGui::MapWindow *mapWindow,
void mwmp::GUIController::updateGlobalMapMarkerTooltips(MWGui::MapWindow *mapWindow) void mwmp::GUIController::updateGlobalMapMarkerTooltips(MWGui::MapWindow *mapWindow)
{ {
std::map<std::pair<int, int>, MyGUI::Widget*>::iterator widgetIt = mapWindow->mGlobalMapMarkers.begin(); for(const auto &widget : mapWindow->mGlobalMapMarkers)
for (; widgetIt != mapWindow->mGlobalMapMarkers.end(); ++widgetIt)
{ {
int x = widgetIt->first.first; const int x = widget.first.first;
int y = widgetIt->first.second; const int y = widget.first.second;
MyGUI::Widget* markerWidget = widgetIt->second; setGlobalMapMarkerTooltip(mapWindow, widget.second, x, y);
setGlobalMapMarkerTooltip(mapWindow, markerWidget, x, y);
} }
} }

Loading…
Cancel
Save