Comments (14)
Could you describe your problem more precisely?
- What Minecraft version are you using?
- What instructions have you followed?
- Could you maybe paste the code you wrote that you think may be the problem?
from panelstudio.
Version i am using is 1.16.5, I just followed the general instructions in the readme. this is the whole gui class:
package me.constantindev.ccl.gui;
import com.lukflug.panelstudio.CollapsibleContainer;
import com.lukflug.panelstudio.DraggableContainer;
import com.lukflug.panelstudio.SettingsAnimation;
import com.lukflug.panelstudio.mc16.MinecraftGUI;
import com.lukflug.panelstudio.settings.SimpleToggleable;
import com.lukflug.panelstudio.theme.ColorScheme;
import com.lukflug.panelstudio.theme.GameSenseTheme;
import com.lukflug.panelstudio.theme.Theme;
import me.constantindev.ccl.etc.MType;
import me.constantindev.ccl.etc.base.Module;
import me.constantindev.ccl.etc.config.ClientConfig;
import me.constantindev.ccl.etc.reg.ModuleRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
import java.awt.*;
public class ClickGUI extends MinecraftGUI {
private final GUIInterface guiInterface;
private final Theme theme;
private final com.lukflug.panelstudio.ClickGUI gui;
public ClickGUI() {
guiInterface = new GUIInterface(true) {
@Override
protected String getResourcePrefix() {
return "ccl:gui/";
}
@Override
public void drawString(Point pos, String s, Color c) {
end();
MinecraftClient.getInstance().textRenderer.draw(new MatrixStack(), s, pos.x, pos.y, c.getRGB());
begin();
}
@Override
public int getFontWidth(String s) {
return MinecraftClient.getInstance().textRenderer.getWidth(s);
}
@Override
public int getFontHeight() {
return MinecraftClient.getInstance().textRenderer.fontHeight;
}
};
theme = new GameSenseTheme(new ColorScheme() {
@Override
public Color getActiveColor() {
return new Color(20, 255, 255);
}
@Override
public Color getInactiveColor() {
return new Color(20, 50, 255);
}
@Override
public Color getBackgroundColor() {
return new Color(40, 40, 40);
}
@Override
public Color getOutlineColor() {
return new Color(100, 100, 100);
}
@Override
public Color getFontColor() {
return new Color(255, 40, 40);
}
@Override
public int getOpacity() {
return 255;
}
}, height, 2, 2);
gui = new com.lukflug.panelstudio.ClickGUI(guiInterface, null);
for (MType type : MType.ALL) {
com.lukflug.panelstudio.DraggableContainer container = new DraggableContainer(type.toString(), null, theme.getContainerRenderer(), new SimpleToggleable(true), new SettingsAnimation(ClientConfig.animSpeed), new SimpleToggleable(true), new Point(50, 50), width);
gui.addComponent(container);
for (Module m : ModuleRegistry.getAll()) {
if (m.type != type) continue;
CollapsibleContainer mc = new CollapsibleContainer(m.name, null, theme.getContainerRenderer(), new SimpleToggleable(false), new SettingsAnimation(ClientConfig.animSpeed), m.isOn);
container.addComponent(mc);
}
}
}
@Override
protected com.lukflug.panelstudio.ClickGUI getGUI() {
return gui;
}
@Override
protected GUIInterface getInterface() {
return guiInterface;
}
@Override
protected int getScrollSpeed() {
return 1;
}
}
I can imagine some of the values I return like the scroll speed to affect this, since I did not have any true references for these.
from panelstudio.
Closed by accident, ouch
from panelstudio.
How do you open the GUI, do you call the MinecraftClient.getInstance().openScreen()
method?
from panelstudio.
Yes,
if (ModuleRegistry.getByName("clickgui").isOn.isOn()) {
ModuleRegistry.getByName("clickgui").isOn.setState(false);
MinecraftClient.getInstance().openScreen(new ClickGUI());
}
from panelstudio.
This is probably not related to the problem, but you should instantiate ClickGUI only once and not every time you open it.
Could you add following to the ClickGUI class and tell me if this print statement shows up when you click, to troubleshoot it?
@Override
public boolean mouseClicked(double mouseX, double mouseY, int clickedButton) {
// <insert print statement here>
return super.mouseClicked(mouseX,mousY,clickedButton)
}
from panelstudio.
it definitely does receive the events
from panelstudio.
Ah, ok I just noticed the problem:
}, height, 2, 2);
The height
field is inherited from a superclass and is actually zero. Replace height
in this line by a number like 12
.
from panelstudio.
still, nothing
from panelstudio.
Could you replace this:
new DraggableContainer(type.toString(), null, theme.getContainerRenderer(), new SimpleToggleable(true), new SettingsAnimation(ClientConfig.animSpeed), new SimpleToggleable(true), new Point(50, 50), width);
by this:
new DraggableContainer(type.toString(), null, theme.getContainerRenderer(), new SimpleToggleable(true), new SettingsAnimation(ClientConfig.animSpeed), new SimpleToggleable(true), new Point(50, 50), width) {
@Override
public void render (Context context) {
super.render(context);
System.out.println(context.getHeight());
}
}
from panelstudio.
I may have found the issue, lets see if this works
from panelstudio.
I found the issue. width
is inherited from a superclass aswell and is also 0. Causes the hitbox to be 0 px wide
from panelstudio.
Next issue: the categories can somehow be toggled and wont really expand anywhere
from panelstudio.
Fixed it, all good now
from panelstudio.
Related Issues (20)
- Issue when compiling and using the library in my mod HOT 2
- "Could not find shadowJar()"? HOT 7
- Help to building HOT 1
- gui.enterGUI() gives an error. HOT 23
- gradle bad pls help (could not find method shadowJar()) HOT 2
- Hud elements only rendering while in clickgui or hudeditor HOT 10
- ClassNotFoundException when clickgui gets initialized HOT 26
- Game crashes when trying to load the mod(i added mixins so that might be the problem) HOT 12
- Update HOT 1
- I'm a panelSTUD
- crash game example code HOT 12
- Doesn't work on Mac HOT 44
- Non-draggable? (Feature request) HOT 1
- Tutorial HOT 1
- The "Creating a clickGUI" section of the wiki doesnt lead anywhere HOT 1
- Keybinds run while in chat/menus HOT 1
- Panelstudio HOT 1
- how to get a module HOT 2
- Can't register speed moudle to event bus when enabled and de register when un enabled HOT 2
- lukflug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panelstudio.