Customizable edge stencil / Reduced redundant sprites
@@ -107,10 +107,10 @@ public class StructAnnotationProcessor extends AbstractProcessor{
|
|||||||
getter.addStatement("return ($L & (1L << $L)) != 0", structParam, offset);
|
getter.addStatement("return ($L & (1L << $L)) != 0", structParam, offset);
|
||||||
}else if(varType == TypeName.FLOAT){
|
}else if(varType == TypeName.FLOAT){
|
||||||
//floats: need conversion
|
//floats: need conversion
|
||||||
getter.addStatement("return Float.intBitsToFloat((int)(($L >> $L) & $L))", structParam, offset, bitString(size, structTotalSize));
|
getter.addStatement("return Float.intBitsToFloat((int)(($L >>> $L) & $L))", structParam, offset, bitString(size, structTotalSize));
|
||||||
}else{
|
}else{
|
||||||
//bytes, shorts, chars, ints
|
//bytes, shorts, chars, ints
|
||||||
getter.addStatement("return ($T)(($L >> $L) & $L)", varType, structParam, offset, bitString(size, structTotalSize));
|
getter.addStatement("return ($T)(($L >>> $L) & $L)", varType, structParam, offset, bitString(size, structTotalSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
//[setter] + [constructor building]
|
//[setter] + [constructor building]
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 145 B |
|
Before Width: | Height: | Size: 1013 KiB After Width: | Height: | Size: 975 KiB |
@@ -1,81 +1,308 @@
|
|||||||
{
|
{
|
||||||
Color: {
|
Color: {
|
||||||
black: {a: 1, b: 0, g: 0, r: 0 },
|
black: { a: 1, b: 0, g: 0, r: 0 },
|
||||||
white: {a: 1, b: 1, g: 1, r: 1 },
|
white: { a: 1, b: 1, g: 1, r: 1 },
|
||||||
gray: {a: 1, b: 0.32, g: 0.32, r: 0.32 },
|
gray: { a: 1, b: 0.32, g: 0.32, r: 0.32 },
|
||||||
lightgray: {a: 1, b: 0.65, g: 0.65, r: 0.65 }
|
lightgray: { a: 1, b: 0.65, g: 0.65, r: 0.65 }
|
||||||
orange: {hex: "FFA500"},
|
orange: { hex: "FFA500" },
|
||||||
accent: {hex: "ffd37f"}
|
accent: { hex: "ffd37f" }
|
||||||
},
|
},
|
||||||
TintedDrawable: {
|
TintedDrawable: {
|
||||||
dialogDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.9} },
|
dialogDim: {
|
||||||
invis: {name: white, color: {r: 0, g: 0, b: 0, a: 0} }
|
name: white,
|
||||||
loadDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.8} },
|
color: { r: 0, g: 0, b: 0, a: 0.9 }
|
||||||
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
|
},
|
||||||
dark: {name: white, color: {hex: "#000000ff"}},
|
invis: {
|
||||||
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}},
|
name: white,
|
||||||
flat: {name: white, color: {r: 0.0, g: 0.0, b: 0.0, a: 0.6}},
|
color: { r: 0, g: 0, b: 0, a: 0 }
|
||||||
flat-over: {name: white, color: { hex: "#ffffff82" }},
|
}
|
||||||
flat-down: {name: white, color: { hex: "#ffd37fff" }}
|
loadDim: {
|
||||||
},
|
name: white,
|
||||||
ButtonStyle: {
|
color: { r: 0, g: 0, b: 0, a: 0.8 }
|
||||||
default: {down: button-down, up: button },
|
},
|
||||||
toggle: {checked: button-down, down: button-down, up: button }
|
chatfield: {
|
||||||
},
|
name: white,
|
||||||
TextButtonStyle: {
|
color: { r: 0, g: 0, b: 0, a: 0.2 }
|
||||||
default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button},
|
},
|
||||||
node: {disabled: content-background-locked, font: default-font, fontColor: white, disabledFontColor: gray, up: content-background, over: content-background-over},
|
dark: {
|
||||||
right: {over: button-right-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-right-down, up: button-right},
|
name: white,
|
||||||
wave: {font: default-font, fontColor: white, disabledFontColor: gray, up: button-edge-4},
|
color: { hex: "#000000ff" }
|
||||||
clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: flat-over, up: flat},
|
},
|
||||||
discord: {font: default-font, fontColor: white, up: discord-banner},
|
none: {
|
||||||
info: {font: default-font, fontColor: white, up: info-banner},
|
name: white,
|
||||||
clear-partial: {down: white, up: button-select, over: flat-down, font: default-font, fontColor: white, disabledFontColor: gray },
|
color: { r: 0, g: 0, b: 0, a: 0 }
|
||||||
clear-partial-2: {down: flat-over, up: none, over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray },
|
},
|
||||||
empty: {font: default-font},
|
flat: {
|
||||||
clear-toggle: {font: default-font, fontColor: white, checked: flat-down, down: flat-down, up: flat, over: flat-over, disabled: flat, disabledFontColor: gray }
|
name: white,
|
||||||
toggle: {font: default-font, fontColor: white, checked: button-down, down: button-down, up: button, over: button-over, disabled: button, disabledFontColor: gray }
|
color: { r: 0.0, g: 0.0, b: 0.0, a: 0.6 }
|
||||||
},
|
},
|
||||||
ImageButtonStyle: {
|
flat-over: {
|
||||||
default: {down: button-down, up: button, over: button-over, imageDisabledColor: gray, imageUpColor: white },
|
name: white,
|
||||||
node: {up: content-background, over: content-background-over},
|
color: { hex: "#ffffff82" }
|
||||||
right: {over: button-right-over, down: button-right-down, up: button-right},
|
},
|
||||||
empty: { imageDownColor: accent, imageUpColor: white},
|
flat-down: {
|
||||||
emptytoggle: {imageCheckedColor: white, imageDownColor: white, imageUpColor: gray},
|
name: white,
|
||||||
static: {up: button },
|
color: { hex: "#ffd37fff" }
|
||||||
static-down: {up: button-down },
|
}
|
||||||
toggle: {checked: button-down, down: button-down, up: button, imageDisabledColor: gray, imageUpColor: white },
|
},
|
||||||
select: {checked: button-select, up: none },
|
ButtonStyle: {
|
||||||
clear: {down: flat-over, up: flat, over: flat-over},
|
default: {
|
||||||
clear-full: {down: white, up: button-select, over: flat-down},
|
down: button-down,
|
||||||
clear-partial: {down: flat-down, up: none, over: flat-over},
|
up: button
|
||||||
clear-toggle: {down: flat-down, checked: flat-down, up: flat, over: flat-over},
|
},
|
||||||
clear-toggle-partial: {down: flat-down, checked: flat-down, up: none, over: flat-over},
|
toggle: {
|
||||||
},
|
checked: button-down,
|
||||||
ScrollPaneStyle: {
|
down: button-down,
|
||||||
default: {vScroll: scroll, vScrollKnob: scroll-knob-vertical-black},
|
up: button
|
||||||
horizontal: {vScroll: scroll, vScrollKnob: scroll-knob-vertical-black, hScroll: scroll-horizontal, hScrollKnob: scroll-knob-horizontal-black},
|
}
|
||||||
},
|
},
|
||||||
WindowStyle: {
|
TextButtonStyle: {
|
||||||
default: {titleFont: default-font, titleFontColor: accent },
|
default: {
|
||||||
dialog: {stageBackground: dialogDim, titleFont: default-font, background: window-empty, titleFontColor: accent }
|
over: button-over,
|
||||||
},
|
disabled: button,
|
||||||
KeybindDialogStyle: {
|
font: default-font,
|
||||||
default: {keyColor: accent, keyNameColor: white, controllerColor: lightgray},
|
fontColor: white,
|
||||||
},
|
disabledFontColor: gray,
|
||||||
SliderStyle: {
|
down: button-down,
|
||||||
default-horizontal: {background: slider, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down},
|
up: button
|
||||||
default-vertical: {background: slider-vertical, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down}
|
},
|
||||||
},
|
node: {
|
||||||
LabelStyle: {
|
disabled: content-background-locked,
|
||||||
default: {font: default-font, fontColor: white },
|
font: default-font,
|
||||||
small: {font: default-font, fontColor: white }
|
fontColor: white,
|
||||||
},
|
disabledFontColor: gray,
|
||||||
TextFieldStyle: {
|
up: content-background,
|
||||||
default: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: underline, cursor: cursor, messageFont: default-font, messageFontColor: gray }
|
over: content-background-over
|
||||||
textarea: {font: default-font-chat, fontColor: white, disabledFontColor: gray, selection: selection, background: underline, cursor: cursor, messageFont: default-font, messageFontColor: gray }
|
},
|
||||||
},
|
right: {
|
||||||
CheckBoxStyle: {
|
over: button-right-over,
|
||||||
default: {checkboxOn: check-on, checkboxOff: check-off, checkboxOnOver: check-on-over, checkboxOver: check-over, font: default-font, fontColor: white, disabledFontColor: gray }
|
font: default-font,
|
||||||
}
|
fontColor: white,
|
||||||
|
disabledFontColor: gray,
|
||||||
|
down: button-right-down,
|
||||||
|
up: button-right
|
||||||
|
},
|
||||||
|
wave: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray,
|
||||||
|
up: button-edge-4
|
||||||
|
},
|
||||||
|
clear: {
|
||||||
|
over: flat-over,
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray,
|
||||||
|
down: flat-over,
|
||||||
|
up: flat
|
||||||
|
},
|
||||||
|
discord: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
up: discord-banner
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
up: info-banner
|
||||||
|
},
|
||||||
|
clear-partial: {
|
||||||
|
down: white,
|
||||||
|
up: button-select,
|
||||||
|
over: flat-down,
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray
|
||||||
|
},
|
||||||
|
clear-partial-2: {
|
||||||
|
down: flat-over,
|
||||||
|
up: none,
|
||||||
|
over: flat-over,
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray
|
||||||
|
},
|
||||||
|
empty: {
|
||||||
|
font: default-font
|
||||||
|
},
|
||||||
|
clear-toggle: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
checked: flat-down,
|
||||||
|
down: flat-down,
|
||||||
|
up: flat,
|
||||||
|
over: flat-over,
|
||||||
|
disabled: flat,
|
||||||
|
disabledFontColor: gray
|
||||||
|
}
|
||||||
|
toggle: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
checked: button-down,
|
||||||
|
down: button-down,
|
||||||
|
up: button,
|
||||||
|
over: button-over,
|
||||||
|
disabled: button,
|
||||||
|
disabledFontColor: gray
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ImageButtonStyle: {
|
||||||
|
default: {
|
||||||
|
down: button-down,
|
||||||
|
up: button,
|
||||||
|
over: button-over,
|
||||||
|
imageDisabledColor: gray,
|
||||||
|
imageUpColor: white
|
||||||
|
},
|
||||||
|
node: {
|
||||||
|
up: content-background,
|
||||||
|
over: content-background-over
|
||||||
|
},
|
||||||
|
right: {
|
||||||
|
over: button-right-over,
|
||||||
|
down: button-right-down,
|
||||||
|
up: button-right
|
||||||
|
},
|
||||||
|
empty: {
|
||||||
|
imageDownColor: accent,
|
||||||
|
imageUpColor: white
|
||||||
|
},
|
||||||
|
emptytoggle: {
|
||||||
|
imageCheckedColor: white,
|
||||||
|
imageDownColor: white,
|
||||||
|
imageUpColor: gray
|
||||||
|
},
|
||||||
|
static: {
|
||||||
|
up: button
|
||||||
|
},
|
||||||
|
static-down: {
|
||||||
|
up: button-down
|
||||||
|
},
|
||||||
|
toggle: {
|
||||||
|
checked: button-down,
|
||||||
|
down: button-down,
|
||||||
|
up: button,
|
||||||
|
imageDisabledColor: gray,
|
||||||
|
imageUpColor: white
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
checked: button-select,
|
||||||
|
up: none
|
||||||
|
},
|
||||||
|
clear: {
|
||||||
|
down: flat-over,
|
||||||
|
up: flat,
|
||||||
|
over: flat-over
|
||||||
|
},
|
||||||
|
clear-full: {
|
||||||
|
down: white,
|
||||||
|
up: button-select,
|
||||||
|
over: flat-down
|
||||||
|
},
|
||||||
|
clear-partial: {
|
||||||
|
down: flat-down,
|
||||||
|
up: none,
|
||||||
|
over: flat-over
|
||||||
|
},
|
||||||
|
clear-toggle: {
|
||||||
|
down: flat-down,
|
||||||
|
checked: flat-down,
|
||||||
|
up: flat,
|
||||||
|
over: flat-over
|
||||||
|
},
|
||||||
|
clear-toggle-partial: {
|
||||||
|
down: flat-down,
|
||||||
|
checked: flat-down,
|
||||||
|
up: none,
|
||||||
|
over: flat-over
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ScrollPaneStyle: {
|
||||||
|
default: {
|
||||||
|
vScroll: scroll,
|
||||||
|
vScrollKnob: scroll-knob-vertical-black
|
||||||
|
},
|
||||||
|
horizontal: {
|
||||||
|
vScroll: scroll,
|
||||||
|
vScrollKnob: scroll-knob-vertical-black,
|
||||||
|
hScroll: scroll-horizontal,
|
||||||
|
hScrollKnob: scroll-knob-horizontal-black
|
||||||
|
},
|
||||||
|
},
|
||||||
|
WindowStyle: {
|
||||||
|
default: {
|
||||||
|
titleFont: default-font,
|
||||||
|
titleFontColor: accent
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
stageBackground: dialogDim,
|
||||||
|
titleFont: default-font,
|
||||||
|
background: window-empty,
|
||||||
|
titleFontColor: accent
|
||||||
|
}
|
||||||
|
},
|
||||||
|
KeybindDialogStyle: {
|
||||||
|
default: {
|
||||||
|
keyColor: accent,
|
||||||
|
keyNameColor: white,
|
||||||
|
controllerColor: lightgray
|
||||||
|
},
|
||||||
|
},
|
||||||
|
SliderStyle: {
|
||||||
|
default-horizontal: {
|
||||||
|
background: slider,
|
||||||
|
knob: slider-knob,
|
||||||
|
knobOver: slider-knob-over,
|
||||||
|
knobDown: slider-knob-down
|
||||||
|
},
|
||||||
|
default-vertical: {
|
||||||
|
background: slider-vertical,
|
||||||
|
knob: slider-knob,
|
||||||
|
knobOver: slider-knob-over,
|
||||||
|
knobDown: slider-knob-down
|
||||||
|
}
|
||||||
|
},
|
||||||
|
LabelStyle: {
|
||||||
|
default: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white
|
||||||
|
},
|
||||||
|
small: {
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white
|
||||||
|
}
|
||||||
|
},
|
||||||
|
TextFieldStyle: {
|
||||||
|
default: {
|
||||||
|
font: default-font-chat,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray,
|
||||||
|
selection: selection,
|
||||||
|
background: underline,
|
||||||
|
cursor: cursor,
|
||||||
|
messageFont: default-font,
|
||||||
|
messageFontColor: gray
|
||||||
|
}
|
||||||
|
textarea: {
|
||||||
|
font: default-font-chat,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray,
|
||||||
|
selection: selection,
|
||||||
|
background: underline,
|
||||||
|
cursor: cursor,
|
||||||
|
messageFont: default-font,
|
||||||
|
messageFontColor: gray
|
||||||
|
}
|
||||||
|
},
|
||||||
|
CheckBoxStyle: {
|
||||||
|
default: {
|
||||||
|
checkboxOn: check-on,
|
||||||
|
checkboxOff: check-off,
|
||||||
|
checkboxOnOver: check-on-over,
|
||||||
|
checkboxOver: check-over,
|
||||||
|
font: default-font,
|
||||||
|
fontColor: white,
|
||||||
|
disabledFontColor: gray
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,10 @@ public class Blocks implements ContentList{
|
|||||||
playerUnmineable = true;
|
playerUnmineable = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
iceSnow = new Floor("ice-snow"){{
|
||||||
|
variants = 3;
|
||||||
|
}};
|
||||||
|
|
||||||
ice = new Floor("ice"){{
|
ice = new Floor("ice"){{
|
||||||
dragMultiplier = 0.2f;
|
dragMultiplier = 0.2f;
|
||||||
speedMultiplier = 0.4f;
|
speedMultiplier = 0.4f;
|
||||||
@@ -173,6 +177,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
holostone = new Floor("holostone"){{
|
holostone = new Floor("holostone"){{
|
||||||
hasOres = true;
|
hasOres = true;
|
||||||
|
edgeStyle = "blocky";
|
||||||
}};
|
}};
|
||||||
|
|
||||||
snow = new Floor("snow"){{
|
snow = new Floor("snow"){{
|
||||||
@@ -212,10 +217,6 @@ public class Blocks implements ContentList{
|
|||||||
variants = 3;
|
variants = 3;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
iceSnow = new Floor("iceSnow"){{
|
|
||||||
variants = 3;
|
|
||||||
}};
|
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region crafting
|
//region crafting
|
||||||
|
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ public class Block extends BlockStorage{
|
|||||||
|
|
||||||
public TextureRegion icon(Icon icon){
|
public TextureRegion icon(Icon icon){
|
||||||
if(icons[icon.ordinal()] == null){
|
if(icons[icon.ordinal()] == null){
|
||||||
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name());
|
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name(), icon == Icon.full ? getGeneratedIcons()[0] : Core.atlas.find("__error"));
|
||||||
}
|
}
|
||||||
return icons[icon.ordinal()];
|
return icons[icon.ordinal()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public class Floor extends Block{
|
|||||||
public float heat = 0f;
|
public float heat = 0f;
|
||||||
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
|
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
|
||||||
public boolean playerUnmineable = false;
|
public boolean playerUnmineable = false;
|
||||||
|
/**Style of the edge stencil. Loaded by looking up "edge-stencil-{name}".*/
|
||||||
|
public String edgeStyle = "smooth";
|
||||||
|
|
||||||
protected TextureRegion[][] edges;
|
protected TextureRegion[][] edges;
|
||||||
protected byte eq = 0;
|
protected byte eq = 0;
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ public class Generators {
|
|||||||
image.draw(region);
|
image.draw(region);
|
||||||
}
|
}
|
||||||
|
|
||||||
image.save(block.name + "-icon-full");
|
if(regions.length > 1){
|
||||||
|
image.save(block.name + "-icon-full");
|
||||||
|
}
|
||||||
|
|
||||||
for(Icon icon : Icon.values()){
|
for(Icon icon : Icon.values()){
|
||||||
if(icon.size == 0) continue;
|
if(icon.size == 0) continue;
|
||||||
@@ -157,7 +159,7 @@ public class Generators {
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
Image image = ImagePacker.get(floor.generateIcons()[0]);
|
Image image = ImagePacker.get(floor.generateIcons()[0]);
|
||||||
Image edge = ImagePacker.get("edge-stencil");
|
Image edge = ImagePacker.get("edge-stencil-" + floor.edgeStyle);
|
||||||
|
|
||||||
for(int x = 0; x < edge.width(); x++){
|
for(int x = 0; x < edge.width(); x++){
|
||||||
for(int y = 0; y < edge.height(); y++){
|
for(int y = 0; y < edge.height(); y++){
|
||||||
|
|||||||