~ubuntu-branches/ubuntu/raring/lordsawar/raring

« back to all changes in this revision

Viewing changes to src/editor/new-map-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese, Gonéri Le Bouder
  • Date: 2008-06-17 11:15:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617111526-yjyvu9df50zmpdo0
Tags: 0.0.9-1
[ Barry deFreese ]
* New upstream release.
  + Fixes gcc-4.3 builds so drop ftbfs_gcc-4.3_fix.diff.
  + Add new build-dependency for libgnet-dev.
* Add simple man page for new lordsawar-tile-editor.
* Add desktop file for lordsawar-tile-editor.
* Remove French translation on install.

[ Gonéri Le Bouder ]
* bump Debian Policy to 3.8.0. No change needed.
* fix wording in the 0.0.8-3 entry of the Debian changelog

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2007, Ole Laursen
 
2
//  Copyright (C) 2007, 2008 Ben Asselstine
 
3
//
1
4
//  This program is free software; you can redistribute it and/or modify
2
5
//  it under the terms of the GNU General Public License as published by
3
6
//  the Free Software Foundation; either version 2 of the License, or
10
13
//
11
14
//  You should have received a copy of the GNU General Public License
12
15
//  along with this program; if not, write to the Free Software
13
 
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*
 
16
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
 
17
//  02110-1301, USA.
14
18
 
15
19
#include <config.h>
16
20
 
26
30
#include "../File.h"
27
31
#include "../tileset.h"
28
32
#include "../tilesetlist.h"
 
33
#include "../armysetlist.h"
29
34
#include "../citysetlist.h"
30
35
#include "../shieldsetlist.h"
31
36
#include "../GameMap.h"
58
63
    tile_theme_combobox = manage(new Gtk::ComboBoxText);
59
64
    shield_theme_combobox = manage(new Gtk::ComboBoxText);
60
65
    city_theme_combobox = manage(new Gtk::ComboBoxText);
 
66
    army_theme_combobox = manage(new Gtk::ComboBoxText);
61
67
    
62
68
    Uint32 counter = 0;
63
69
    Uint32 default_id = 0;
116
122
    xml->get_widget("city_set_box", city_set_box);
117
123
    city_set_box->pack_start(*city_theme_combobox, Gtk::PACK_SHRINK);
118
124
 
 
125
    Gtk::Box *armyset_box;
 
126
    xml->get_widget("armyset_box", armyset_box);
 
127
    armyset_box->pack_start(*army_theme_combobox, Gtk::PACK_SHRINK);
 
128
 
 
129
    counter = 0;
 
130
    default_id = 0;
 
131
    Armysetlist *al = Armysetlist::getInstance();
 
132
    std::list<std::string> army_themes = al->getNames();
 
133
    for (std::list<std::string>::iterator i = army_themes.begin(),
 
134
             end = army_themes.end(); i != end; ++i)
 
135
      {
 
136
        if (*i == "Default")
 
137
          default_id = counter;
 
138
        army_theme_combobox->append_text(Glib::filename_to_utf8(*i));
 
139
        counter++;
 
140
      }
 
141
 
 
142
    army_theme_combobox->set_active(default_id);
 
143
 
119
144
    // create fill style combobox
120
145
    fill_style_combobox = manage(new Gtk::ComboBoxText);
121
146
 
161
186
    {
162
187
        switch (map_size_combobox->get_active_row_number()) {
163
188
        case MAP_SIZE_SMALL:
164
 
            map.width = 70;
165
 
            map.height = 105;
 
189
            map.width = MAP_SIZE_SMALL_WIDTH;
 
190
            map.height = MAP_SIZE_SMALL_HEIGHT;
166
191
            break;
167
192
        
168
193
        case MAP_SIZE_TINY:
169
 
            map.width = 50;
170
 
            map.height = 75;
 
194
            map.width = MAP_SIZE_TINY_WIDTH;
 
195
            map.height = MAP_SIZE_TINY_HEIGHT;
171
196
            break;
172
197
        
173
198
        case MAP_SIZE_NORMAL:
174
199
        default:
175
 
            map.width = 112;
176
 
            map.height = 156;
 
200
            map.width = MAP_SIZE_NORMAL_WIDTH;
 
201
            map.height = MAP_SIZE_NORMAL_HEIGHT;
177
202
            break;
178
203
        }
179
204
        
190
215
        map.cityset = Citysetlist::getInstance()->getCitysetDir
191
216
          (Glib::filename_from_utf8(city_theme_combobox->get_active_text()));
192
217
 
 
218
        map.armyset = 
 
219
          Glib::filename_from_utf8(army_theme_combobox->get_active_text());
 
220
 
193
221
        if (map.fill_style == -1)
194
222
        {
195
223
            map.grass = int(grass_scale->get_value());