generated from NeoForgeMDKs/MDK-1.21.1-ModDevGradle
-
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.
Buttons :> (for some reason onpress and moving them is broken but ohw)
- Loading branch information
1 parent
b7378af
commit ef598fd
Showing
10 changed files
with
166 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/portingdeadmods/researchd/client/screens/widgets/QueueControllsButton.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,38 @@ | ||
package com.portingdeadmods.researchd.client.screens.widgets; | ||
|
||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.Button; | ||
import net.minecraft.client.gui.components.ImageButton; | ||
import net.minecraft.client.gui.components.WidgetSprites; | ||
import net.minecraft.network.chat.CommonComponents; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.api.distmarker.OnlyIn; | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public class QueueControllsButton extends ImageButton { | ||
protected final WidgetSprites sprites; | ||
private final int index; | ||
private final String type; | ||
|
||
public QueueControllsButton(int index, String type, int x, int y, int width, int height, WidgetSprites sprites, Button.OnPress onPress, Component message) { | ||
super(x, y, width, height, sprites, onPress, message); | ||
this.index = index; | ||
this.type = type; | ||
this.sprites = sprites; | ||
} | ||
|
||
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { | ||
ResourceLocation resourcelocation = this.sprites.get(this.isActive(), this.isHoveredOrFocused()); | ||
guiGraphics.blitSprite(resourcelocation, this.getX(), this.getY(), this.width, this.height); | ||
} | ||
|
||
public int getIndex() { | ||
return this.index; | ||
} | ||
|
||
public String getType() { | ||
return this.type; | ||
} | ||
} |
Binary file added
BIN
+174 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/left_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+180 Bytes
...ain/resources/assets/researchd/textures/gui/sprites/left_button_highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+171 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/remove_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+161 Bytes
...n/resources/assets/researchd/textures/gui/sprites/remove_button_highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+172 Bytes
src/main/resources/assets/researchd/textures/gui/sprites/right_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+175 Bytes
...in/resources/assets/researchd/textures/gui/sprites/right_button_highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.