use of cc.hyperium.mods.keystrokes.keys.impl.CustomKey in project Hyperium by HyperiumClient.
the class KeystrokesSettings method parseSettings.
private void parseSettings(BetterJsonObject object) {
x = object.optInt("x");
y = object.optInt("y");
red = object.optInt("red", 255);
green = object.optInt("green", 255);
blue = object.optInt("blue", 255);
pressedRed = object.optInt("pressedRed");
pressedGreen = object.optInt("pressedGreen");
pressedBlue = object.optInt("pressedBlue");
setScale(object.optDouble("scale", 1.0D));
setFadeTime(object.optDouble("fadeTime", 1.0D));
enabled = object.optBoolean("enabled", true);
chroma = object.optBoolean("chroma");
leftClick = object.optBoolean("leftClick", true);
mouseButtons = object.optBoolean("mouseButtons");
showCPS = object.optBoolean("showCPS");
showCPSOnButtons = object.optBoolean("showCPSOnButtons");
showSpacebar = object.optBoolean("showSpacebar");
showingSneak = object.optBoolean("showSneak");
showingFPS = object.optBoolean("showFps");
keyBackground = object.optBoolean("keyBackground", true);
showingWASD = object.optBoolean("showingWASD", true);
literalKeys = object.optBoolean("literalKeys");
keyBackgroundOpacity = object.optInt("keyBackgroundOpacity", 120);
keyBackgroundRed = object.optInt("keyBackgroundRed");
keyBackgroundGreen = object.optInt("keyBackgroundGreen");
keyBackgroundBlue = object.optInt("keyBackgroundBlue");
arrowKeys = object.optBoolean("arrowKeys");
JsonObject data = object.getData();
if (data.has("custom")) {
JsonArray custom = data.getAsJsonArray("custom");
for (JsonElement element : custom) {
JsonHolder holder = new JsonHolder(element.getAsJsonObject());
CustomKeyWrapper wrapper = new CustomKeyWrapper(new CustomKey(theMod, holder.optInt("key"), holder.optInt("type")), holder.optInt("xOffset"), holder.optInt("yOffset"));
configWrappers.add(wrapper);
}
}
}
use of cc.hyperium.mods.keystrokes.keys.impl.CustomKey in project Hyperium by HyperiumClient.
the class GuiScreenEditKeys method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
switch(button.id) {
case 1:
CustomKeyWrapper key = new CustomKeyWrapper(new CustomKey(mod, 30, 1), 10, 10);
selected = key;
mod.getRenderer().getCustomKeys().add(key);
break;
case 2:
listeningForNewKey = true;
changeKey.displayString = "Listening...";
break;
case 3:
CustomKey theKey = selected.getKey();
theKey.setType(theKey.getType() + 1);
if (theKey.getType() > 2) {
theKey.setType(0);
break;
}
break;
case 4:
mod.getRenderer().getCustomKeys().remove(selected);
selected = null;
break;
}
}
Aggregations