EMI

EMI

1M Downloads

GUI compatibility with AE2

Chikage0o0 opened this issue · 4 comments

commented

Hi, I am adding support for AE2 to EMI and I would like to ask how to handle this situation for gui render overlay.

屏幕截图 2022-09-30 160218.png
屏幕截图 2022-09-30 160236.png

https://github.com/Chikage0o0/EMICompat
Should this issue be handled by EMICompat or EMI?

One more question:
REI provides me.shedaniel.rei.plugin.common.displays.DefaultInformationDisplay
Can EMI provide a similar api?

commented

registry.addGenericExclusionArea (I believe it's called) will let you register one for everything, then you can check if the screen is an instance of your base class

commented

Many thanks

commented

EMI lets you specify exclusion areas to prevent sidebars from rendering there. As it is currently, it doesn't move the buttons at the top. Also, EMI has the necessary information to move the search bar out of the way, but currently does not. Both of these things are issues that EMI is responsible for fixing, from your end all you should have to do is add exclusion areas.

commented

EMI lets you specify exclusion areas to prevent sidebars from rendering there. As it is currently, it doesn't move the buttons at the top. Also, EMI has the necessary information to move the search bar out of the way, but currently does not. Both of these things are issues that EMI is responsible for fixing, from your end all you should have to do is add exclusion areas.

        Reflections reflections = new Reflections("appeng");
        Set<Class<? extends AEBaseScreen>> subClass = reflections.getSubTypesOf(AEBaseScreen.class);
        subClass.forEach(i -> {
            registry.addExclusionArea(i, (screen, consumer) -> {
                if (screen != null)
                    mapRects(screen.getExclusionZones()).forEach(bounds -> consumer.accept((Bounds) bounds));
            });
        });

Hi, is there a better way to register subclasses in bulk other than using reflection?