Skip to content

Commit

Permalink
Character icons in subtitles + several fixes.
Browse files Browse the repository at this point in the history
- Add snapshot repository in plugins to build.gradle
- Add arrows to ui atlas
- fix DesktopLauncher template syntax error
  • Loading branch information
bladecoder committed Aug 13, 2016
1 parent fd77cf9 commit 00ed7ec
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public static void addBuildScript(List<ProjectType> projects, BufferedWriter wr)
write(wr, "buildscript {");
// repos
write(wr, "repositories {");

// TODO: Delete when release v2.2 of roboVM plugin
write(wr, "maven { url \"https://oss.sonatype.org/content/repositories/snapshots/\" }");


write(wr, DependencyBank.mavenCentral);
if (projects.contains(ProjectType.HTML)) {
write(wr, DependencyBank.jCenter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ protected void updateModel(String property, String value) {
Ctx.project.getProjectConfig().setProperty(Config.FAST_LEAVE, value);
} else if (property.equals(Config.DEBUG_PROP)) {
Ctx.project.getProjectConfig().setProperty(Config.DEBUG_PROP, value);
} else if (property.equals(Config.CHARACTER_ICON_ATLAS)) {
Ctx.project.getProjectConfig().setProperty(Config.CHARACTER_ICON_ATLAS, value);
} else if (property.equals(Config.SHOW_DESC_PROP)) {
Ctx.project.getProjectConfig().setProperty(Config.SHOW_DESC_PROP, value);
} else if (property.equals(Config.EXTEND_VIEWPORT_PROP)) {
Expand Down Expand Up @@ -86,6 +88,8 @@ private void setProject() {
Boolean.parseBoolean(Ctx.project.getProjectConfig().getProperty(Config.DEBUG_PROP, "false")));
addProperty(Config.SHOW_DESC_PROP,
Boolean.parseBoolean(Ctx.project.getProjectConfig().getProperty(Config.SHOW_DESC_PROP, "true")));
addProperty(Config.CHARACTER_ICON_ATLAS,
Ctx.project.getProjectConfig().getProperty(Config.CHARACTER_ICON_ATLAS, ""));
addProperty(Config.EXTEND_VIEWPORT_PROP, Boolean
.parseBoolean(Ctx.project.getProjectConfig().getProperty(Config.EXTEND_VIEWPORT_PROP, "true")));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,133 +1,154 @@

ui.png
size: 523,522
size: 300,1035
format: RGBA8888
filter: Linear,Linear
repeat: none
back
rotate: false
xy: 431, 190
xy: 207, 139
size: 90, 88
orig: 120, 120
offset: 15, 16
index: -1
border_rect
rotate: false
xy: 1, 1
xy: 151, 443
size: 29, 29
split: 5, 5, 5, 5
orig: 29, 29
offset: 0, 0
index: -1
bubblepointer
rotate: false
xy: 1, 32
xy: 1, 41
size: 60, 39
orig: 60, 39
offset: 0, 0
index: -1
credits
rotate: false
xy: 1, 373
xy: 1, 886
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
debug
rotate: false
xy: 1, 223
xy: 1, 736
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
delete
rotate: false
xy: 301, 147
xy: 108, 322
size: 112, 112
orig: 112, 112
offset: 0, 0
index: -1
help
rotate: false
xy: 151, 373
xy: 151, 886
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
hotspot
rotate: false
xy: 108, 223
size: 97, 97
orig: 97, 97
offset: 0, 0
index: -1
hotspotpointer
rotate: false
xy: 1, 73
xy: 1, 586
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
inv_down
rotate: false
xy: 1, 259
size: 105, 175
orig: 105, 175
offset: 0, 0
index: -1
inv_up
rotate: false
xy: 1, 82
size: 105, 175
orig: 105, 175
offset: 0, 0
index: -1
inventory
rotate: false
xy: 301, 261
xy: 151, 474
size: 128, 110
orig: 129, 129
offset: 0, 11
index: -1
leave
rotate: false
xy: 415, 98
xy: 108, 34
size: 94, 90
orig: 94, 90
offset: 0, 0
index: -1
lookat
rotate: false
xy: 151, 223
xy: 151, 736
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
menu
rotate: false
xy: 451, 438
xy: 222, 389
size: 63, 83
orig: 123, 123
offset: 30, 19
index: -1
pickup
rotate: false
xy: 301, 373
xy: 1, 436
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
plus
rotate: false
xy: 431, 280
xy: 207, 229
size: 91, 91
orig: 91, 91
offset: 0, 0
index: -1
pointer
rotate: false
xy: 301, 50
xy: 108, 126
size: 95, 95
orig: 95, 95
offset: 0, 0
index: -1
rect
rotate: false
xy: 451, 405
xy: 1, 1
size: 31, 31
split: 5, 5, 5, 4
orig: 31, 31
offset: 0, 0
index: -1
talkto
rotate: false
xy: 151, 73
xy: 151, 586
size: 148, 148
orig: 148, 148
offset: 0, 0
index: -1
white_pixel
rotate: false
xy: 516, 518
xy: 281, 581
size: 3, 3
orig: 3, 3
offset: 0, 0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public class DesktopLauncher extends BladeEngine {
"-d\tShow debug messages\n" +
"-res width\tForce the resolution width\n" +
"-l game_state\tLoad the previusly saved game state\n" +
"-r\tRun the game from the begining\n"
"-r\tRun the game from the begining\n" +
"-aspect aspect_ratio\tSets the specified screen aspect (16:9, 4:3, 16:10)\n"
);

Expand Down
2 changes: 1 addition & 1 deletion adventure-editor/src/main/resources/versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Autogenerated by build.gradle
#Fri Aug 12 15:39:12 CEST 2016
#Fri Aug 12 21:31:06 CEST 2016
roboVMVersion=2.1.0
gwtVersion=2.6.0
libgdxVersion=1.9.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.bladecoder.engine.model.TextManager;
import com.bladecoder.engine.model.VerbRunner;
import com.bladecoder.engine.model.World;
import com.bladecoder.engine.util.EngineLogger;

@ActionDescription("Shows the text and sets the player to lookat in the selected actor direction")
public class LookAtAction implements Action {
Expand Down Expand Up @@ -64,7 +63,7 @@ public String getDirection() {
@Override
public boolean run(VerbRunner cb) {

EngineLogger.debug("LOOKAT ACTION");
// EngineLogger.debug("LOOKAT ACTION");
InteractiveActor a = (InteractiveActor) World.getInstance().getCurrentScene().getActor(actor, true);

if (World.getInstance().getInventory().getItem(actor) == null) {
Expand All @@ -79,8 +78,10 @@ else if (a != null && player != null) {
}

if (text != null) {
String actorId = World.getInstance().getCurrentScene().getPlayer() != null? World.getInstance().getCurrentScene().getPlayer().getId():null;

World.getInstance().getTextManager().addText(text, TextManager.POS_SUBTITLE, TextManager.POS_SUBTITLE,
false, Text.Type.SUBTITLE, null, null, wait ? cb : null);
false, Text.Type.SUBTITLE, null, null, actorId, wait ? cb : null);

return wait;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean run(VerbRunner cb) {
}

World.getInstance().getTextManager().addText(text, x, y, queue, type, color, null,
this);
a.getId(), this);
}

return getWait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean run(VerbRunner cb) {
float y = boundingRectangle.getY() + boundingRectangle.getHeight();

w.getTextManager().addText(playerText, x, y, false,
Text.Type.TALK, player.getTextColor(), null, this);
Text.Type.TALK, player.getTextColor(), null, player.getId(), this);

startTalkAnim(player);

Expand Down Expand Up @@ -104,7 +104,7 @@ public void resume() {

World.getInstance().getTextManager().addText(responseText, x,
y, false, Text.Type.TALK,
((CharacterActor) actor).getTextColor(), null, this);
((CharacterActor) actor).getTextColor(), null, actor.getId(), this);


if(actor instanceof CharacterActor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean run(VerbRunner cb) {
}

World.getInstance().getTextManager()
.addText(text, x, y, queue, type, color, style, wait?cb:null);
.addText(text, x, y, queue, type, color, style, null, wait?cb:null);
}

return wait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public AtlasRegion getRegion(String atlas, String name) {
AtlasRegion region = a.findRegion(name);

if (region == null) {
EngineLogger.error("Region " + name + " not found in atlas " + atlas);
EngineLogger.debug("Region " + name + " not found in atlas " + atlas);
}

return region;
Expand Down
6 changes: 5 additions & 1 deletion blade-engine/src/com/bladecoder/engine/model/Text.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ public enum Type {
public Color color;
public String style;
private ActionCallback cb;
public String actorId;

public Text() {
}

public Text(String str, float x, float y, float time, Type type, Color color, String style, ActionCallback cb) {
public Text(String str, float x, float y, float time, Type type, Color color, String style, String actorId, ActionCallback cb) {
this.str = str;
this.x = x;
this.y = y;
Expand All @@ -51,6 +52,7 @@ public Text(String str, float x, float y, float time, Type type, Color color, St
this.color = color;
this.style = style;
this.cb = cb;
this.actorId = actorId;

// 0s -> Auto duration
// <0 -> Infinity
Expand All @@ -77,6 +79,7 @@ public void write(Json json) {
json.writeValue("type", type);
json.writeValue("color", color);
json.writeValue("style", style);
json.writeValue("actorId", actorId);
json.writeValue("cb", ActionCallbackSerialization.find(cb), cb == null ? null
: String.class);
}
Expand All @@ -90,6 +93,7 @@ public void read (Json json, JsonValue jsonData) {
type = json.readValue("type", Type.class, jsonData);
color = json.readValue("color", Color.class, jsonData);
style = json.readValue("style", String.class, jsonData);
actorId = json.readValue("actorId", String.class, jsonData);
String cbSer = json.readValue("cb", String.class, jsonData);
if(cbSer != null)
cb = ActionCallbackSerialization.find(cbSer);
Expand Down
6 changes: 3 additions & 3 deletions blade-engine/src/com/bladecoder/engine/model/TextManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public TextManager() {
}

public void addText(String str, float x, float y, boolean quee, Text.Type type,
Color color, String font, ActionCallback cb) {
Color color, String font, String actorId, ActionCallback cb) {

if(str.charAt(0) == I18N.PREFIX)
str = I18N.getString(str.substring(1));
Expand Down Expand Up @@ -81,9 +81,9 @@ public void addText(String str, float x, float y, boolean quee, Text.Type type,
Text sub;

if (i != text.length - 1) {
sub = new Text(finalStr, x, y, duration, type, color, font, null);
sub = new Text(finalStr, x, y, duration, type, color, font, actorId, null);
} else {
sub = new Text(finalStr, x, y, duration, type, color, font, cb);
sub = new Text(finalStr, x, y, duration, type, color, font, actorId, cb);
}

fifo.add(sub);
Expand Down
Loading

0 comments on commit 00ed7ec

Please sign in to comment.