Author: fendrin
Date: Mon Mar 14 19:00:25 2011
New Revision: 48907

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48907&view=rev
Log:
Moved the "New Side" menu entry from the "File" menu to the "Side" menu.

Modified:
    branches/editor/data/themes/editor.cfg
    branches/editor/src/editor/editor_controller.cpp

Modified: branches/editor/data/themes/editor.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/editor/data/themes/editor.cfg?rev=48907&r1=48906&r2=48907&view=diff
==============================================================================
--- branches/editor/data/themes/editor.cfg (original)
+++ branches/editor/data/themes/editor.cfg Mon Mar 14 19:00:25 2011
@@ -121,7 +121,7 @@
             id=menu-editor-file
             title= _ "File"
             image=lite_small
-            
items=editor-map-new,editor-side-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,editor-multiplayer-save,editor-multiplayer-save-as,preferences,editor-settings,editor-close-map,quit,editor-quit-to-desktop
+            
items=editor-map-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,editor-multiplayer-save,editor-multiplayer-save-as,preferences,editor-settings,editor-close-map,quit,editor-quit-to-desktop
             ref=top-panel
             rect="=+3,=+1,+55,=-4"
             xanchor=fixed
@@ -172,7 +172,7 @@
             id=menu-editor-side
             title= _ "Side"
             image=lite_small
-            items=editor-switch-side
+            items=editor-switch-side,editor-side-new
             rect="+2,=,+55,="
             xanchor=fixed
             yanchor=fixed

Modified: branches/editor/src/editor/editor_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/editor/editor_controller.cpp?rev=48907&r1=48906&r2=48907&view=diff
==============================================================================
--- branches/editor/src/editor/editor_controller.cpp (original)
+++ branches/editor/src/editor/editor_controller.cpp Mon Mar 14 19:00:25 2011
@@ -38,15 +38,13 @@
 #include "../map_create.hpp"
 #include "../mapgen.hpp"
 #include "../preferences_display.hpp"
+#include "../resources.hpp"
 #include "../rng.hpp"
 #include "../sound.hpp"
 
 #include "formula_string_utils.hpp"
 
 #include <boost/bind.hpp>
-
-//TODO sort in
-#include "resources.hpp"
 
 namespace {
 static std::vector<std::string> saved_windows_;
@@ -402,6 +400,7 @@
        current_area_index_ = 0;
        map_context_refresher mcr(*this, *map_contexts_[index]);
 
+       //TODO avoid duplicate code
        resources::game_map = &get_map();
        resources::units = &get_map().get_units();
 //     resources::units = &units_;
@@ -444,6 +443,7 @@
        boost::scoped_ptr<map_context> 
del(map_contexts_[current_context_index_]);
        map_context_refresher mcr(*this, *new_mc);
        map_contexts_[current_context_index_] = new_mc;
+       //TODO avoid duplicate code
        resources::game_map = &get_map();
        resources::units = &get_map().get_units();
        resources::teams = &get_map().get_teams();
@@ -555,7 +555,7 @@
        //TODO make team adjustable
        //TODO make id adjustable
        t.build(side_cfg, get_map(), 100);
-       /* TODO this snippet of code seems interresting at this point:
+       /* This snippet of code seems interresting at this point:
        get_map().get_state().build_team(dummy, "", get_map().get_teams(), 
dummy, get_map()
                                , get_map().get_units(), true);
                                */
@@ -838,7 +838,7 @@
        return true;
 }
 
-//TODO enable or remove
+//TODO
 //bool editor_controller::save_multiplayer(bool display_confirmation)
 //{
 //     gui::dialog     d(get_display(), _("Scenario ID?"), "", gui::OK_CANCEL);
@@ -1010,7 +1010,7 @@
                                case AREA:
                                        return (i < 
get_map().get_named_areas().get_area_ids().size() +1);
                                case SIDE:
-                                       return (i < 
get_map().get_teams().size() );
+                                       return (i-1 < 
get_map().get_teams().size() );
                        }
                case HOTKEY_ZOOM_IN:
                case HOTKEY_ZOOM_OUT:
@@ -1041,8 +1041,7 @@
                case HOTKEY_EDITOR_MAP_SAVE_AS:
                        //TODO disable the multiplayer save options when no 
sides defined?
                case HOTKEY_EDITOR_MULTIPLAYER_SAVE:
-                       //TODO clean up.
-       //      case HOTKEY_EDITOR_MULTIPLAYER_SAVE_AS:
+               case HOTKEY_EDITOR_MULTIPLAYER_SAVE_AS:
                case HOTKEY_EDITOR_BRUSH_NEXT:
                case HOTKEY_EDITOR_TOOL_NEXT:
                case HOTKEY_EDITOR_TERRAIN_PALETTE_SWAP:
@@ -1135,7 +1134,7 @@
                        case AREA:
                                return index == current_area_index_ ? ACTION_ON 
: ACTION_OFF;
                        case SIDE:
-                               return index == current_side_index_ ? ACTION_ON 
: ACTION_OFF;
+                               return (index - 1) == current_side_index_ ? 
ACTION_ON : ACTION_OFF;
                        }
                        default:
                        return command_executor::get_action_state(command, 
index);
@@ -1160,8 +1159,8 @@
                                        return true;
                                }
                        case SIDE:
-                               if (i < get_map().get_teams().size()) {
-                                       switch_side(index);
+                               if (i-1 < get_map().get_teams().size()) {
+                                       switch_side(index - 1);
                                        return true;
                                }
                        case AREA:
@@ -1378,13 +1377,6 @@
                        }
                }
        }
-       /* TODO we don't get here if items is empty
-       if (items.size() == 0) {
-               //TODO think about the whitespace
-               std::string none_label = _("[None] ");
-               items.push_back(none_label);
-       }
-       */
        menu_context_ = SIDE;
 }
 
@@ -1526,6 +1518,7 @@
 
 void editor_controller::name_selection()
 {
+       //TODO is that gui2?
        gui::dialog     d(get_display(), _("Name Selected Area"), "", 
gui::OK_CANCEL);
 
        //TODO think about map_labels::get_max_chars


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

Reply via email to