mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-02-23 15:38:23 +01:00
extract linkIcon
This commit is contained in:
@@ -30,7 +30,12 @@ public final class Common {
|
|||||||
linkConditions(effect.conditions_source, proj, backlink);
|
linkConditions(effect.conditions_source, proj, backlink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void linkIcon(Project proj, String iconId, GameDataElement backlink) {
|
||||||
|
if (iconId != null) {
|
||||||
|
String spritesheetId = iconId.split(":")[0];
|
||||||
|
proj.getSpritesheet(spritesheetId).addBacklink(backlink);
|
||||||
|
}
|
||||||
|
}
|
||||||
public static class TimedActorConditionEffect extends ActorConditionEffect {
|
public static class TimedActorConditionEffect extends ActorConditionEffect {
|
||||||
//Available from parsed state
|
//Available from parsed state
|
||||||
public Integer duration = null;
|
public Integer duration = null;
|
||||||
|
|||||||
@@ -216,10 +216,7 @@ public class Item extends JSONElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.icon_id != null) {
|
linkIcon(proj, this.icon_id, this);
|
||||||
String spritesheetId = this.icon_id.split(":")[0];
|
|
||||||
proj.getSpritesheet(spritesheetId).addBacklink(this);
|
|
||||||
}
|
|
||||||
if (this.category_id != null) this.category = proj.getItemCategory(this.category_id);
|
if (this.category_id != null) this.category = proj.getItemCategory(this.category_id);
|
||||||
if (this.category != null) this.category.addBacklink(this);
|
if (this.category != null) this.category.addBacklink(this);
|
||||||
if (this.equip_effect != null && this.equip_effect.conditions != null) {
|
if (this.equip_effect != null && this.equip_effect.conditions != null) {
|
||||||
@@ -232,6 +229,7 @@ public class Item extends JSONElement {
|
|||||||
this.state = State.linked;
|
this.state = State.linked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image getIcon() {
|
public Image getIcon() {
|
||||||
return getProject().getIcon(icon_id);
|
return getProject().getIcon(icon_id);
|
||||||
|
|||||||
@@ -219,11 +219,7 @@ public class NPC extends JSONElement {
|
|||||||
Notification.addError("Error linking item " + id + ". No parent project found.");
|
Notification.addError("Error linking item " + id + ". No parent project found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.icon_id != null) {
|
linkIcon(proj, this.icon_id, this);
|
||||||
String spritesheetId = this.icon_id.split(":")[0];
|
|
||||||
proj.getSpritesheet(spritesheetId).addBacklink(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.dialogue_id != null) this.dialogue = proj.getDialogue(this.dialogue_id);
|
if (this.dialogue_id != null) this.dialogue = proj.getDialogue(this.dialogue_id);
|
||||||
if (this.dialogue != null) this.dialogue.addBacklink(this);
|
if (this.dialogue != null) this.dialogue.addBacklink(this);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user