Skip to content

Commit

Permalink
Fix Edge Case Selected P2P Highlighting Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Dec 30, 2024
1 parent 0be5d5a commit c8d87dc
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,10 @@ private void handleEndInit(CallbackInfo ci) {
refreshButton.setPosition(guiLeft - 32, guiTop + 162);

// Add sort change button, above type button
buttonList.add(new SortModeWidgetButton((GuiAdvancedMemoryCard) (Object) this,
guiLeft - 32, guiTop + 98, 32, 32));
buttonList.add(new SortModeWidgetButton(labs$getThis(), guiLeft - 32, guiTop + 98, 32, 32));

// Add sort direction button, below type button
buttonList.add(new SortDirectionWidgetButton((GuiAdvancedMemoryCard) (Object) this,
guiLeft - 32, guiTop + 130, 32, 32));
buttonList.add(new SortDirectionWidgetButton(labs$getThis(), guiLeft - 32, guiTop + 130, 32, 32));
}

@Redirect(method = "initGui",
Expand Down Expand Up @@ -231,14 +229,16 @@ private void fillLabsCache(CallbackInfo ci) {
LabsClientCache.outputLoc.clear();

var selected = getSelectedInfo();
if (selected == null || selected.getFrequency() == 0) return;
if (selected == null) return;

LabsClientCache.selectedIsOutput = getSelectedInfo().getOutput();

// Reset time
LabsClientCache.lastSelectedRenderChange = System.currentTimeMillis();
LabsClientCache.renderingSelected = true;

if (selected.getFrequency() == 0) return;

infos.getSorted().stream()
.filter(info -> info.getFrequency() == selected.getFrequency())
.filter(info -> info.getType() == selected.getType())
Expand Down Expand Up @@ -266,4 +266,9 @@ private void save(CallbackInfo ci) {
private AccessibleInfoList labs$getAccessibleInfo() {
return ((AccessibleInfoList) (Object) infos);
}

@Unique
private GuiAdvancedMemoryCard labs$getThis() {
return (GuiAdvancedMemoryCard) (Object) this;
}
}

0 comments on commit c8d87dc

Please sign in to comment.