Index: /java/ProgramSettings/.classpath
===================================================================
--- /java/ProgramSettings/.classpath	(revision 726)
+++ /java/ProgramSettings/.classpath	(revision 726)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="lib" path="/ThirdPartyLibs/xstream-1.4.3.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /java/ProgramSettings/.project
===================================================================
--- /java/ProgramSettings/.project	(revision 726)
+++ /java/ProgramSettings/.project	(revision 726)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ProgramSettings</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /java/ProgramSettings/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /java/ProgramSettings/.settings/org.eclipse.jdt.core.prefs	(revision 726)
+++ /java/ProgramSettings/.settings/org.eclipse.jdt.core.prefs	(revision 726)
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Index: /java/ProgramSettings/src/net/oni2/SettingsManager.java
===================================================================
--- /java/ProgramSettings/src/net/oni2/SettingsManager.java	(revision 726)
+++ /java/ProgramSettings/src/net/oni2/SettingsManager.java	(revision 726)
@@ -0,0 +1,239 @@
+package net.oni2;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashMap;
+
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.StaxDriver;
+
+/**
+ * Manages and stores programm settings
+ * 
+ * @author Christian Illy
+ */
+public class SettingsManager implements Serializable {
+
+	private static final long serialVersionUID = 8067725289301601179L;
+
+	private static SettingsManager instance = new SettingsManager();
+
+	private static boolean debugRun = false;
+
+	private HashMap<String, Object> prefs = new HashMap<String, Object>();
+
+	private boolean printNamesNotInMap = false;
+
+	private boolean offlineMode = false;
+	private boolean noCacheUpdate = false;
+
+	/**
+	 * Get the singleton instance
+	 * 
+	 * @return Singleton instance
+	 */
+	public static SettingsManager getInstance() {
+		return instance;
+	}
+
+	/**
+	 * @param debug
+	 *            Debug mode
+	 */
+	public static void setDebug(boolean debug) {
+		debugRun = debug;
+	}
+
+	/**
+	 * @return Is debug run
+	 */
+	public static boolean isDebug() {
+		return debugRun;
+	}
+
+	/**
+	 * @return Is offline?
+	 */
+	public boolean isOfflineMode() {
+		return offlineMode;
+	}
+
+	/**
+	 * @param offline
+	 *            Is offline?
+	 */
+	public void setOfflineMode(boolean offline) {
+		this.offlineMode = offline;
+	}
+
+	/**
+	 * @return Is in noCacheUpdate mode?
+	 */
+	public boolean isNoCacheUpdateMode() {
+		return noCacheUpdate;
+	}
+
+	/**
+	 * @param noCacheUpdate
+	 *            Is in noCacheUpdate mode?
+	 */
+	public void setNoCacheUpdateMode(boolean noCacheUpdate) {
+		this.noCacheUpdate = noCacheUpdate;
+	}
+
+	private static XStream getXStream() {
+		XStream xs = new XStream(new StaxDriver());
+		xs.alias("Settings", SettingsManager.class);
+		return xs;
+	}
+
+	/**
+	 * Serializes the settings to disk
+	 * 
+	 * @param settingsFile
+	 *            File to write to
+	 */
+	public void serializeToFile(File settingsFile) {
+		try {
+			FileOutputStream fos = new FileOutputStream(settingsFile);
+			XStream xs = getXStream();
+			xs.toXML(this, fos);
+			fos.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Deserializes the settings from disk
+	 * 
+	 * @param settingsFile
+	 *            File to read from
+	 */
+	public static void deserializeFromFile(File settingsFile) {
+		try {
+			FileInputStream fis = new FileInputStream(settingsFile);
+			XStream xs = getXStream();
+			Object obj = xs.fromXML(fis);
+			if (obj instanceof SettingsManager)
+				instance = (SettingsManager) obj;
+			fis.close();
+		} catch (FileNotFoundException e) {
+		} catch (IOException e) {
+		}
+	}
+
+	/**
+	 * Put a string value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param value
+	 *            Value
+	 */
+	public void put(String key, String value) {
+		prefs.put(key, value);
+	}
+
+	/**
+	 * Put a boolean value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param value
+	 *            Value
+	 */
+	public void put(String key, boolean value) {
+		prefs.put(key, value);
+	}
+
+	/**
+	 * Put a int value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param value
+	 *            Value
+	 */
+	public void put(String key, int value) {
+		prefs.put(key, value);
+	}
+
+	/**
+	 * Get a string value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param def
+	 *            Default return value if key does not exist
+	 * @return Value
+	 */
+	public String get(String key, String def) {
+		if (prefs.containsKey(key)) {
+			if (prefs.get(key) instanceof String)
+				return (String) (prefs.get(key));
+		}
+		if (printNamesNotInMap)
+			System.out.println("Settings: Key \"" + key
+					+ "\" not in Map, defaulting to \"" + def + "\".");
+		return def;
+	}
+
+	/**
+	 * Get a boolean value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param def
+	 *            Default return value if key does not exist
+	 * @return Value
+	 */
+	public Boolean get(String key, Boolean def) {
+		if (prefs.containsKey(key)) {
+			if (prefs.get(key) instanceof Boolean)
+				return (Boolean) (prefs.get(key));
+		}
+		if (printNamesNotInMap)
+			System.out.println("Settings: Key \"" + key
+					+ "\" not in Map, defaulting to \"" + def + "\".");
+		return def;
+	}
+
+	/**
+	 * Get a int value
+	 * 
+	 * @param key
+	 *            Key for value
+	 * @param def
+	 *            Default return value if key does not exist
+	 * @return Value
+	 */
+	public int get(String key, int def) {
+		if (prefs.containsKey(key)) {
+			if (prefs.get(key) instanceof Integer)
+				return (Integer) (prefs.get(key));
+		}
+		if (printNamesNotInMap)
+			System.out.println("Settings: Key \"" + key
+					+ "\" not in Map, defaulting to \"" + def + "\".");
+		return def;
+	}
+
+	/**
+	 * Remove a value
+	 * 
+	 * @param key
+	 *            Key to value to remove
+	 */
+	public void removeValue(String key) {
+		prefs.remove(key);
+	}
+
+}
