Permalink
Browse files

Merge branch 'develop' of git@github.com:MovingBlocks/Terasology.git …

…into develop

Conflicts:
	src/main/java/org/terasology/componentSystem/controllers/LocalPlayerSystem.java
  • Loading branch information...
2 parents 4643161 + aff2f2b commit 7e63dd9462c6ca3f4180a8a2ac3ad3c6c7a3e503 @immortius immortius committed Aug 31, 2012
Showing with 5,020 additions and 4,667 deletions.
  1. +1 −0 .gitignore
  2. +7 −20 build.gradle
  3. +96 −7 config/checkstyle/checkstyle.xml
  4. +8 −0 config/checkstyle/suppressions.xml
  5. 0 src/{perfTest → dev}/java/org/terasology/world/ChunkCachePerformanceTest.java
  6. +2 −2 src/main/java/org/terasology/componentSystem/action/ReadBookAction.java
  7. +6 −1 src/main/java/org/terasology/componentSystem/controllers/DebugControlSystem.java
  8. +2 −2 src/main/java/org/terasology/componentSystem/controllers/LocalPlayerSystem.java
  9. +0 −7 src/main/java/org/terasology/game/modes/StateMainMenu.java
  10. +0 −4 src/main/java/org/terasology/game/modes/StateSinglePlayer.java
  11. +17 −46 src/main/java/org/terasology/logic/manager/GUIManager.java
  12. +36 −18 src/main/java/org/terasology/logic/manager/PostProcessingRenderer.java
  13. +3 −3 src/main/java/org/terasology/model/BuffIcon.java
  14. +3 −3 src/main/java/org/terasology/model/inventory/Icon.java
  15. +2 −2 src/main/java/org/terasology/mods/miniions/componentsystem/controllers/MinionSystem.java
  16. +6 −6 src/main/java/org/terasology/mods/miniions/rendering/gui/components/UIMessageQueue.java
  17. +7 −7 src/main/java/org/terasology/mods/miniions/rendering/gui/components/UIMinionBehaviourMenu.java
  18. +12 −19 src/main/java/org/terasology/mods/miniions/rendering/gui/components/UIMinionbar.java
  19. +0 −162 src/main/java/org/terasology/rendering/gui/components/UIButton.java
  20. +0 −191 src/main/java/org/terasology/rendering/gui/components/UIComboBox.java
  21. +0 −136 src/main/java/org/terasology/rendering/gui/components/UIDialogBox.java
  22. +0 −116 src/main/java/org/terasology/rendering/gui/components/UIHealthBar.java
  23. +0 −42 src/main/java/org/terasology/rendering/gui/components/UIImageOverlay.java
  24. +0 −338 src/main/java/org/terasology/rendering/gui/components/UIList.java
  25. +0 −76 src/main/java/org/terasology/rendering/gui/components/UIMessageBox.java
  26. +0 −40 src/main/java/org/terasology/rendering/gui/components/UIOpenBook.java
  27. +0 −95 src/main/java/org/terasology/rendering/gui/components/UIProgressBar.java
  28. +0 −387 src/main/java/org/terasology/rendering/gui/components/UIScrollBar.java
  29. +0 −80 src/main/java/org/terasology/rendering/gui/components/UIToolbar.java
  30. +0 −69 src/main/java/org/terasology/rendering/gui/components/UITransparentOverlay.java
  31. +0 −81 src/main/java/org/terasology/rendering/gui/components/UIWindowTitle.java
  32. +35 −33 src/main/java/org/terasology/rendering/gui/dialogs/UIDialogCreateNewWorld.java
  33. +382 −122 src/main/java/org/terasology/rendering/gui/framework/UIDisplayContainer.java
  34. +314 −0 src/main/java/org/terasology/rendering/gui/framework/UIDisplayContainerScrollable.java
  35. +559 −211 src/main/java/org/terasology/rendering/gui/framework/UIDisplayElement.java
  36. +17 −10 src/main/java/org/terasology/rendering/gui/framework/UIDisplayRenderer.java
  37. +0 −125 src/main/java/org/terasology/rendering/gui/framework/UIGraphicsElement.java
  38. +0 −199 src/main/java/org/terasology/rendering/gui/framework/UIScrollableDisplayContainer.java
  39. +1 −1 src/main/java/org/terasology/rendering/gui/framework/events/BindKeyListener.java
  40. +1 −1 src/main/java/org/terasology/rendering/gui/framework/events/ChangedListener.java
  41. +5 −5 src/main/java/org/terasology/rendering/gui/framework/events/ClickListener.java
  42. +4 −4 src/main/java/org/terasology/rendering/gui/framework/events/FocusListener.java
  43. +1 −1 src/main/java/org/terasology/rendering/gui/framework/events/KeyListener.java
  44. +11 −11 src/main/java/org/terasology/rendering/gui/framework/events/MouseButtonListener.java
  45. +23 −23 src/main/java/org/terasology/rendering/gui/framework/events/MouseMoveListener.java
  46. +1 −1 src/main/java/org/terasology/rendering/gui/framework/events/StateButtonAction.java
  47. +2 −2 src/main/java/org/terasology/rendering/gui/framework/events/WindowListener.java
  48. +0 −79 src/main/java/org/terasology/rendering/gui/framework/style/UIProperty.java
  49. +0 −129 src/main/java/org/terasology/rendering/gui/framework/style/UIPropertyBackground.java
  50. +0 −296 src/main/java/org/terasology/rendering/gui/framework/style/UIPropertyBorder.java
  51. +10 −70 src/main/java/org/terasology/rendering/gui/framework/style/UIStyle.java
  52. +21 −0 src/main/java/org/terasology/rendering/gui/framework/style/UIStyleBackgroundColor.java
  53. +24 −0 src/main/java/org/terasology/rendering/gui/framework/style/UIStyleBackgroundImage.java
  54. +12 −0 src/main/java/org/terasology/rendering/gui/framework/style/UIStyleBackgroundSplit.java
  55. +250 −0 src/main/java/org/terasology/rendering/gui/framework/style/UIStyleBorderImage.java
  56. +110 −0 src/main/java/org/terasology/rendering/gui/framework/style/UIStyleBorderSolid.java
  57. +390 −0 src/main/java/org/terasology/rendering/gui/layout/GridLayout.java
  58. +22 −0 src/main/java/org/terasology/rendering/gui/layout/Layout.java
  59. +9 −8 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIBuff.java
  60. +234 −0 src/main/java/org/terasology/rendering/gui/widgets/UIButton.java
  61. +179 −0 src/main/java/org/terasology/rendering/gui/widgets/UIComboBox.java
  62. +69 −0 src/main/java/org/terasology/rendering/gui/widgets/UIComposite.java
  63. +212 −0 src/main/java/org/terasology/rendering/gui/widgets/UIDialogBox.java
  64. +234 −0 src/main/java/org/terasology/rendering/gui/widgets/UIImage.java
  65. +16 −8 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIInput.java
  66. +109 −97 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIItemCell.java
  67. +2 −2 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIItemCellIcon.java
  68. +3 −2 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIItemContainer.java
  69. +361 −0 src/main/java/org/terasology/rendering/gui/widgets/UIList.java
  70. +62 −0 src/main/java/org/terasology/rendering/gui/widgets/UIMessageBox.java
  71. +103 −0 src/main/java/org/terasology/rendering/gui/widgets/UIProgressBar.java
  72. +70 −75 src/main/java/org/terasology/rendering/gui/{components → widgets}/UISlider.java
  73. +55 −55 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIStateButton.java
  74. +33 −47 src/main/java/org/terasology/rendering/gui/{components → widgets}/UIText.java
  75. +35 −42 src/main/java/org/terasology/rendering/gui/{components → widgets}/UITextWrap.java
  76. +69 −63 src/main/java/org/terasology/rendering/gui/{framework/UIDisplayWindow.java → widgets/UIWindow.java}
  77. +27 −48 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfig.java
  78. +23 −42 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigAudio.java
  79. +158 −283 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigControls.java
  80. +20 −38 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigMods.java
  81. +137 −165 src/main/java/org/terasology/rendering/gui/windows/UIMenuConfigVideo.java
  82. +26 −46 src/main/java/org/terasology/rendering/gui/windows/UIMenuMain.java
  83. +31 −52 src/main/java/org/terasology/rendering/gui/windows/UIMenuPause.java
  84. +47 −71 src/main/java/org/terasology/rendering/gui/windows/UIMenuSelectWorld.java
  85. +11 −19 src/main/java/org/terasology/rendering/gui/windows/UIScreenBook.java
  86. +8 −7 src/main/java/org/terasology/rendering/gui/windows/UIScreenConsole.java
  87. +19 −18 src/main/java/org/terasology/rendering/gui/windows/UIScreenContainer.java
  88. +18 −42 src/main/java/org/terasology/rendering/gui/windows/UIScreenDeath.java
  89. +153 −82 src/main/java/org/terasology/rendering/gui/windows/UIScreenHUD.java
  90. +63 −42 src/main/java/org/terasology/rendering/gui/windows/UIScreenInventory.java
  91. +14 −23 src/main/java/org/terasology/rendering/gui/windows/UIScreenLoading.java
  92. +7 −7 src/main/java/org/terasology/rendering/gui/windows/UIScreenMetrics.java
  93. BIN src/main/resources/org/terasology/data/textures/gui_menu.png
View
@@ -12,6 +12,7 @@ Terasology.iws
.classpath
.project
.settings
+.checkstyle
.gradle
bin
data/console/consolelog.json
View
@@ -86,11 +86,16 @@ sourceCompatibility = 1.6
compileJava.enabled = false
sourceSets.main.java.srcDirs.each { sourceSets.main.groovy.srcDirs it }
+sourceSets {
+ dev
+}
+
configurations {
compile {
exclude module: 'lwjgl-platform'
exclude module: 'jinput-platform'
}
+ devCompile.extendsFrom compile
}
dependencies {
@@ -108,6 +113,7 @@ dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
testCompile group: 'junit', name: 'junit', version: '4.10'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.0'
+ devCompile sourceSets.main.output
}
task createVersionInfoFile << {
@@ -164,6 +170,7 @@ test {
/* Check ------------------------------------------------------------------- */
checkstyle.ignoreFailures = true
+checkstyle.configProperties.samedir = checkstyle.configFile.parentFile
/* Optional check plugins
apply plugin: 'codenarc'
apply plugin: 'findbugs'
@@ -175,26 +182,6 @@ findbugs.ignoreFailures = true
pmd.ignoreFailures = true
*/
-/* perfTest ----------------------------------------------------------------- */
-sourceSets {
- perfTest
-}
-
-configurations {
- perfTestCompile.extendsFrom compile
-}
-
-dependencies {
- perfTestCompile sourceSets.main.output
-}
-
-task runChunkCachePerformanceTest(type:JavaExec) {
- description = "Run 'ChunkCachePerformanceTest'"
- main = 'org.terasology.world.ChunkCachePerformanceTest'
- classpath sourceSets.perfTest.runtimeClasspath
- jvmArgs '-Xms512m', '-Xmx1024m', '-XX:MaxPermSize=128m'
-}
-
/* Misc tasks ------------------------------------------------------------------- */
task assembleMainOutput(type:Sync) {
from sourceSets.main.output
@@ -4,20 +4,109 @@
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
+ <module name="SuppressionFilter">
+ <property name="file" value="${samedir}/suppressions.xml"/>
+ </module>
+
<!-- Checks whether files end with a new line. -->
- <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <!-- See http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
+ <!-- Checks that there are no tab characters ('\t') in the source code. -->
+ <!-- See http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter -->
+ <module name="FileTabCharacter"/>
+
<module name="TreeWalker">
+ <!-- Checks for Naming Conventions -->
+ <!-- See http://checkstyle.sourceforge.net/config_naming.html -->
+ <!-- ***************************** -->
+ <!-- constants (static, final fields) : ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ -->
+ <module name="ConstantName"/>
+ <!-- local, final variables, including catch parameters : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="LocalFinalVariableName"/>
+ <!-- local, non-final variables, including catch parameters : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="LocalVariableName"/>
+ <!-- non-static fields : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="MemberName"/>
+ <!-- methods : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="MethodName"/>
+ <!-- packages : ^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$ -->
<module name="PackageName"/>
+ <!-- parameters : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="ParameterName"/>
+ <!-- static, non-final fields : ^[a-z][a-zA-Z0-9]*$ -->
+ <module name="StaticVariableName"/>
+ <!-- classes and interfaces : ^[A-Z][a-zA-Z0-9]*$ -->
<module name="TypeName"/>
- <!-- Checks for imports -->
- <!-- See http://checkstyle.sf.net/config_import.html -->
- <module name="AvoidStarImport"/>
- <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
- <module name="RedundantImport"/>
- <module name="UnusedImports"/>
+ <!-- Checks for imports -->
+ <!-- ****************** -->
+ <!-- Checks that there are no import statements that use the * notation. -->
+ <!-- See http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport -->
+ <module name="AvoidStarImport">
+ <property name="severity" value="warning"/>
+ <property name="allowStaticMemberImports" value="true"/> <!-- allow starred static member imports -->
+ </module>
+ <!-- Checks for redundant import statements. -->
+ <!-- See http://checkstyle.sourceforge.net/config_imports.html#RedundantImport -->
+ <module name="RedundantImport">
+ <property name="severity" value="warning"/>
+ </module>
+ <!-- Checks for unused import statements. -->
+ <!-- See http://checkstyle.sourceforge.net/config_imports.html#UnusedImports -->
+ <module name="UnusedImports">
+ <property name="severity" value="warning"/>
+ </module>
+
+ <!-- Modifier Checks -->
+ <!-- *************** -->
+ <!-- Checks that the order of modifiers conforms to the suggestions in the Java Language specification -->
+ <!-- See http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder -->
+ <module name="ModifierOrder"/>
+ <!-- Checks for redundant modifiers -->
+ <!-- See http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier -->
+ <module name="RedundantModifier">
+ <property name="severity" value="warning"/>
+ </module>
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- *************************************** -->
+ <!-- Finds nested blocks, i.e. blocks that are used freely in the code. -->
+ <!-- See http://checkstyle.sourceforge.net/config_blocks.html#AvoidNestedBlocks -->
+ <module name="AvoidNestedBlocks"/>
+ <!-- Checks for empty blocks. -->
+ <!-- See http://checkstyle.sourceforge.net/config_blocks.html#EmptyBlock -->
+ <module name="EmptyBlock">
+ <property name="severity" value="warning"/>
+ </module>
+ <!-- Checks for the placement of left curly braces ('{') for code blocks. Default: eol -->
+ <!-- See http://checkstyle.sourceforge.net/config_blocks.html#LeftCurly -->
+ <module name="LeftCurly"/>
+ <!-- Checks for braces around code blocks. -->
+ <!-- See http://checkstyle.sourceforge.net/config_blocks.html#NeedBraces -->
+ <module name="NeedBraces"/>
+ <!-- Checks the placement of right curly braces ('}') for else, try, and catch tokens. Default: same -->
+ <!-- See http://checkstyle.sourceforge.net/config_blocks.html#RightCurly -->
+ <module name="RightCurly"/>
+
+ <!-- Miscellaneous other checks. -->
+ <!-- *************************** -->
+ <!-- Checks the style of array type definitions. -->
+ <!-- See http://checkstyle.sourceforge.net/config_misc.html#ArrayTypeStyle -->
+ <module name="ArrayTypeStyle">
+ <property name="severity" value="warning"/>
+ </module>
+ <!-- Checks correct indentation of Java Code. -->
+ <!-- See http://checkstyle.sourceforge.net/config_misc.html#Indentation -->
+ <module name="Indentation">
+ <property name="severity" value="warning"/>
+ </module>
+ <!-- Checks that long constants are defined with an upper ell. That is ' L' and not 'l'. -->
+ <!-- See http://checkstyle.sourceforge.net/config_misc.html#UpperEll -->
+ <module name="UpperEll"/>
+ <!-- Checks that the outer type name and the file name match. -->
+ <!-- See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename -->
+ <module name="OuterTypeFilename"/>
</module>
</module>
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+ <suppress checks="." files="org[\\/]terasology[\\/]protobuf[\\/].*"/>
+</suppressions>
@@ -22,7 +22,7 @@
import org.terasology.entitySystem.RegisterComponentSystem;
import org.terasology.events.ActivateEvent;
import org.terasology.logic.manager.GUIManager;
-import org.terasology.rendering.gui.framework.UIDisplayWindow;
+import org.terasology.rendering.gui.widgets.UIWindow;
import org.terasology.rendering.gui.windows.UIScreenBook;
@@ -34,7 +34,7 @@
@RegisterComponentSystem
public class ReadBookAction implements EventHandlerSystem {
- private UIDisplayWindow bookScreen;
+ private UIWindow bookScreen;
public void initialise() {
bookScreen = GUIManager.getInstance().addWindow(new UIScreenBook(), "engine:bookScreen");
@@ -103,7 +103,12 @@ public void onKeyDown(KeyDownEvent event, EntityRef entity) {
entity.send(new DamageEvent(9999, null));
break;
case Keyboard.KEY_H:
- GUIManager.getInstance().getWindowById("engine:hud").setVisible(!GUIManager.getInstance().getWindowById("engine:hud").isVisible());
+ if (GUIManager.getInstance().getWindowById("engine:hud").isVisible()) {
+ GUIManager.getInstance().getWindowById("engine:hud").close();
+ } else {
+ GUIManager.getInstance().getWindowById("engine:hud").open();
+ }
+
event.consume();
break;
}
@@ -20,6 +20,7 @@
import org.terasology.componentSystem.UpdateSubscriberSystem;
import org.terasology.components.*;
import org.terasology.math.Vector3i;
+import org.terasology.rendering.gui.widgets.UIImage;
import org.terasology.world.block.BlockComponent;
import org.terasology.world.block.BlockItemComponent;
import org.terasology.components.rendering.MeshComponent;
@@ -52,7 +53,6 @@
import org.terasology.physics.character.CharacterMovementComponent;
import org.terasology.rendering.AABBRenderer;
import org.terasology.rendering.cameras.DefaultCamera;
-import org.terasology.rendering.gui.framework.UIGraphicsElement;
import org.terasology.world.block.BlockRegionComponent;
import javax.vecmath.Quat4f;
@@ -369,7 +369,7 @@ public void onDropItem(DropItemButton event, EntityRef entity){
if (localPlayerComp.isDead) return;
- UIGraphicsElement crossHair = (UIGraphicsElement)GUIManager.getInstance().getWindowById("engine:hud").getElementById("crosshair");
+ UIImage crossHair = (UIImage)GUIManager.getInstance().getWindowById("engine:hud").getElementById("crosshair");
crossHair.getTextureSize().set(new Vector2f(22f / 256f, 22f / 256f));
@@ -94,25 +94,18 @@ public void init(GameEngine gameEngine) {
//setup the GUI
_mainMenu = new UIMenuMain();
- _mainMenu.setVisible(true);
_selectWorldMenu = new UIMenuSelectWorld();
- _selectWorldMenu.setVisible(false);
_configMenu = new UIMenuConfig();
- _configMenu.setVisible(false);
_configMenuVideo = new UIMenuConfigVideo();
- _configMenuVideo.setVisible(false);
_configMenuAudio = new UIMenuConfigAudio();
- _configMenuAudio.setVisible(false);
_configMenuControls = new UIMenuConfigControls();
- _configMenuControls.setVisible(false);
_configMenuMods = new UIMenuConfigMods();
- _configMenuMods.setVisible(false);
GUIManager.getInstance().addWindow(_mainMenu, "menuMain");
GUIManager.getInstance().addWindow(_selectWorldMenu, "selectWorld");
@@ -296,10 +296,6 @@ public void initWorld() {
prepareWorld();
}
- private boolean screenHasFocus() {
- return GUIManager.getInstance().getFocusedWindow() != null && GUIManager.getInstance().getFocusedWindow().isModal() && GUIManager.getInstance().getFocusedWindow().isVisible();
- }
-
private boolean shouldUpdateWorld() {
return !pauseGame;
}
Oops, something went wrong.

0 comments on commit 7e63dd9

Please sign in to comment.