Fixed some messed-up objectives

This commit is contained in:
Anuken 2022-07-15 16:56:34 -04:00
parent 9a505753b0
commit 926cf7e0fa
5 changed files with 20 additions and 9 deletions

Binary file not shown.

View File

@ -42,7 +42,12 @@ public class MapObjectivesDialog extends BaseDialog{
setProvider(String.class, (type, cons) -> cons.get(""));
setInterpreter(String.class, (cont, name, type, field, remover, indexer, get, set) -> {
name(cont, name, remover, indexer);
cont.area(get.get(), set).growX();
if(field != null && field.isAnnotationPresent(Multiline.class)){
cont.area(get.get(), set).height(85f).growX();
}else{
cont.field(get.get(), set).growX();
}
});
setProvider(boolean.class, (type, cons) -> cons.get(false));

View File

@ -160,7 +160,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
/** Base abstract class for any in-map objective. */
public static abstract class MapObjective{
public @Nullable String details;
public @Nullable @Multiline String details;
public @Unordered String[] flagsAdded = {};
public @Unordered String[] flagsRemoved = {};
public ObjectiveMarker[] markers = {};
@ -428,7 +428,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
}
public static class TimerObjective extends MapObjective{
public String text;
public @Multiline String text;
public @Second float duration = 60f * 30f;
protected float countup;
@ -555,7 +555,8 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
/** Wait until a logic flag is set. */
public static class FlagObjective extends MapObjective{
public String flag = "flag", text;
public String flag = "flag";
public @Multiline String text;
public FlagObjective(String flag, String text){
this.flag = flag;
@ -611,7 +612,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
/** Displays text above a shape. */
public static class ShapeTextMarker extends ObjectiveMarker{
public String text = "frog";
public @Multiline String text = "frog";
public @TilePos Vec2 pos = new Vec2();
public float fontSize = 1f, textHeight = 7f;
public @LabelFlag byte flags = WorldLabel.flagBackground | WorldLabel.flagOutline;
@ -748,7 +749,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
/** Displays text at a location. */
public static class TextMarker extends ObjectiveMarker{
public String text = "uwu";
public @Multiline String text = "uwu";
public @TilePos Vec2 pos = new Vec2();
public float fontSize = 1f;
public @LabelFlag byte flags = WorldLabel.flagBackground | WorldLabel.flagOutline;
@ -799,6 +800,11 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
@Retention(RUNTIME)
public @interface Synthetic{}
/** For {@link String}; indicates that a text area should be used. */
@Target(FIELD)
@Retention(RUNTIME)
public @interface Multiline{}
/** For {@code float}; multiplies the UI input by 60. */
@Target(FIELD)
@Retention(RUNTIME)

View File

@ -48,8 +48,8 @@ public class BlockRenderer{
private IntSet darkEvents = new IntSet();
private IntSet procLinks = new IntSet(), procLights = new IntSet();
private BlockQuadtree blockTree;
private FloorQuadtree floorTree;
private BlockQuadtree blockTree = new BlockQuadtree(new Rect(0, 0, 1, 1));
private FloorQuadtree floorTree = new FloorQuadtree(new Rect(0, 0, 1, 1));
public BlockRenderer(){

View File

@ -782,7 +782,7 @@ public class HudFragment{
String text = obj.text();
if(text != null){
if(!first) builder.append('\n');
if(!first) builder.append("\n[white]");
builder.append(text);
first = false;