Show where to get help.

This commit is contained in:
sk89q 2014-07-18 18:04:34 -07:00
parent ca7bb1a3f5
commit e7f65e27db
5 changed files with 22 additions and 20 deletions

View File

@ -70,3 +70,4 @@ shell-save-type:
no-double-slash: false no-double-slash: false
no-op-permissions: false no-op-permissions: false
debug: false debug: false
show-help-on-first-use: true

View File

@ -19,21 +19,17 @@
package com.sk89q.worldedit.forge; package com.sk89q.worldedit.forge;
import java.io.File;
import com.sk89q.worldedit.util.PropertiesConfiguration; import com.sk89q.worldedit.util.PropertiesConfiguration;
import java.io.File;
public class ForgeConfiguration extends PropertiesConfiguration { public class ForgeConfiguration extends PropertiesConfiguration {
public ForgeConfiguration(ForgeWorldEdit mod) { public ForgeConfiguration(ForgeWorldEdit mod) {
super(new File(mod.getWorkingDir() + File.separator + "worldedit.properties")); super(new File(mod.getWorkingDir() + File.separator + "worldedit.properties"));
} }
public void load() { @Override
super.load();
showFirstUseVersion = false;
}
public File getWorkingDirectory() { public File getWorkingDirectory() {
return ForgeWorldEdit.inst.getWorkingDir(); return ForgeWorldEdit.inst.getWorkingDir();
} }

View File

@ -19,14 +19,14 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.ItemID; import com.sk89q.worldedit.blocks.ItemID;
import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
/** /**
* Represents WorldEdit's configuration. * Represents WorldEdit's configuration.
* *
@ -108,7 +108,7 @@ public abstract class LocalConfiguration {
public Set<Integer> allowedDataCycleBlocks = new HashSet<Integer>(); public Set<Integer> allowedDataCycleBlocks = new HashSet<Integer>();
public String saveDir = "schematics"; public String saveDir = "schematics";
public String scriptsDir = "craftscripts"; public String scriptsDir = "craftscripts";
public boolean showFirstUseVersion = true; public boolean showHelpInfo = true;
public int butcherDefaultRadius = -1; public int butcherDefaultRadius = -1;
public int butcherMaxRadius = -1; public int butcherMaxRadius = -1;
public boolean allowSymlinks = false; public boolean allowSymlinks = false;

View File

@ -40,6 +40,9 @@ import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.util.formatting.ColorCodeBuilder;
import com.sk89q.worldedit.util.formatting.Style;
import com.sk89q.worldedit.util.formatting.StyledFragment;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.snapshot.Snapshot; import com.sk89q.worldedit.world.snapshot.Snapshot;
@ -582,10 +585,11 @@ public class LocalSession {
* @param player * @param player
*/ */
public void tellVersion(Actor player) { public void tellVersion(Actor player) {
if (config.showFirstUseVersion) { if (config.showHelpInfo) {
if (!beenToldVersion) { if (!beenToldVersion) {
player.printRaw("\u00A78WorldEdit ver. " + WorldEdit.getVersion() StyledFragment fragment = new StyledFragment(Style.GRAY_DARK);
+ " (http://sk89q.com/projects/worldedit/)"); fragment.append("Need help with WorldEdit? Ask us on IRC (irc.esper.net #sk89q) or on our forums @ http://forum.enginehub.org");
player.printRaw(ColorCodeBuilder.asColorCodes(fragment));
beenToldVersion = true; beenToldVersion = true;
} }
} }

View File

@ -19,15 +19,15 @@
package com.sk89q.worldedit.util; package com.sk89q.worldedit.util;
import java.io.IOException;
import java.util.HashSet;
import java.util.logging.Logger;
import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.world.snapshot.SnapshotRepository; import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
import java.io.IOException;
import java.util.HashSet;
import java.util.logging.Logger;
/** /**
* A less simple implementation of {@link LocalConfiguration} using YAML configuration files. * A less simple implementation of {@link LocalConfiguration} using YAML configuration files.
* *
@ -50,7 +50,6 @@ public class YAMLConfiguration extends LocalConfiguration {
logger.severe("Error loading WorldEdit configuration: " + e); logger.severe("Error loading WorldEdit configuration: " + e);
e.printStackTrace(); e.printStackTrace();
} }
showFirstUseVersion = false;
profile = config.getBoolean("debug", profile); profile = config.getBoolean("debug", profile);
wandItem = config.getInt("wand-item", wandItem); wandItem = config.getInt("wand-item", wandItem);
@ -109,6 +108,8 @@ public class YAMLConfiguration extends LocalConfiguration {
LocalSession.MAX_HISTORY_SIZE = Math.max(0, config.getInt("history.size", 15)); LocalSession.MAX_HISTORY_SIZE = Math.max(0, config.getInt("history.size", 15));
LocalSession.EXPIRATION_GRACE = config.getInt("history.expiration", 10) * 60 * 1000; LocalSession.EXPIRATION_GRACE = config.getInt("history.expiration", 10) * 60 * 1000;
showHelpInfo = config.getBoolean("show-help-on-first-use", true);
String snapshotsDir = config.getString("snapshots.directory", ""); String snapshotsDir = config.getString("snapshots.directory", "");
if (snapshotsDir.length() > 0) { if (snapshotsDir.length() > 0) {
snapshotRepo = new SnapshotRepository(snapshotsDir); snapshotRepo = new SnapshotRepository(snapshotsDir);