Fixed bug in quests
This commit is contained in:
parent
553a2388d1
commit
c174c143c6
3 changed files with 60 additions and 13 deletions
|
|
@ -368,7 +368,9 @@ namespace MosswartMassacre
|
|||
try
|
||||
{
|
||||
questManager = new QuestManager();
|
||||
questManager.RefreshQuests();
|
||||
|
||||
// Trigger full quest data refresh (same as clicking refresh button)
|
||||
Views.FlagTrackerView.RefreshQuestData();
|
||||
|
||||
// Initialize quest streaming timer (30 seconds)
|
||||
questStreamingTimer = new Timer(30000);
|
||||
|
|
@ -376,7 +378,7 @@ namespace MosswartMassacre
|
|||
questStreamingTimer.AutoReset = true;
|
||||
questStreamingTimer.Start();
|
||||
|
||||
WriteToChat("[OK] Quest streaming initialized");
|
||||
WriteToChat("[OK] Quest streaming initialized with full data refresh");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -524,16 +526,15 @@ namespace MosswartMassacre
|
|||
{
|
||||
questManager = new QuestManager();
|
||||
WriteToChat("[OK] Quest manager reinitialized");
|
||||
|
||||
// Request quest data immediately
|
||||
questManager.RefreshQuests();
|
||||
WriteToChat("[INFO] Requesting quest data for hot reload...");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteToChat("[INFO] Quest manager already active, refreshing data...");
|
||||
questManager.RefreshQuests();
|
||||
WriteToChat("[INFO] Quest manager already active");
|
||||
}
|
||||
|
||||
// Trigger full quest data refresh (same as clicking refresh button)
|
||||
Views.FlagTrackerView.RefreshQuestData();
|
||||
WriteToChat("[INFO] Quest data refresh triggered for hot reload");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1732,15 +1733,15 @@ namespace MosswartMassacre
|
|||
break;
|
||||
|
||||
case "refreshquests":
|
||||
// Force quest data refresh
|
||||
if (questManager != null)
|
||||
// Force quest data refresh (same as clicking refresh button)
|
||||
try
|
||||
{
|
||||
WriteToChat("[QUEST] Refreshing quest data...");
|
||||
questManager.RefreshQuests();
|
||||
Views.FlagTrackerView.RefreshQuestData();
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
WriteToChat("[QUEST] Quest manager not initialized");
|
||||
WriteToChat($"[QUEST] Refresh failed: {ex.Message}");
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,6 +108,52 @@ namespace MosswartMassacre.Views
|
|||
{
|
||||
return instance != null && instance.view != null && instance.view.Visible;
|
||||
}
|
||||
|
||||
public static void RefreshQuestData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (PluginCore.questManager != null)
|
||||
{
|
||||
PluginCore.questManager.RefreshQuests();
|
||||
|
||||
// If Flag Tracker window is open, also refresh the UI
|
||||
if (instance != null)
|
||||
{
|
||||
instance.PopulateQuestsList();
|
||||
|
||||
// Schedule another refresh in a few seconds to catch any data
|
||||
System.Threading.Timer refreshTimer = null;
|
||||
refreshTimer = new System.Threading.Timer(_ =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
instance.PopulateQuestsList();
|
||||
}
|
||||
}
|
||||
catch (Exception timerEx)
|
||||
{
|
||||
PluginCore.WriteToChat($"[MossyTracker] Delayed refresh failed: {timerEx.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
refreshTimer?.Dispose();
|
||||
}
|
||||
}, null, 4000, System.Threading.Timeout.Infinite);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginCore.WriteToChat("[MossyTracker] Quest manager not available for refresh");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[MossyTracker] Quest refresh failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Initialization
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue