Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
03ddc5a
Added GuiApiHelper
ShaRose Aug 26, 2011
313e2d4
Major cleanup of GuiApi, moved to mcp, added javadoc for pretty much …
ShaRose Sep 3, 2011
eb04235
Updated javadocs
ShaRose Sep 3, 2011
2a9cfc1
Removed the javadocs from GitHub temporarily until I find a good way …
ShaRose Sep 3, 2011
aa962ac
Updated the binaries.
ShaRose Sep 9, 2011
fc04637
Updated to 1.8.1
ShaRose Sep 18, 2011
ff323ed
Forgot to change setTag to Object.
ShaRose Sep 19, 2011
63a4dfb
Updated the creole.
ShaRose Sep 20, 2011
dafca3f
Fixed a bug in ModAction that would hide exceptions where the method …
ShaRose Sep 21, 2011
c9f883b
removed crap, fixed up readme
lahwran Sep 21, 2011
41734a4
moved stuff out of theme/ that did not belong, deleted empty release …
lahwran Sep 21, 2011
d8fd430
removed more crap
lahwran Sep 21, 2011
06d6c01
added all of mcp to gitignore
lahwran Sep 21, 2011
ffb9b58
fixed link
lahwran Sep 21, 2011
d147a06
Added the Ant task I use to copy from mcp to the github folder I use.…
ShaRose Sep 21, 2011
80d2ea8
Merge branch 'master' of https://[email protected]/ShaRose/GuiAPI.git
ShaRose Sep 21, 2011
b69e6fa
Fixed a bug in WidgetClassicTwocolumn.heightOverrideExceptions.
ShaRose Sep 22, 2011
a8c892b
Updated the theme to support more widgets, as well as hopefully fixin…
ShaRose Sep 25, 2011
54d1959
newtheme/
lahwran Sep 25, 2011
0af07f9
Merge branch 'master' of github.com:ShaRose/GuiAPI
lahwran Sep 25, 2011
1c7a81b
Added ModAction support for CallbackWithReason<ListBox.CallbackReason>
ShaRose Oct 12, 2011
356f16f
Merge remote-tracking branch 'origin/master'
ShaRose Oct 12, 2011
8b5ec2d
Added specific checks against incorrect installation of GuiAPI (aka M…
ShaRose Oct 13, 2011
f1dd880
added missing parameters to stop some spam.
ShaRose Oct 25, 2011
352ed61
Added SettingList (As an arrayList).
ShaRose Oct 25, 2011
778ff8c
Updated to Minecraft 1.0.0
ShaRose Nov 25, 2011
bf329c9
Added WidgetSimplewindow.scrollPane.
ShaRose Dec 30, 2011
13afb23
Updated TWL.
ShaRose Jan 14, 2012
a5c8808
Updated GuiApiFontHelper for the new TWL.
ShaRose Jan 14, 2012
ca567d9
Updated to 1.1.
ShaRose Jan 14, 2012
a1ccd42
Added toString to ModAction.
ShaRose Feb 3, 2012
f3e5a7c
Moved some stuff around to fix a dumb bug when I should have known be…
ShaRose Feb 3, 2012
78df5fd
Updated to 1.2.3.
ShaRose Mar 5, 2012
c7c9f1f
Added some debug stuff to LWJGLTexture (Meaning to do it for a while,…
ShaRose Mar 27, 2012
4a93573
Added the Ingame Message example. Updated the ant script to accomadat…
ShaRose Apr 5, 2012
e79fc48
Fixed it so that GuiAPI supports Minecraft launchers that install mod…
ShaRose Apr 28, 2012
4e4f310
Added some javadoc to the Slider.
ShaRose May 7, 2012
16b10f2
Fixed some javadoc derps.
ShaRose May 7, 2012
3899268
Added borders to a few widgets (TextArea, Buttons, Label, Listboxes, …
ShaRose May 7, 2012
f092b04
Added a todo to remind me to change WidgetSimplewindow.scrollPane to …
ShaRose May 8, 2012
a082fad
Removed what was left of the 'jar protection' code.
ShaRose May 8, 2012
6794036
Added an interface for widgets to always draw on WidgetClassicTwoColu…
ShaRose Jul 25, 2012
5f32055
Added even MORE breakage detection for WidgetItem2DRender. Removed th…
ShaRose Jul 25, 2012
cf98d2c
Updated to 1.3.1.
ShaRose Aug 5, 2012
45db4e2
Fix for MCP sandboxing to work
Vayner Aug 6, 2012
2ea8a82
Pulled Vayner's request, changed it so that it attempts to get a Cano…
ShaRose Aug 6, 2012
d15e4ec
Updated TWL.
ShaRose Nov 22, 2012
5edd398
Major update. 0.15.2.
ShaRose Dec 28, 2012
9d2f033
Updated to 0.15.3 for 1.5.
ShaRose Mar 16, 2013
8343c98
Update readme.md
ShaRose Mar 16, 2013
d6ba10e
Updated for 0.15.5, 1.5.1. Didn't push last time.
ShaRose Apr 12, 2013
c4e19e3
Merge branch 'master' of https://github.com/ShaRose/GuiAPI
ShaRose Apr 12, 2013
9402491
Didn't commit the dummy coremod. Not like it was any big change.
ShaRose Apr 17, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions .classpath

This file was deleted.

39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@

# eclipse
.project
.classpath
.settings

# eclipse and mcp use this
bin/

# all of mcp
CHANGELOG
cleanup.bat
cleanup.sh
conf/
decompile.bat
decompile.sh
docs/
eclipse/
jars/
lib/
LICENSE
logs/
recompile.bat
recompile.sh
reobf/
reobfuscate.bat
reobfuscate.sh
runtime/
startclient.bat
startclient.sh
startserver.bat
startserver.sh
temp/
updatemcp.bat
updatemcp.sh
updatemd5.bat
updatemd5.sh
updatenames.bat
updatenames.sh

17 changes: 0 additions & 17 deletions .project

This file was deleted.

12 changes: 0 additions & 12 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

36 changes: 36 additions & 0 deletions GuiAPIAnt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<property environment="env"/>
<target name="javadoc">
<javadoc access="protected" author="true" classpath="/Client/jars/bin/minecraft.jar;/Client/jars/bin/lwjgl.jar;/Client/jars/bin/lwjgl_util.jar;/Client/jars/bin/jinput.jar" destdir="C:\Users\Shawn\Dropbox\Public\GuiAPI Javadoc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.5" splitindex="true" use="true" version="true">
<fileset dir="..\..\src\minecraft\net\minecraft\src" casesensitive="no" defaultexcludes="no">
<include name="**/GuiModScreen.java"/>
<include name="**/GuiModSelect.java"/>
<include name="**/GuiWidgetScreen.java"/>
<include name="**/*GuiApi*.java"/>
<include name="**/ModAction.java"/>
<include name="**/ModSettings.java"/>
<include name="**/ModSettingScreen.java"/>
<include name="**/Setting*.java"/>
<include name="**/Widget*.java"/>
<include name="**/GuiOptions.java"/>
</fileset>
</javadoc>
</target>
<target name="copyfiles">
<copy todir="G:\MineCraft\GitHub\GuiAPI\mcp">
<fileset dir="..\..\src\minecraft\net\minecraft\src" casesensitive="no" defaultexcludes="no">
<include name="**/GuiModScreen.java"/>
<include name="**/GuiModSelect.java"/>
<include name="**/GuiWidgetScreen.java"/>
<include name="**/*GuiApi*.java"/>
<include name="**/ModAction.java"/>
<include name="**/ModSettings.java"/>
<include name="**/ModSettingScreen.java"/>
<include name="**/Setting*.java"/>
<include name="**/Widget*.java"/>
<include name="**/GuiOptions.java"/>
</fileset>
</copy>
</target>
</project>
15 changes: 0 additions & 15 deletions README.creole

This file was deleted.

Binary file removed bin/GuiModScreen.class
Binary file not shown.
Binary file removed bin/GuiModSelect.class
Binary file not shown.
Binary file removed bin/GuiWidgetScreen.class
Binary file not shown.
Binary file removed bin/ModAction.class
Binary file not shown.
Binary file removed bin/ModCallback.class
Binary file not shown.
Binary file removed bin/ModSettingScreen.class
Binary file not shown.
Binary file removed bin/ModSettings.class
Binary file not shown.
Binary file removed bin/ScreenScaleProxy.class
Binary file not shown.
Binary file removed bin/Setting.class
Binary file not shown.
Binary file removed bin/SettingBoolean.class
Binary file not shown.
Binary file removed bin/SettingFloat.class
Binary file not shown.
Binary file removed bin/SettingInt.class
Binary file not shown.
Binary file removed bin/SettingKey.class
Binary file not shown.
Binary file removed bin/SettingMulti.class
Binary file not shown.
Binary file removed bin/SettingText.class
Binary file not shown.
Binary file removed bin/Subscreen.class
Binary file not shown.
Binary file removed bin/WidgetBoolean.class
Binary file not shown.
Binary file removed bin/WidgetClassicTwocolumn.class
Binary file not shown.
Binary file removed bin/WidgetClassicWindow.class
Binary file not shown.
Binary file removed bin/WidgetFloat.class
Binary file not shown.
Binary file removed bin/WidgetInt.class
Binary file not shown.
Binary file removed bin/WidgetKeybinding.class
Binary file not shown.
Binary file removed bin/WidgetMulti.class
Binary file not shown.
Binary file removed bin/WidgetSetting.class
Binary file not shown.
Binary file removed bin/WidgetSimplewindow.class
Binary file not shown.
Binary file removed bin/WidgetSingleRow.class
Binary file not shown.
Binary file removed bin/WidgetSinglecolumn.class
Binary file not shown.
Binary file removed bin/WidgetSlider.class
Binary file not shown.
Binary file removed bin/WidgetText.class
Binary file not shown.
Binary file removed bin/ch.class
Binary file not shown.
Binary file removed bin/oa.class
Binary file not shown.
Binary file removed bin/qp.class
Binary file not shown.
Binary file removed bin/uq.class
Binary file not shown.
160 changes: 160 additions & 0 deletions mcp/sharose/mods/guiapi/GuiAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
package sharose.mods.guiapi;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.Side;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.*;
import net.minecraft.client.settings.EnumOptions;
import net.minecraft.src.BaseMod;
import net.minecraft.src.ModLoader;

@Mod(name = "GuiAPI", modid = "GuiAPI", version = "0.15.5 - DEBUG", acceptedMinecraftVersions = "1.5.1")
public class GuiAPI implements ITickHandler {

Object cacheCheck = null;
Field controlListField;

@Init
public void init(FMLInitializationEvent event) {

try
{
controlListField = GuiScreen.class.getDeclaredField(ObfuscationReflectionHelper
.remapFieldNames("net.minecraft.client.gui.GuiScreen", "buttonList")[0]);
controlListField.setAccessible(true);
}
catch(Throwable e)
{
try
{
controlListField = GuiScreen.class.getDeclaredField("buttonList");
controlListField.setAccessible(true);
}
catch(Throwable e2)
{
try {
Field[] fields = GuiScreen.class.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
if (fields[i].getType() == List.class) {
controlListField = fields[i];
controlListField.setAccessible(true);
break;
}
}
if (controlListField == null) {
throw new Exception("No fields found on GuiScreen ("
+ GuiScreen.class.getSimpleName()
+ ") of type List! This should never happen!");
}
} catch (Throwable e3) {
throw new RuntimeException(
"Unable to get Field reference for GuiScreen.controlList!",
e3);
}
}

}


TickRegistry.registerTickHandler(this, Side.CLIENT);
}

public List getControlList(GuiOptions gui) {
try {
return (List) controlListField.get(gui);
} catch (Throwable e) {
return null; // This should really print something, but it should
// never (ever) fire.
}
}

public void processGuiOptions(GuiOptions gui) {
List controlList = getControlList(gui);
if (controlList == null) {
return;
}
if (controlList.get(0) == cacheCheck) {
// Cached so we don't have to check this every frame
return;
}

// I hacked this out so it just sticks it between touchscreen mode and difficulty. I'm so sorry.

// First get a list of buttons
ArrayList<GuiSmallButton> buttonsPreSorted = new ArrayList<GuiSmallButton>();
for (Object guiButton : controlList) {
if (guiButton instanceof GuiSmallButton)
buttonsPreSorted.add((GuiSmallButton) guiButton);
}



int xPos = -1; // difficulty
int yPos = -1; // touchscreen mode
for (GuiSmallButton guiButton : buttonsPreSorted) {
if(guiButton.returnEnumOptions() == EnumOptions.DIFFICULTY)
{
xPos = guiButton.xPosition;
}

if(guiButton.returnEnumOptions() == EnumOptions.TOUCHSCREEN)
{
yPos = guiButton.yPosition;
}
}


controlList.add(new GuiApiButton(300, xPos, yPos, 150, 20,
"Global Mod Options"));

// set the cache!
cacheCheck = controlList.get(0);
}

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if (!type.contains(TickType.RENDER)) {
return;
}
if (Minecraft.getMinecraft() == null) {
return; // what
}
if (Minecraft.getMinecraft().currentScreen == null) {
return;
}
if (Minecraft.getMinecraft().currentScreen instanceof GuiOptions) {
processGuiOptions((GuiOptions) Minecraft.getMinecraft().currentScreen);
}
}

@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {

}

@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.RENDER);
}

@Override
public String getLabel() {
return "GuiAPI main menu checker";
}
}
32 changes: 32 additions & 0 deletions mcp/sharose/mods/guiapi/GuiAPIDummyCoreMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package sharose.mods.guiapi;

import java.util.Map;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

@IFMLLoadingPlugin.MCVersion("1.5.1")
public class GuiAPIDummyCoreMod implements IFMLLoadingPlugin {
@Override
public String[] getLibraryRequestClass() {
return null;
}

@Override
public String[] getASMTransformerClass() {
return null;
}

@Override
public String getModContainerClass() {
return null;
}

@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {
}
}
26 changes: 26 additions & 0 deletions mcp/sharose/mods/guiapi/GuiApiButton.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package sharose.mods.guiapi;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;

public class GuiApiButton extends GuiButton {

public GuiApiButton(int par1, int par2, int par3, int par4, int par5,
String par6Str) {
super(par1, par2, par3, par4, par5, par6Str);
}

@Override
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
{
if(super.mousePressed(par1Minecraft, par2, par3))
{
par1Minecraft.gameSettings.saveOptions();
ModSettingScreen.guiContext = "";
WidgetSetting.updateAll();
GuiModScreen.show(new GuiModSelect(par1Minecraft.currentScreen));
return true;
}
return false;
}
}
Loading