Customizable edge stencil / Reduced redundant sprites
@@ -107,10 +107,10 @@ public class StructAnnotationProcessor extends AbstractProcessor{
|
||||
getter.addStatement("return ($L & (1L << $L)) != 0", structParam, offset);
|
||||
}else if(varType == TypeName.FLOAT){
|
||||
//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{
|
||||
//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]
|
||||
|
||||
|
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: {
|
||||
black: {a: 1, b: 0, g: 0, r: 0 },
|
||||
white: {a: 1, b: 1, g: 1, r: 1 },
|
||||
gray: {a: 1, b: 0.32, g: 0.32, r: 0.32 },
|
||||
lightgray: {a: 1, b: 0.65, g: 0.65, r: 0.65 }
|
||||
orange: {hex: "FFA500"},
|
||||
accent: {hex: "ffd37f"}
|
||||
},
|
||||
TintedDrawable: {
|
||||
dialogDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.9} },
|
||||
invis: {name: white, color: {r: 0, g: 0, b: 0, a: 0} }
|
||||
loadDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.8} },
|
||||
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
|
||||
dark: {name: white, color: {hex: "#000000ff"}},
|
||||
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}},
|
||||
flat: {name: white, color: {r: 0.0, g: 0.0, b: 0.0, a: 0.6}},
|
||||
flat-over: {name: white, color: { hex: "#ffffff82" }},
|
||||
flat-down: {name: white, color: { hex: "#ffd37fff" }}
|
||||
},
|
||||
ButtonStyle: {
|
||||
default: {down: button-down, up: button },
|
||||
toggle: {checked: button-down, down: button-down, up: button }
|
||||
},
|
||||
TextButtonStyle: {
|
||||
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},
|
||||
right: {over: button-right-over, 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 }
|
||||
}
|
||||
Color: {
|
||||
black: { a: 1, b: 0, g: 0, r: 0 },
|
||||
white: { a: 1, b: 1, g: 1, r: 1 },
|
||||
gray: { a: 1, b: 0.32, g: 0.32, r: 0.32 },
|
||||
lightgray: { a: 1, b: 0.65, g: 0.65, r: 0.65 }
|
||||
orange: { hex: "FFA500" },
|
||||
accent: { hex: "ffd37f" }
|
||||
},
|
||||
TintedDrawable: {
|
||||
dialogDim: {
|
||||
name: white,
|
||||
color: { r: 0, g: 0, b: 0, a: 0.9 }
|
||||
},
|
||||
invis: {
|
||||
name: white,
|
||||
color: { r: 0, g: 0, b: 0, a: 0 }
|
||||
}
|
||||
loadDim: {
|
||||
name: white,
|
||||
color: { r: 0, g: 0, b: 0, a: 0.8 }
|
||||
},
|
||||
chatfield: {
|
||||
name: white,
|
||||
color: { r: 0, g: 0, b: 0, a: 0.2 }
|
||||
},
|
||||
dark: {
|
||||
name: white,
|
||||
color: { hex: "#000000ff" }
|
||||
},
|
||||
none: {
|
||||
name: white,
|
||||
color: { r: 0, g: 0, b: 0, a: 0 }
|
||||
},
|
||||
flat: {
|
||||
name: white,
|
||||
color: { r: 0.0, g: 0.0, b: 0.0, a: 0.6 }
|
||||
},
|
||||
flat-over: {
|
||||
name: white,
|
||||
color: { hex: "#ffffff82" }
|
||||
},
|
||||
flat-down: {
|
||||
name: white,
|
||||
color: { hex: "#ffd37fff" }
|
||||
}
|
||||
},
|
||||
ButtonStyle: {
|
||||
default: {
|
||||
down: button-down,
|
||||
up: button
|
||||
},
|
||||
toggle: {
|
||||
checked: button-down,
|
||||
down: button-down,
|
||||
up: button
|
||||
}
|
||||
},
|
||||
TextButtonStyle: {
|
||||
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
|
||||
},
|
||||
right: {
|
||||
over: button-right-over,
|
||||
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;
|
||||
}};
|
||||
|
||||
iceSnow = new Floor("ice-snow"){{
|
||||
variants = 3;
|
||||
}};
|
||||
|
||||
ice = new Floor("ice"){{
|
||||
dragMultiplier = 0.2f;
|
||||
speedMultiplier = 0.4f;
|
||||
@@ -173,6 +177,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
holostone = new Floor("holostone"){{
|
||||
hasOres = true;
|
||||
edgeStyle = "blocky";
|
||||
}};
|
||||
|
||||
snow = new Floor("snow"){{
|
||||
@@ -212,10 +217,6 @@ public class Blocks implements ContentList{
|
||||
variants = 3;
|
||||
}};
|
||||
|
||||
iceSnow = new Floor("iceSnow"){{
|
||||
variants = 3;
|
||||
}};
|
||||
|
||||
//endregion
|
||||
//region crafting
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ public class Block extends BlockStorage{
|
||||
|
||||
public TextureRegion icon(Icon icon){
|
||||
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()];
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ public class Floor extends Block{
|
||||
public float heat = 0f;
|
||||
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
|
||||
public boolean playerUnmineable = false;
|
||||
/**Style of the edge stencil. Loaded by looking up "edge-stencil-{name}".*/
|
||||
public String edgeStyle = "smooth";
|
||||
|
||||
protected TextureRegion[][] edges;
|
||||
protected byte eq = 0;
|
||||
|
||||
@@ -34,7 +34,9 @@ public class Generators {
|
||||
image.draw(region);
|
||||
}
|
||||
|
||||
image.save(block.name + "-icon-full");
|
||||
if(regions.length > 1){
|
||||
image.save(block.name + "-icon-full");
|
||||
}
|
||||
|
||||
for(Icon icon : Icon.values()){
|
||||
if(icon.size == 0) continue;
|
||||
@@ -157,7 +159,7 @@ public class Generators {
|
||||
|
||||
try{
|
||||
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 y = 0; y < edge.height(); y++){
|
||||
|
||||