Permalink
Browse files

Completed switch from old to new config system.

Changed config load process to apply a delta over the default config, so missing values are restored.
  • Loading branch information...
1 parent da99110 commit 635e5be05d024e2308ece65aebbe383eab323a77 @immortius immortius committed Feb 16, 2013
Showing with 1,257 additions and 8,083 deletions.
  1. +3 −0 .gitignore
  2. +4 −5 src/main/java/org/terasology/audio/openAL/OpenALManager.java
  3. +10 −9 src/main/java/org/terasology/componentSystem/controllers/DebugControlSystem.java
  4. +77 −53 src/main/java/org/terasology/componentSystem/controllers/LocalPlayerSystem.java
  5. +1 −1 src/main/java/org/terasology/config/{SoundConfig.java → AudioConfig.java}
  6. +254 −0 src/main/java/org/terasology/config/BindsConfig.java
  7. +88 −12 src/main/java/org/terasology/config/Config.java
  8. +9 −240 src/main/java/org/terasology/config/InputConfig.java
  9. +293 −0 src/main/java/org/terasology/config/RenderingConfig.java
  10. +52 −0 src/main/java/org/terasology/config/SystemConfig.java
  11. +74 −0 src/main/java/org/terasology/config/WorldGenerationConfig.java
  12. +27 −25 src/main/java/org/terasology/game/TerasologyEngine.java
  13. +9 −9 src/main/java/org/terasology/game/modes/loadProcesses/RegisterInputSystem.java
  14. +6 −4 src/main/java/org/terasology/input/InputSystem.java
  15. +11 −7 src/main/java/org/terasology/logic/commands/Commands.java
  16. +0 −558 src/main/java/org/terasology/logic/manager/Config.java
  17. +1 −1 src/main/java/org/terasology/logic/manager/PathManager.java
  18. +76 −50 src/main/java/org/terasology/logic/manager/PostProcessingRenderer.java
  19. +0 −10 src/main/java/org/terasology/logic/mod/ModManager.java
  20. +0 −6,731 src/main/java/org/terasology/protobuf/Configuration.java
  21. +25 −25 src/main/java/org/terasology/rendering/assets/Shader.java
  22. +9 −9 src/main/java/org/terasology/rendering/cameras/Camera.java
  23. +15 −10 src/main/java/org/terasology/rendering/gui/dialogs/UIDialogCreateNewWorld.java
  24. +1 −1 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigAdvanced.java
  25. +3 −3 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigAudio.java
  26. +24 −22 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigControls.java
  27. +76 −83 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigVideo.java
  28. +5 −5 src/main/java/org/terasology/rendering/gui/windows/UIMenuSingleplayer.java
  29. +9 −6 src/main/java/org/terasology/rendering/gui/windows/UIScreenHUD.java
  30. +6 −6 src/main/java/org/terasology/rendering/shader/ShaderParametersBase.java
  31. +6 −6 src/main/java/org/terasology/rendering/shader/ShaderParametersChunk.java
  32. +6 −8 src/main/java/org/terasology/rendering/shader/ShaderParametersPost.java
  33. +6 −5 src/main/java/org/terasology/rendering/shader/ShaderParametersPrePost.java
  34. +4 −5 src/main/java/org/terasology/rendering/world/ChunkUpdateManager.java
  35. +11 −16 src/main/java/org/terasology/rendering/world/WorldRenderer.java
  36. +3 −2 src/main/java/org/terasology/world/MiniatureChunk.java
  37. +3 −12 src/main/java/org/terasology/world/WorldProviderCoreImpl.java
  38. +34 −36 src/main/java/org/terasology/world/chunks/Chunk.java
  39. +4 −4 src/main/java/org/terasology/world/chunks/Chunks.java
  40. +1 −1 src/main/java/org/terasology/world/chunks/LocalChunkProvider.java
  41. +11 −14 src/main/java/org/terasology/world/generator/core/FloraGenerator.java
  42. +0 −89 src/main/protobuf/Config2.proto
View
@@ -18,9 +18,12 @@
/bin
/data/console/consolelog.json
/mods/*/classes
+/mods/*/testClasses
/mods/*/build
/mods/*/.*
*~
+config.cfg
+entityDump.txt
# Ignore error logs
*.log
@@ -28,9 +28,8 @@
import org.slf4j.LoggerFactory;
import org.terasology.audio.Sound;
import org.terasology.audio.AudioManager;
-import org.terasology.config.SoundConfig;
+import org.terasology.config.AudioConfig;
import org.terasology.math.Direction;
-import org.terasology.math.Side;
import javax.vecmath.Quat4f;
import javax.vecmath.Vector3f;
@@ -57,15 +56,15 @@
private PropertyChangeListener configListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getPropertyName().equals(SoundConfig.MUSIC_VOLUME)) {
+ if (evt.getPropertyName().equals(AudioConfig.MUSIC_VOLUME)) {
setMusicVolume((Float)evt.getNewValue());
- } else if (evt.getPropertyName().equals(SoundConfig.SOUND_VOLUME)) {
+ } else if (evt.getPropertyName().equals(AudioConfig.SOUND_VOLUME)) {
setSoundVolume((Float)evt.getNewValue());
}
}
};
- public OpenALManager(SoundConfig config) {
+ public OpenALManager(AudioConfig config) {
logger.info("Initializing OpenAL audio manager");
config.subscribe(configListener);
try {
@@ -19,19 +19,18 @@
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.terasology.components.LocalPlayerComponent;
+import org.terasology.config.Config;
import org.terasology.entitySystem.EntityRef;
import org.terasology.entitySystem.EventHandlerSystem;
import org.terasology.entitySystem.In;
import org.terasology.entitySystem.ReceiveEvent;
import org.terasology.entitySystem.RegisterComponentSystem;
import org.terasology.events.DamageEvent;
+import org.terasology.game.CoreRegistry;
import org.terasology.game.TerasologyEngine;
import org.terasology.input.events.KeyDownEvent;
import org.terasology.input.events.KeyEvent;
-import org.terasology.game.CoreRegistry;
-import org.terasology.logic.manager.Config;
import org.terasology.logic.manager.GUIManager;
-import org.terasology.logic.manager.ShaderManager;
import org.terasology.rendering.gui.framework.UIDisplayElement;
import org.terasology.rendering.gui.windows.UIScreenMetrics;
import org.terasology.rendering.world.WorldRenderer;
@@ -50,6 +49,8 @@
private WorldProvider world;
@In
private WorldRenderer worldRenderer;
+ @In
+ private Config config;
@Override
public void initialise() {
@@ -61,7 +62,7 @@ public void shutdown() {
@ReceiveEvent(components = LocalPlayerComponent.class)
public void onKeyEvent(KeyEvent event, EntityRef entity) {
- boolean debugEnabled = Config.getInstance().isDebug();
+ boolean debugEnabled = config.getSystem().isDebugEnabled();
// Features for debug mode only
if (debugEnabled && event.isDown()) {
switch (event.getKey()) {
@@ -87,7 +88,7 @@ public void onKeyEvent(KeyEvent event, EntityRef entity) {
@ReceiveEvent(components = LocalPlayerComponent.class)
public void onKeyDown(KeyDownEvent event, EntityRef entity) {
- boolean debugEnabled = Config.getInstance().isDebug();
+ boolean debugEnabled = config.getSystem().isDebugEnabled();
// Features for debug mode only
if (debugEnabled) {
switch (event.getKey()) {
@@ -107,18 +108,18 @@ public void onKeyDown(KeyDownEvent event, EntityRef entity) {
entity.send(new DamageEvent(9999, null));
break;
case Keyboard.KEY_H:
- for (UIDisplayElement element : CoreRegistry.get(GUIManager.class).getWindowById("hud").getDisplayElements()) {
+ for (UIDisplayElement element : CoreRegistry.get(GUIManager.class).getWindowById("hud").getDisplayElements()) {
element.setVisible(!element.isVisible());
}
-
+
event.consume();
break;
}
}
switch (event.getKey()) {
case Keyboard.KEY_F3:
- Config.getInstance().setDebug(!Config.getInstance().isDebug());
+ config.getSystem().setDebugEnabled(!config.getSystem().isDebugEnabled());
event.consume();
break;
case Keyboard.KEY_F:
@@ -143,6 +144,6 @@ public void onKeyDown(KeyDownEvent event, EntityRef entity) {
}
private void toggleViewingDistance() {
- Config.getInstance().setViewingDistanceById((Config.getInstance().getActiveViewingDistanceId() + 1) % 4);
+ config.getRendering().setActiveViewDistanceMode((config.getRendering().getActiveViewDistanceMode() + 1) % 4);
}
}
Oops, something went wrong.

0 comments on commit 635e5be

Please sign in to comment.