diff --git a/src/design.cpp b/src/design.cpp index be86018b987..571a8617c8f 100644 --- a/src/design.cpp +++ b/src/design.cpp @@ -3497,12 +3497,7 @@ void intProcessDesign(UDWORD id) } else { - desSetupDesignTemplates(); - widgDelete(psWScreen, IDDES_TEMPLBASE); - intAddTemplateForm(templateFromButtonId(droidTemplID)); - intSetDesignMode(desCompMode, true); - droidTemplID = IDDES_TEMPLSTART; - widgSetButtonState(psWScreen, droidTemplID, WBUT_LOCK); + intRefreshDesign(); } break; } @@ -3690,6 +3685,21 @@ void intRunDesign() } } +void intRefreshDesign() +{ + auto designForm = widgGetFromID(psWScreen, IDDES_FORM); + + if (designForm && designForm->visible()) + { + desSetupDesignTemplates(); + widgDelete(psWScreen, IDDES_TEMPLBASE); + intAddTemplateForm(templateFromButtonId(droidTemplID)); + intSetDesignMode(desCompMode, true); + droidTemplID = IDDES_TEMPLSTART; + widgSetButtonState(psWScreen, droidTemplID, WBUT_LOCK); + } +} + static void intDisplayStatForm(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset) { static UDWORD iRY = 45; diff --git a/src/design.h b/src/design.h index 1c307ee96d4..768672108b8 100644 --- a/src/design.h +++ b/src/design.h @@ -115,6 +115,7 @@ bool intAddDesign(bool bShowCentreScreen); void intRemoveDesign(); void intProcessDesign(UDWORD id); void intRunDesign(); +void intRefreshDesign(); const char *GetDefaultTemplateName(DROID_TEMPLATE *psTemplate); diff --git a/src/research.cpp b/src/research.cpp index 7aacad81a01..27fc6cb8cfe 100644 --- a/src/research.cpp +++ b/src/research.cpp @@ -47,6 +47,7 @@ #include "qtscript.h" #include "stats.h" #include "wzapi.h" +#include "design.h" // The stores for the research stats std::vector asResearch; @@ -1149,11 +1150,16 @@ void researchResult(UDWORD researchIndex, UBYTE player, bool bDisplay, STRUCTURE audio_QueueTrack(ID_SOUND_RESEARCH_COMPLETED); } - if (player == selectedPlayer && bDisplay) + if (player == selectedPlayer) { - //add console text message - snprintf(consoleMsg, MAX_RESEARCH_MSG_SIZE, _("Research completed: %s"), getLocalizedStatsName(pResearch)); - addConsoleMessage(consoleMsg, LEFT_JUSTIFY, SYSTEM_MESSAGE); + if (bDisplay) + { + //add console text message + snprintf(consoleMsg, MAX_RESEARCH_MSG_SIZE, _("Research completed: %s"), getLocalizedStatsName(pResearch)); + addConsoleMessage(consoleMsg, LEFT_JUSTIFY, SYSTEM_MESSAGE); + } + + intRefreshDesign(); } if (psResearchFacility)