diff --git a/src/dialogues/ConfirmPrompt.cpp b/src/dialogues/ConfirmPrompt.cpp index 312d98c98..493ddc324 100644 --- a/src/dialogues/ConfirmPrompt.cpp +++ b/src/dialogues/ConfirmPrompt.cpp @@ -12,7 +12,7 @@ #include "PowderToy.h" ConfirmPrompt::ConfirmPrompt(std::string title, std::string message, ConfirmDialogueCallback * callback_): - ui::Window(ui::Point(-1, -1), ui::Point(250, 50)), + ui::Window(ui::Point(-1, -1), ui::Point(250, 35)), callback(callback_) { int width, height; diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index d2580b01a..4aceec7c2 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -1226,7 +1226,24 @@ void GameController::NotifyUpdateAvailable(Client * sender) virtual void Action() { - new ConfirmPrompt("Run Updater", "Are you sure you want to run the updater, please save any changes before updating", new UpdateConfirmation(c)); + std::string currentVersion, newVersion; +#ifdef BETA + currentVersion = MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " Beta, Build " MTOS(BUILD_NUM); +#elif defined(SNAPSHOT) + currentVersion = "Snapshot " MTOS(SNAPSHOT_ID); +#else + currentVersion = MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " Stable, Build " MTOS(BUILD_NUM); +#endif + + UpdateInfo info = Client::Ref().GetUpdateInfo(); + if(info.Type == UpdateInfo::Beta) + newVersion = format::NumberToString(info.Major) + " " + format::NumberToString(info.Minor) + " Beta, Build " + format::NumberToString(info.Build); + else if(info.Type == UpdateInfo::Snapshot) + newVersion = "Snapshot " + format::NumberToString(info.Time); + else if(info.Type == UpdateInfo::Stable) + newVersion = format::NumberToString(info.Major) + " " + format::NumberToString(info.Minor) + " Stable, Build " + format::NumberToString(info.Build); + + new ConfirmPrompt("Run Updater", "Are you sure you want to run the updater, please save any changes before updating.\n\nCurrent version:\n " + currentVersion + "\nNew version:\n " + newVersion, new UpdateConfirmation(c)); } }; diff --git a/src/interface/Engine.h b/src/interface/Engine.h index bcf10e638..960069c79 100644 --- a/src/interface/Engine.h +++ b/src/interface/Engine.h @@ -79,6 +79,7 @@ namespace ui pixel * lastBuffer; std::stack prevBuffers; std::stack windows; + std::stack mousePositions; //Window* statequeued_; Window* state_; Point windowTargetPosition; diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp index e19b6b864..96a852062 100644 --- a/src/interface/Label.cpp +++ b/src/interface/Label.cpp @@ -80,11 +80,17 @@ void Label::updateMultiline() char * lastSpace = NULL; char * currentWord = rawText; char * nextSpace; + char oldChar; while(true) { nextSpace = strchr(currentWord+1, ' '); + if(nextSpace > strchr(currentWord+1, '\n')) + nextSpace = strchr(currentWord+1, '\n'); if(nextSpace) + { + oldChar = nextSpace[0]; nextSpace[0] = 0; + } int width = Graphics::textwidth(currentWord); if(width+currentWidth >= Size.X-(Appearance.Margin.Left+Appearance.Margin.Right)) { @@ -95,10 +101,15 @@ void Label::updateMultiline() lines++; } } + else if(oldChar == '\n') + { + currentWidth = width; + lines++; + } else currentWidth += width; if(nextSpace) - nextSpace[0] = ' '; + nextSpace[0] = oldChar; if(!currentWord[0] || !currentWord[1] || !(currentWord = strchr(currentWord+1, ' '))) break; }