48 lines
1.1 KiB
Java
48 lines
1.1 KiB
Java
package com.discord.utilities.textprocessing.node;
|
|
|
|
import com.PatchConfig;
|
|
import com.discord.simpleast.core.node.Node;
|
|
import com.discordtest.BuildConfig;
|
|
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import lanchon.dexpatcher.annotation.DexEdit;
|
|
import lanchon.dexpatcher.annotation.DexIgnore;
|
|
import lanchon.dexpatcher.annotation.DexWrap;
|
|
|
|
@DexEdit
|
|
public final class SpoilerNode<T extends SpoilerNode.RenderContext> extends Node<T> implements Spoilerable {
|
|
|
|
// nospoiler patch
|
|
|
|
@DexIgnore
|
|
private boolean isRevealed;
|
|
|
|
@DexWrap
|
|
public boolean isRevealed() {
|
|
if (!PatchConfig.NOSPOILER_ENABLED) {
|
|
// Patch not enabled
|
|
return isRevealed();
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// end of nospoiler patch
|
|
|
|
// class setup stuff
|
|
|
|
@DexIgnore
|
|
public interface RenderContext extends BasicRenderContext {
|
|
@DexIgnore
|
|
int getSpoilerColorRes();
|
|
|
|
@DexIgnore
|
|
Function1<SpoilerNode<?>, Unit> getSpoilerOnClick();
|
|
|
|
@DexIgnore
|
|
int getSpoilerRevealedColorRes();
|
|
}
|
|
|
|
}
|