-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2455fbd
commit 6a6c786
Showing
10 changed files
with
217 additions
and
25 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
43 changes: 43 additions & 0 deletions
43
.../com/github/tartaricacid/touhoulittlemaid/client/gui/entity/maid/CheckSchedulePosGui.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,43 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.client.gui.entity.maid; | ||
|
||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.Button; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.util.FormattedCharSequence; | ||
|
||
import java.util.List; | ||
|
||
public class CheckSchedulePosGui extends Screen { | ||
private final AbstractMaidContainerGui<?> parent; | ||
private final Component tips; | ||
private int middleX; | ||
private int middleY; | ||
|
||
public CheckSchedulePosGui(AbstractMaidContainerGui<?> parent, Component tips) { | ||
super(Component.literal("Check Schedule Pos Screen")); | ||
this.parent = parent; | ||
this.tips = tips; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
this.middleX = this.width / 2; | ||
this.middleY = this.height / 2; | ||
Button returnButton = Button.builder(Component.translatable("button.touhou_little_maid.maid.return"), (b) -> getMinecraft().setScreen(this.parent)) | ||
.pos(middleX - 100, middleY + 10).size(200, 20).build(); | ||
this.addRenderableWidget(returnButton); | ||
} | ||
|
||
@Override | ||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { | ||
renderBackground(graphics); | ||
List<FormattedCharSequence> split = font.split(tips, 300); | ||
int startY = middleY - 10 - split.size() * font.lineHeight; | ||
for (FormattedCharSequence text : split) { | ||
graphics.drawCenteredString(font, text, middleX, startY, 0xFFFFFF); | ||
startY += font.lineHeight; | ||
} | ||
super.render(graphics, mouseX, mouseY, partialTicks); | ||
} | ||
} |
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
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
Oops, something went wrong.