Skip to content

Commit

Permalink
Merge pull request #18 from Superfrogman98/staging_branch
Browse files Browse the repository at this point in the history
Sawbench Improvements/Fixes, and Additional Shapes
  • Loading branch information
Dream-Master authored Mar 10, 2024
2 parents e3aa73e + 51efc36 commit d6868cd
Show file tree
Hide file tree
Showing 16 changed files with 914 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
.tmp
/jdks/
/native/
/wrapper/dists/
.shelf
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
}


259 changes: 259 additions & 0 deletions shapemenu_items_0.pdn

Large diffs are not rendered by default.

Binary file added shapemenu_items_1.pdn
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void drawShapeMenu() {
double w = shapeMenuWidth + 2 * shapeMenuMargin;
double h = shapeMenuHeight + 2 * shapeMenuMargin;
drawTexturedRect(-shapeMenuMargin, -shapeMenuMargin, w, h, 0, 0, shapeMenuScale * w, shapeMenuScale * h);
bindTexture("gui/shapemenu_items.png", 512, 512);

int p = te.selectedPage;
if (p >= 0 && p < TileSawbench.pages.length) {
ShapePage page = TileSawbench.pages[p];
Expand All @@ -143,7 +143,9 @@ void drawShapeMenu() {
Shape shape = shapes[i];
int mrow = i / shapeMenuCols, mcol = i % shapeMenuCols;
int id = shape.id;
int trow = id / 10, tcol = id % 10;
int textureSheet = id / 110;
bindTexture("gui/shapemenu_items_" + textureSheet + ".png", 512, 512);
int trow = (id % 110) / 10, tcol = (id % 110) % 10;
drawTexturedRect(
(mcol + 0.5) * shapeMenuCellSize - 0.5 * shapeMenuItemWidth,
(mrow + 0.5) * shapeMenuCellSize - 0.5 * shapeMenuItemHeight,
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/gcewing/architecture/client/gui/widget/GuiText.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public enum GuiText {
Railings,
Other,

Glow,

// Tiles
RoofTile,
RoofOuterCorner,
Expand Down Expand Up @@ -131,6 +133,21 @@ public enum GuiText {
SlopeTileC3,
SlopeTileC4,

AngledRoofRidge,
SquareSE,
SlabSE,
RoofTileSE,
SlopeTileA1SE,
SlopeTileA2SE,
SlopeTileB1SE,
SlopeTileB2SE,
SlopeTileB3SE,
SlopeTileC1SE,
SlopeTileC2SE,
SlopeTileC3SE,
SlopeTileC4SE,
DoubleRoofTile,

// UI Colors
FontColor(0x404040),
SelectedBgColor(0x66CCFF);
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/gcewing/architecture/common/shape/Shape.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import static gcewing.architecture.common.shape.Generic.lrStraight;
import static gcewing.architecture.common.shape.Generic.rlCorner;
import static gcewing.architecture.common.shape.ShapeKind.Banister;
import static gcewing.architecture.common.shape.ShapeKind.Cladding;
import static gcewing.architecture.common.shape.ShapeKind.Model;
import static gcewing.architecture.common.shape.ShapeKind.Roof;
import static gcewing.architecture.common.shape.ShapeSymmetry.Bilateral;
import static gcewing.architecture.common.shape.ShapeSymmetry.None;
import static gcewing.architecture.common.shape.ShapeSymmetry.Quadrilateral;
import static gcewing.architecture.common.shape.ShapeSymmetry.Unilateral;
import static gcewing.architecture.common.shape.WindowShapeKinds.CornerWindow;
Expand Down Expand Up @@ -99,7 +99,7 @@ public enum Shape {
CorniceValley(55, "Cornice Valley", Model("cornice_valley"), Bilateral, 1, 4, 0xcc),
CorniceBottom(56, "Cornice Bottom", Model("cornice_bottom"), Bilateral, 1, 4, 0x0c),

CladdingSheet(60, "Cladding", Cladding, null, 1, 1, 0),
CladdingSheet(60, "Cladding", Model("cladding"), None, 1, 1, 0x0c),

ArchD1(61, "Arch Diameter 1", Model("arch_d1"), Bilateral, 1, 1, 0xff, ShapeFlags.placeUnderneath),
ArchD2(62, "Arch Diameter 2", Model("arch_d2"), Bilateral, 1, 2, 0xfc, ShapeFlags.placeUnderneath),
Expand Down Expand Up @@ -176,7 +176,9 @@ public enum Shape {
SlopeTileC4SE(111, "Slope C 4(Glow)", Roof, Bilateral, 1, 4, 0x0f),
RoofTileSE(112, "Roof Tile(Glow)", Roof, Bilateral, 1, 2, 0xcf),
SquareSE(113, "Square(Glow)", Model("square"), Quadrilateral, 1, 1, 0x0),
SlabSE(114, "Slab(Glow)", Model("slab"), Quadrilateral, 1, 2, 0x0),;
SlabSE(114, "Slab(Glow)", Model("slab"), Quadrilateral, 1, 2, 0x0),
AngledRoofRidge(115, "Angled Roof Ridge", Model("angled_roof_ridge"), Bilateral, 1, 4, 0x0f),
DoubleRoofTile(116, "Double Roof Tile", Model("double_roof_tile"), Bilateral, 1, 2, 0xcf),;

public int id;
public String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public ItemStack newStack(Shape shape, Block materialBlock, int materialMeta, in
boolean shaderEmissive) {
TileShape te = new TileShape(shape, materialBlock, materialMeta);
int light = materialBlock.getLightValue();
if (shape.id == Shape.CladdingSheet.id) {
return ArchitectureCraft.content.itemCladding.newStack(materialBlock, materialMeta, stackSize);
}

if (shaderEmissive) {
light = 15;
ItemStack result = TileArchitecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum ShapeSymmetry {

Unilateral,
Bilateral,
Quadrilateral
Quadrilateral,
None

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

package gcewing.architecture.common.tile;

import static gcewing.architecture.common.shape.Shape.AngledRoofRidge;
import static gcewing.architecture.common.shape.Shape.AnticylinderLargeQuarter;
import static gcewing.architecture.common.shape.Shape.ArchD1;
import static gcewing.architecture.common.shape.Shape.ArchD2;
Expand Down Expand Up @@ -55,6 +56,7 @@
import static gcewing.architecture.common.shape.Shape.DoricMetope;
import static gcewing.architecture.common.shape.Shape.DoricTriglyph;
import static gcewing.architecture.common.shape.Shape.DoricTriglyphCorner;
import static gcewing.architecture.common.shape.Shape.DoubleRoofTile;
import static gcewing.architecture.common.shape.Shape.IonicCapital;
import static gcewing.architecture.common.shape.Shape.Pillar;
import static gcewing.architecture.common.shape.Shape.PillarBase;
Expand Down Expand Up @@ -233,7 +235,9 @@ public class TileSawbench extends TileArchitectureInventory implements IRestrict
SlopeTileC1,
SlopeTileC2,
SlopeTileC3,
SlopeTileC4),
SlopeTileC4,
AngledRoofRidge,
DoubleRoofTile),
new ShapePage(
"Glow",
SquareSE,
Expand Down Expand Up @@ -395,6 +399,7 @@ protected ItemStack makeResultStack() {
ItemStack materialStack = getStackInSlot(materialSlot);
if (materialStack != null && materialStack.stackSize >= resultShape.materialUsed) {
Item materialItem = materialStack.getItem();

if (materialItem instanceof ItemBlock) {
Block materialBlock = Block.getBlockFromItem(materialItem);
if (isAcceptableMaterial(materialBlock)) {
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/assets/architecturecraft/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gui.architecturecraft.Window=Window
gui.architecturecraft.Arches=Arches
gui.architecturecraft.Railings=Railings
gui.architecturecraft.Other=Other
gui.architecturecraft.Glow=Glow

# Shapes
gui.architecturecraft.RoofTile=Roof Tile
Expand Down Expand Up @@ -138,3 +139,19 @@ gui.architecturecraft.SlopeTileC1=Slope C 1
gui.architecturecraft.SlopeTileC2=Slope C 2
gui.architecturecraft.SlopeTileC3=Slope C 3
gui.architecturecraft.SlopeTileC4=Slope C 4
gui.architecturecraft.AngledRoofRidge=Angled Roof Ridge

gui.architecturecraft.SquareSE=Square(Glow)
gui.architecturecraft.SlabSE=Slab(Glow)
gui.architecturecraft.RoofTileSE=Roof Tile(Glow)
gui.architecturecraft.SlopeTileA1SE=Slope A Start(Glow)
gui.architecturecraft.SlopeTileA2SE=Slope A End(Glow)
gui.architecturecraft.SlopeTileB1SE=Slope B Start(Glow)
gui.architecturecraft.SlopeTileB2SE=Slope B Middle(Glow)
gui.architecturecraft.SlopeTileB3SE=Slope B End(Glow)
gui.architecturecraft.SlopeTileC1SE=Slope C 1(Glow)
gui.architecturecraft.SlopeTileC2SE=Slope C 2(Glow)
gui.architecturecraft.SlopeTileC3SE=Slope C 3(Glow)
gui.architecturecraft.SlopeTileC4SE=Slope C 4(Glow)

gui.architecturecraft.DoubleRoofTile=Double Roof Tile
Loading

0 comments on commit d6868cd

Please sign in to comment.