Make hiding details optional (#5871)
* Make hiding details optional * Sandbox blocks shouldn't have their details hidden.
This commit is contained in:
@@ -27,6 +27,8 @@ public abstract class UnlockableContent extends MappableContent{
|
|||||||
public boolean alwaysUnlocked = false;
|
public boolean alwaysUnlocked = false;
|
||||||
/** Whether to show the description in the research dialog preview. */
|
/** Whether to show the description in the research dialog preview. */
|
||||||
public boolean inlineDescription = true;
|
public boolean inlineDescription = true;
|
||||||
|
/** Whether details of blocks are hidden in custom games if they haven't been unlocked in campaign mode. */
|
||||||
|
public boolean hideDetails = true;
|
||||||
/** Special logic icon ID. */
|
/** Special logic icon ID. */
|
||||||
public int iconId = 0;
|
public int iconId = 0;
|
||||||
/** Icon of the content to use in UI. */
|
/** Icon of the content to use in UI. */
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class ContentInfoDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(content.details != null){
|
if(content.details != null){
|
||||||
table.add("[gray]" + (content.unlocked() ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX();
|
table.add("[gray]" + (content.unlocked() || !content.hideDetails ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -847,6 +847,10 @@ public class Block extends UnlockableContent{
|
|||||||
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
||||||
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(buildVisibility == BuildVisibility.sandboxOnly){
|
||||||
|
hideDetails = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user