Skip to content

Commit

Permalink
fix: update item requirement without dispatch (#1864)
Browse files Browse the repository at this point in the history
* fix: update item requirements asap in the "quest handler"

We are already in the quest thread when here, there is no need to dispatch it to the client thread to run later

* refactor: rename `updateSteps` to `updateStepsTexts`

just thought this clarifies a bit that the function only tries to update the texts of the steps in the sidepanel, not
any other logic
  • Loading branch information
pajlada authored Nov 24, 2024
1 parent 0222ffd commit 8ce774a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/questhelper/managers/QuestManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void handleSelectedQuest()
{
if (selectedQuest.getCurrentStep() != null)
{
panel.updateSteps();
panel.updateStepsTexts();
QuestStep currentStep = selectedQuest.getCurrentStep().getSidePanelStep();
if (currentStep != null && currentStep != lastStep && panel.questActive)
{
Expand All @@ -147,7 +147,7 @@ private void handleSelectedQuest()
}
if (panel.questActive)
{
clientThread.invokeLater(() -> panel.updateItemRequirements(client));
panel.updateItemRequirements(client);
}
panel.updateLocks();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/questhelper/panel/QuestHelperPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ public void addQuest(QuestHelper quest, boolean isActive)
revalidate();
}

public void updateSteps()
public void updateStepsTexts()
{
questOverviewPanel.updateSteps();
questOverviewPanel.updateStepsTexts();
}

public void updateHighlight(Client client, QuestStep newStep)
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/questhelper/panel/QuestOverviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import com.questhelper.util.Fonts;
import lombok.Getter;
import net.runelite.api.Client;
import net.runelite.api.Item;
import net.runelite.api.Skill;
import net.runelite.client.ui.ColorScheme;
import static net.runelite.client.ui.PluginPanel.PANEL_WIDTH;
Expand Down Expand Up @@ -316,7 +315,7 @@ public void mouseClicked(MouseEvent e)
}
}

public void updateSteps()
public void updateStepsTexts()
{
questStepPanelList.forEach(panel -> {
for (QuestStep step : panel.getSteps())
Expand Down

0 comments on commit 8ce774a

Please sign in to comment.