-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Improve Instrument and MusicVenueTool overlays.
- Loading branch information
Showing
4 changed files
with
71 additions
and
16 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
64 changes: 64 additions & 0 deletions
64
src/main/java/aeronicamc/mods/mxtune/gui/OverlayManagerScreen.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,64 @@ | ||
package aeronicamc.mods.mxtune.gui; | ||
|
||
import aeronicamc.mods.mxtune.gui.widget.MXButton; | ||
import com.mojang.blaze3d.matrix.MatrixStack; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.util.text.StringTextComponent; | ||
import net.minecraft.util.text.TranslationTextComponent; | ||
|
||
public class OverlayManagerScreen extends MXScreen { | ||
|
||
private final Screen parent; | ||
public OverlayManagerScreen(Screen parent) { | ||
super(StringTextComponent.EMPTY); | ||
this.parent=parent; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
super.init(); | ||
this.addButton(new MXButton(((width/2) - 25), height-100, 50, 20, new TranslationTextComponent("gui.done"), | ||
done -> onClose())); | ||
} | ||
|
||
@Override | ||
public boolean isPauseScreen() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public void onClose() { | ||
getMinecraft().setScreen(parent); | ||
} | ||
|
||
@Override | ||
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) { | ||
return super.mouseClicked(pMouseX, pMouseY, pButton); | ||
} | ||
|
||
@Override | ||
public boolean mouseReleased(double pMouseX, double pMouseY, int pButton) { | ||
return super.mouseReleased(pMouseX, pMouseY, pButton); | ||
} | ||
|
||
@Override | ||
public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) { | ||
return super.mouseDragged(pMouseX, pMouseY, pButton, pDragX, pDragY); | ||
} | ||
|
||
@Override | ||
public boolean mouseScrolled(double pMouseX, double pMouseY, double pDelta) { | ||
return super.mouseScrolled(pMouseX, pMouseY, pDelta); | ||
} | ||
|
||
@Override | ||
public void renderBackground(MatrixStack pMatrixStack) { | ||
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, pMatrixStack)); | ||
} | ||
|
||
@Override | ||
public void render(MatrixStack pMatrixStack, int pMouseX, int pMouseY, float pPartialTicks) { | ||
super.render(pMatrixStack, pMouseX, pMouseY, pPartialTicks); | ||
} | ||
} |
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