-
Notifications
You must be signed in to change notification settings - Fork 12
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
Showing
19 changed files
with
288 additions
and
29 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
client/src/main/java/com/fox2code/foxloader/client/gui/GuiModList.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,44 @@ | ||
package com.fox2code.foxloader.client.gui; | ||
|
||
import net.minecraft.src.client.gui.FontRenderer; | ||
import net.minecraft.src.client.gui.GuiButton; | ||
import net.minecraft.src.client.gui.GuiScreen; | ||
import net.minecraft.src.client.gui.StringTranslate; | ||
|
||
public class GuiModList extends GuiScreen { | ||
private final GuiScreen parent; | ||
private GuiModListContainer modListContainer; | ||
|
||
public GuiModList(GuiScreen parent) { | ||
this.parent = parent; | ||
} | ||
|
||
@Override | ||
public void initGui() { | ||
super.initGui(); | ||
this.modListContainer = new GuiModListContainer(this); | ||
this.modListContainer.registerScrollButtons(this.controlList, 4, 5); | ||
this.controlList.add(new GuiButton(0, | ||
this.width / 2 + 4, this.height - 28, 150, 20, | ||
StringTranslate.getInstance().translateKey("gui.cancel"))); | ||
} | ||
|
||
@Override | ||
public void drawScreen(int var1, int var2, float deltaTicks) { | ||
this.modListContainer.drawScreen(var1, var2, deltaTicks); | ||
super.drawScreen(var1, var2, deltaTicks); | ||
} | ||
|
||
@Override | ||
protected void actionPerformed(GuiButton var1) { | ||
if (var1.id == 0) { | ||
this.mc.displayGuiScreen(this.parent); | ||
return; | ||
} | ||
this.modListContainer.actionPerformed(var1); | ||
} | ||
|
||
public FontRenderer getFontRenderer() { | ||
return this.fontRenderer; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
client/src/main/java/com/fox2code/foxloader/client/gui/GuiModListContainer.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,55 @@ | ||
package com.fox2code.foxloader.client.gui; | ||
|
||
import com.fox2code.foxloader.loader.ModContainer; | ||
import com.fox2code.foxloader.loader.ModLoader; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.src.client.gui.GuiSlot; | ||
import net.minecraft.src.client.renderer.Tessellator; | ||
|
||
public class GuiModListContainer extends GuiSlot { | ||
private final GuiModList guiModList; | ||
private final ModContainer[] mods; | ||
private int selected = 0; | ||
|
||
public GuiModListContainer(GuiModList guiModList) { | ||
super(Minecraft.theMinecraft, | ||
guiModList.width, | ||
guiModList.height, 32, | ||
guiModList.height - 64, 36); | ||
this.guiModList = guiModList; | ||
this.mods = ModLoader.getModContainers().toArray(new ModContainer[0]); | ||
} | ||
|
||
@Override | ||
protected int getSize() { | ||
return this.mods.length; | ||
} | ||
|
||
@Override | ||
protected void elementClicked(int i, boolean b) { | ||
this.selected = i; | ||
} | ||
|
||
@Override | ||
protected boolean isSelected(int i) { | ||
return this.selected == i; | ||
} | ||
|
||
@Override | ||
protected void drawBackground() { | ||
this.guiModList.drawDefaultBackground(); | ||
} | ||
|
||
@Override | ||
protected void drawSlot(int i, int i1, int i2, int i3, Tessellator tessellator) { | ||
ModContainer modContainer = this.mods[i]; | ||
|
||
String name = modContainer.name + " " + modContainer.version; | ||
String id = modContainer.description; | ||
String file = modContainer.getFileName() + " (id: " + modContainer.id + ")"; | ||
|
||
this.guiModList.drawString(this.guiModList.getFontRenderer(), name, i1 + 2, i2 + 1, 16777215); | ||
this.guiModList.drawString(this.guiModList.getFontRenderer(), id, i1 + 2, i2 + 12, 8421504); | ||
this.guiModList.drawString(this.guiModList.getFontRenderer(), file, i1 + 2, i2 + 12 + 10, 8421504); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
client/src/main/java/com/fox2code/foxloader/client/mixins/MixinEntityRenderer.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,16 @@ | ||
package com.fox2code.foxloader.client.mixins; | ||
|
||
import com.fox2code.foxloader.loader.ClientModLoader; | ||
import net.minecraft.src.client.renderer.EntityRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(EntityRenderer.class) | ||
public class MixinEntityRenderer { | ||
@Inject(method = "updateCameraAndRender", at = @At("RETURN")) | ||
public void onCameraAndRenderUpdated(float partialTick, CallbackInfo ci) { | ||
ClientModLoader.Internal.notifyCameraAndRenderUpdated(partialTick); | ||
} | ||
} |
17 changes: 15 additions & 2 deletions
17
client/src/main/java/com/fox2code/foxloader/client/mixins/MixinGuiMainMenu.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
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
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.