Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,657 additions
and
1,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 55 additions & 49 deletions
104
...in/java/mezz/jei/gui/IRecipeGuiLogic.java → ...mezz/jei/gui/recipes/IRecipeGuiLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
package mezz.jei.gui; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.List; | ||
|
||
import mezz.jei.api.recipe.IFocus; | ||
import mezz.jei.api.recipe.IRecipeCategory; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public interface IRecipeGuiLogic { | ||
|
||
String getPageString(); | ||
|
||
void setRecipesPerPage(int recipesPerPage); | ||
|
||
boolean hasMultipleCategories(); | ||
|
||
boolean hasAllCategories(); | ||
|
||
void previousRecipeCategory(); | ||
|
||
void nextRecipeCategory(); | ||
|
||
boolean hasMultiplePages(); | ||
|
||
void previousPage(); | ||
|
||
void nextPage(); | ||
|
||
boolean setFocus(IFocus focus); | ||
|
||
@Nullable | ||
IFocus getFocus(); | ||
|
||
boolean back(); | ||
|
||
void clearHistory(); | ||
|
||
boolean setCategoryFocus(); | ||
|
||
boolean setCategoryFocus(List<String> recipeCategoryUids); | ||
|
||
@Nullable | ||
IRecipeCategory getRecipeCategory(); | ||
|
||
List<ItemStack> getRecipeCategoryCraftingItems(); | ||
|
||
List<RecipeLayout> getRecipeWidgets(int posX, int posY, int spacingY); | ||
} | ||
package mezz.jei.gui.recipes; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.List; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import mezz.jei.api.recipe.IFocus; | ||
import mezz.jei.api.recipe.IRecipeCategory; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public interface IRecipeGuiLogic { | ||
|
||
String getPageString(); | ||
|
||
void setRecipesPerPage(int recipesPerPage); | ||
|
||
boolean hasMultipleCategories(); | ||
|
||
boolean hasAllCategories(); | ||
|
||
void previousRecipeCategory(); | ||
|
||
void nextRecipeCategory(); | ||
|
||
void setRecipeCategory(IRecipeCategory category); | ||
|
||
boolean hasMultiplePages(); | ||
|
||
void previousPage(); | ||
|
||
void nextPage(); | ||
|
||
<V> boolean setFocus(IFocus<V> focus); | ||
|
||
IFocus getFocus(); | ||
|
||
boolean back(); | ||
|
||
void clearHistory(); | ||
|
||
boolean setCategoryFocus(); | ||
|
||
boolean setCategoryFocus(List<String> recipeCategoryUids); | ||
|
||
@Nullable | ||
IRecipeCategory getSelectedRecipeCategory(); | ||
|
||
ImmutableList<IRecipeCategory> getRecipeCategories(); | ||
|
||
List<ItemStack> getRecipeCategoryCraftingItems(); | ||
|
||
List<ItemStack> getRecipeCategoryCraftingItems(IRecipeCategory recipeCategory); | ||
|
||
List<RecipeLayout> getRecipeWidgets(int posX, int posY, int spacingY); | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/mezz/jei/gui/recipes/IRecipeLogicStateListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package mezz.jei.gui.recipes; | ||
|
||
public interface IRecipeLogicStateListener { | ||
void onStateChange(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package mezz.jei.gui.recipes; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import mezz.jei.api.recipe.IRecipeCategory; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.FontRenderer; | ||
import net.minecraft.client.renderer.GlStateManager; | ||
|
||
public class RecipeArrowTab extends RecipeGuiTab { | ||
private final RecipeGuiTabs recipeGuiTabs; | ||
private final boolean next; | ||
|
||
public RecipeArrowTab(RecipeGuiTabs recipeGuiTabs, boolean next, int x, int y) { | ||
super(x, y); | ||
this.recipeGuiTabs = recipeGuiTabs; | ||
this.next = next; | ||
} | ||
|
||
@Override | ||
public void draw(Minecraft minecraft, boolean selected, int mouseX, int mouseY) { | ||
super.draw(minecraft, selected, mouseX, mouseY); | ||
String arrow = next ? ">" : "<"; | ||
FontRenderer fontRenderer = minecraft.fontRendererObj; | ||
float textCenterX = x + (TAB_WIDTH / 2f); | ||
float textCenterY = y + (TAB_HEIGHT / 2f) - 3; | ||
int color = isMouseOver(mouseX, mouseY) ? 16777120 : 14737632; | ||
fontRenderer.drawStringWithShadow(arrow, textCenterX - fontRenderer.getStringWidth(arrow) / 2f, textCenterY, color); | ||
GlStateManager.color(1, 1, 1, 1); | ||
} | ||
|
||
@Override | ||
public boolean handleMouseClicked(int mouseX, int mouseY, int mouseButton) { | ||
if (next) { | ||
recipeGuiTabs.nextPage(); | ||
} else { | ||
recipeGuiTabs.prevPage(); | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isSelected(IRecipeCategory selectedCategory) { | ||
return false; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String getTooltip() { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.