-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always show the inventory context buttons
...unless dragging
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/uk/protonull/civ/chesttracker/mixins/AlwaysShowContextButtons.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package uk.protonull.civ.chesttracker.mixins; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
import red.jackf.chesttracker.impl.gui.invbutton.ui.InventoryButton; | ||
|
||
@Mixin(InventoryButton.class) | ||
public abstract class AlwaysShowContextButtons { | ||
@Shadow(remap = false) | ||
private boolean isDragging; | ||
|
||
@ModifyVariable( | ||
method = "showExtraButtons", | ||
at = @At("HEAD"), | ||
argsOnly = true, | ||
remap = false | ||
) | ||
protected boolean ctt$modify_variable$showExtraButtons$alwaysShow( | ||
final boolean shouldShow | ||
) { | ||
if (this.isDragging) { | ||
return shouldShow; | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters