Author: timotei
Date: Tue Jul 26 17:29:55 2011
New Revision: 50420

URL: http://svn.gna.org/viewcvs/wesnoth?rev=50420&view=rev
Log:
eclipse plugin: fix the logic for handling the
'configOnly' boolean parameter, and add cases
for handling removed variables

Modified:
    
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/core/SimpleWMLParser.java

Modified: 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/core/SimpleWMLParser.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/core/SimpleWMLParser.java?rev=50420&r1=50419&r2=50420&view=diff
==============================================================================
--- 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/core/SimpleWMLParser.java 
(original)
+++ 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/core/SimpleWMLParser.java 
Tue Jul 26 17:29:55 2011
@@ -85,18 +85,32 @@
                             config_.ScenarioId = WMLUtils.getKeyValue( 
key.getValue( ) );
                         else if ( currentTagName.equals( "campaign" ) )
                             config_.CampaignId = WMLUtils.getKeyValue( 
key.getValue( ) );
-                    } else if ( keyName.equals( "name" ) ) {
-                        if ( currentTagName.equals( "set_variable" ) ||
-                             currentTagName.equals( "set_variables" ) ) {
-                            handleSetVariable( object );
+                    }
+
+                    // now follows just things that modify project/file's 
related info
+                    if ( configOnly == false ) {
+                        if ( keyName.equals( "name" ) ) {
+                            if ( currentTagName.equals( "set_variable" ) ||
+                                 currentTagName.equals( "set_variables" ) ) {
+                                handleSetVariable( object );
+                            } else if ( currentTagName.equals( 
"clear_variable" ) ||
+                                        currentTagName.equals( 
"clear_variables" ) ) {
+                                handleUnsetVariable( object );
+                            }
                         }
                     }
                 }
             }
             else if ( object instanceof WMLMacroCall ) {
-                WMLMacroCall macroCall = ( WMLMacroCall ) object;
-                if ( macroCall.getName( ).equals( "VARIABLE" ) ) {
-                    handleSetVariable( object );
+
+                if ( configOnly == false ) {
+                    WMLMacroCall macroCall = ( WMLMacroCall ) object;
+                    String macroCallName = macroCall.getName( );
+                    if ( macroCallName.equals( "VARIABLE" ) ) {
+                        handleSetVariable( object );
+                    } else if ( macroCallName.equals( "CLEAR_VARIABLE" ) ) {
+                        handleUnsetVariable( object );
+                    }
                 }
             }
         }


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to