gui.control pkg
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.config;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||
|
||||
public class ModGuiConfig extends GuiConfig {
|
||||
public ModGuiConfig(GuiScreen guiScreen) {
|
||||
super(
|
||||
guiScreen,
|
||||
RS.INSTANCE.config.getConfigElements(),
|
||||
RS.ID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString())
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.config;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.fml.client.IModGuiFactory;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ModGuiFactory implements IModGuiFactory {
|
||||
@Override
|
||||
public void initialize(Minecraft mc) {
|
||||
// NO OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConfigGui() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
||||
return new ModGuiConfig(parentScreen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.control;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -60,7 +59,8 @@ public class Scrollbar {
|
||||
isScrolling = false;
|
||||
wasClicking = false;
|
||||
} else {
|
||||
boolean down = Mouse.isButtonDown(0);
|
||||
// TODO boolean down = Mouse.isButtonDown(0);
|
||||
boolean down = false;
|
||||
|
||||
if (!wasClicking && down && gui.inBounds(x, y, width, height, mouseX, mouseY)) {
|
||||
isScrolling = true;
|
||||
|
@@ -34,9 +34,7 @@ public class SideButtonCompare extends SideButton {
|
||||
protected void drawButtonIcon(int x, int y) {
|
||||
int ty = 0;
|
||||
|
||||
if (mask == IComparer.COMPARE_DAMAGE) {
|
||||
ty = 80;
|
||||
} else if (mask == IComparer.COMPARE_NBT) {
|
||||
if (mask == IComparer.COMPARE_NBT) {
|
||||
ty = 48;
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@ package com.raoulvdberge.refinedstorage.gui.control;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiCrafterManager;
|
||||
import com.raoulvdberge.refinedstorage.integration.jei.IntegrationJEI;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileCrafterManager;
|
||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -32,11 +31,11 @@ public class SideButtonCrafterManagerSearchBoxMode extends SideButton {
|
||||
if (mode == IGrid.SEARCH_BOX_MODE_NORMAL) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_NORMAL_AUTOSELECTED;
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_NORMAL_AUTOSELECTED) {
|
||||
if (IntegrationJEI.isLoaded()) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED;
|
||||
} else {
|
||||
//TODO if (IntegrationJEI.isLoaded()) {
|
||||
// mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED;
|
||||
//} else {
|
||||
mode = IGrid.SEARCH_BOX_MODE_NORMAL;
|
||||
}
|
||||
//}
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED;
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED) {
|
||||
|
@@ -3,7 +3,6 @@ package com.raoulvdberge.refinedstorage.gui.control;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
||||
import com.raoulvdberge.refinedstorage.integration.jei.IntegrationJEI;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public class SideButtonGridSearchBoxMode extends SideButton {
|
||||
@@ -30,11 +29,11 @@ public class SideButtonGridSearchBoxMode extends SideButton {
|
||||
if (mode == IGrid.SEARCH_BOX_MODE_NORMAL) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_NORMAL_AUTOSELECTED;
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_NORMAL_AUTOSELECTED) {
|
||||
if (IntegrationJEI.isLoaded()) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED;
|
||||
} else {
|
||||
//TODO if (IntegrationJEI.isLoaded()) {
|
||||
// mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED;
|
||||
//} else {
|
||||
mode = IGrid.SEARCH_BOX_MODE_NORMAL;
|
||||
}
|
||||
//}
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED) {
|
||||
mode = IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED;
|
||||
} else if (mode == IGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED) {
|
||||
|
@@ -4,9 +4,7 @@ import com.raoulvdberge.refinedstorage.api.network.grid.GridType;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.sorting.GridSorterInventoryTweaks;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
public class SideButtonGridSortingType extends SideButton {
|
||||
private IGrid grid;
|
||||
@@ -46,7 +44,7 @@ public class SideButtonGridSortingType extends SideButton {
|
||||
} else if (type == IGrid.SORTING_TYPE_ID) {
|
||||
type = IGrid.SORTING_TYPE_LAST_MODIFIED;
|
||||
} else if (type == NetworkNodeGrid.SORTING_TYPE_LAST_MODIFIED) {
|
||||
if (grid.getGridType() == GridType.FLUID || !Loader.isModLoaded(GridSorterInventoryTweaks.MOD_ID)) {
|
||||
if (grid.getGridType() == GridType.FLUID || /* TODO !Loader.isModLoaded(GridSorterInventoryTweaks.MOD_ID)*/false) {
|
||||
type = IGrid.SORTING_TYPE_QUANTITY;
|
||||
} else {
|
||||
type = IGrid.SORTING_TYPE_INVENTORYTWEAKS;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.control;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGridTab;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -30,8 +30,8 @@ public class TabList {
|
||||
|
||||
private List<ITabListListener> listeners = new LinkedList<>();
|
||||
|
||||
private GuiButton left;
|
||||
private GuiButton right;
|
||||
private Button left;
|
||||
private Button right;
|
||||
|
||||
private int width;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class TabList {
|
||||
if (this.hadTabs != hasTabs) {
|
||||
this.hadTabs = hasTabs;
|
||||
|
||||
gui.initGui();
|
||||
gui.init();
|
||||
}
|
||||
|
||||
if (page.get() > pages.get()) {
|
||||
@@ -89,8 +89,8 @@ public class TabList {
|
||||
|
||||
left.visible = pages.get() > 0;
|
||||
right.visible = pages.get() > 0;
|
||||
left.enabled = page.get() > 0;
|
||||
right.enabled = page.get() < pages.get();
|
||||
left.active = page.get() > 0; // TODO correct? active
|
||||
right.active = page.get() < pages.get(); // TODO correct? active
|
||||
}
|
||||
|
||||
public void drawBackground(int x, int y) {
|
||||
@@ -124,7 +124,7 @@ public class TabList {
|
||||
int tx = x + getXOffset() + ((IGridTab.TAB_WIDTH + 1) * num);
|
||||
int ty = y;
|
||||
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableAlphaTest();
|
||||
|
||||
gui.bindTexture("icons.png");
|
||||
|
||||
@@ -171,7 +171,7 @@ public class TabList {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void actionPerformed(GuiButton button) {
|
||||
public void actionPerformed(Button button) {
|
||||
if (button == left) {
|
||||
listeners.forEach(t -> t.onPageChanged(page.get() - 1));
|
||||
} else if (button == right) {
|
||||
|
@@ -1,10 +1,8 @@
|
||||
package com.raoulvdberge.refinedstorage.gui.control;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RSKeyBindings;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
@@ -36,9 +34,8 @@ public class TextFieldSearch extends TextFieldWidget {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
boolean wasFocused = isFocused();
|
||||
|
||||
boolean result = super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
@@ -58,13 +55,13 @@ public class TextFieldSearch extends TextFieldWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean textboxKeyTyped(char typedChar, int keyCode) {
|
||||
@SuppressWarnings("deprecation") boolean canLoseFocus = ObfuscationReflectionHelper.getPrivateValue(GuiTextField.class, this, 10);
|
||||
public boolean charTyped(char typedChar, int keyCode) {
|
||||
// TODO @SuppressWarnings("deprecation") boolean canLoseFocus = ObfuscationReflectionHelper.getPrivateValue(GuiTextField.class, this, 10);
|
||||
|
||||
boolean result = super.textboxKeyTyped(typedChar, keyCode);
|
||||
boolean result = super.charTyped(typedChar, keyCode);
|
||||
|
||||
if (isFocused()) {
|
||||
if (keyCode == Keyboard.KEY_UP) {
|
||||
/* TODO if (keyCode == Keyboard.KEY_UP) {
|
||||
updateSearchHistory(-1);
|
||||
|
||||
result = true;
|
||||
@@ -80,10 +77,10 @@ public class TextFieldSearch extends TextFieldWidget {
|
||||
}
|
||||
|
||||
result = true;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if (keyCode == RSKeyBindings.FOCUS_SEARCH_BAR.getKeyCode() && canLoseFocus) {
|
||||
if (/*TODO keyCode == RSKeyBindings.FOCUS_SEARCH_BAR.getKeyCode() && canLoseFocus*/false) {
|
||||
setFocused(!isFocused());
|
||||
|
||||
saveHistory();
|
||||
|
Reference in New Issue
Block a user