This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
CubeWhy
committed
Aug 27, 2023
1 parent
010d18b
commit 890ebe5
Showing
6 changed files
with
158 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
src/main/java/org/cubewhy/lunarcn/gui/altmanager/GuiSkinManager.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,37 @@ | ||
package org.cubewhy.lunarcn.gui.altmanager; | ||
|
||
import net.minecraft.client.gui.GuiScreen; | ||
import org.cubewhy.lunarcn.utils.RenderUtils; | ||
|
||
import java.awt.*; | ||
import java.util.ArrayList; | ||
|
||
import static org.cubewhy.lunarcn.utils.MinecraftInstance.fontRenderer; | ||
|
||
|
||
public class GuiSkinManager extends GuiScreen { | ||
private int rightX = 0; | ||
private int skinX; | ||
private int skinY; | ||
public final ArrayList<Skin> skins = new ArrayList<>(); | ||
|
||
@Override | ||
public void drawScreen(int mouseX, int mouseY, float partialTicks) { | ||
this.drawDefaultBackground(); // render bg | ||
// init right x | ||
rightX = this.width / 4; | ||
// render line | ||
this.drawVerticalLine(rightX, 0, this.height, new Color(255, 255, 255).getRGB()); | ||
// render the skin list | ||
for (Skin skin : skins) { | ||
renderItem(skin); | ||
skinY += 30; // skull height | ||
} | ||
super.drawScreen(mouseX, mouseY, partialTicks); | ||
} | ||
|
||
private void renderItem(Skin skin) { | ||
this.drawString(fontRenderer, skin.getName(), skinX, skinY, new Color(255, 255, 255).getRGB()); | ||
|
||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/main/java/org/cubewhy/lunarcn/gui/altmanager/Skin.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,54 @@ | ||
package org.cubewhy.lunarcn.gui.altmanager; | ||
|
||
import java.io.File; | ||
import java.util.Objects; | ||
|
||
public class Skin { | ||
private String name; | ||
private File localFile; | ||
|
||
public Skin() { | ||
} | ||
|
||
public Skin(String name, File localFile) { | ||
this.name = name; | ||
this.localFile = localFile; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public File getLocalFile() { | ||
return localFile; | ||
} | ||
|
||
public void setLocalFile(File localFile) { | ||
this.localFile = localFile; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Skin{" + | ||
"name='" + name + '\'' + | ||
", localFile=" + localFile + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Skin skin = (Skin) o; | ||
return Objects.equals(name, skin.name) && Objects.equals(localFile, skin.localFile); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(name, localFile); | ||
} | ||
} |
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