Added implementation for identifier as effect icon
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.saturnclient.common.ref.game;
|
package org.saturnclient.common.ref.game;
|
||||||
|
|
||||||
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
import org.saturnclient.common.ref.asset.SpriteRef;
|
import org.saturnclient.common.ref.asset.SpriteRef;
|
||||||
|
|
||||||
public interface EffectRef {
|
public interface EffectRef {
|
||||||
@@ -7,6 +8,10 @@ public interface EffectRef {
|
|||||||
|
|
||||||
SpriteRef getIcon();
|
SpriteRef getIcon();
|
||||||
|
|
||||||
|
default IdentifierRef getIconId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
boolean isInfinite();
|
boolean isInfinite();
|
||||||
|
|
||||||
String getInfiniteText();
|
String getInfiniteText();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.saturnclient.common.provider.FeatureProvider;
|
import org.saturnclient.common.provider.FeatureProvider;
|
||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
|
import org.saturnclient.common.ref.asset.SpriteRef;
|
||||||
import org.saturnclient.common.ref.game.EffectRef;
|
import org.saturnclient.common.ref.game.EffectRef;
|
||||||
import org.saturnclient.config.property.BoolProperty;
|
import org.saturnclient.config.property.BoolProperty;
|
||||||
import org.saturnclient.config.property.Property;
|
import org.saturnclient.config.property.Property;
|
||||||
@@ -63,7 +64,12 @@ public class StatusEffectsMod extends Mod implements HudMod {
|
|||||||
if (!effect.shouldShowIcon())
|
if (!effect.shouldShowIcon())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
scope.drawSpriteStretched(effect.getIcon(), 0, 18 * row, 16, 16);
|
SpriteRef sprite = effect.getIcon();
|
||||||
|
if (sprite == null) {
|
||||||
|
scope.drawTexture(effect.getIconId(), 0, 18 * row, 0, 0, 16, 16);
|
||||||
|
} else {
|
||||||
|
scope.drawSpriteStretched(sprite, 0, 18 * row, 16, 16);
|
||||||
|
}
|
||||||
scope.drawText(0.5f, durationString(effect),
|
scope.drawText(0.5f, durationString(effect),
|
||||||
18, 18 * row + 3,
|
18, 18 * row + 3,
|
||||||
layout.font.value, -1);
|
layout.font.value, -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user