fixed editor
This commit is contained in:
parent
b0e5d7534c
commit
7e22dc169f
3 changed files with 4 additions and 12 deletions
|
@ -92,8 +92,6 @@ void read_file_internal(const std::string& fname, std::string& res)
|
|||
|
||||
std::string read_file(const std::string& fname)
|
||||
{
|
||||
log_scope("reading file");
|
||||
|
||||
//if we have a path to the data,
|
||||
//convert any filepath which is relative
|
||||
if(!fname.empty() && fname[0] != '/' && !game_config::path.empty()) {
|
||||
|
@ -111,7 +109,6 @@ std::string read_file(const std::string& fname)
|
|||
|
||||
void write_file(const std::string& fname, const std::string& data)
|
||||
{
|
||||
log_scope("write_file");
|
||||
std::ofstream file(fname.c_str());
|
||||
if(file.bad()) {
|
||||
std::cerr << "error writing to file: '" << fname << "'\n";
|
||||
|
|
|
@ -121,9 +121,10 @@ int main(int argc, char** argv)
|
|||
gamestatus status(cfg,0);
|
||||
std::vector<team> teams;
|
||||
|
||||
const config* const theme_cfg = cfg.find_child("theme","name",preferences::theme());
|
||||
config dummy_theme;
|
||||
std::map<gamemap::location,unit> units;
|
||||
display gui(units,video,map,status,teams,dummy_theme);
|
||||
display gui(units,video,map,status,teams,theme_cfg ? *theme_cfg : dummy_theme);
|
||||
|
||||
std::vector<std::string> terrain_names;
|
||||
const std::vector<gamemap::TERRAIN> terrains = map.get_terrain_precedence();
|
||||
|
@ -136,15 +137,11 @@ int main(int argc, char** argv)
|
|||
terrain_names.push_back(map.terrain_name(*t));
|
||||
}
|
||||
|
||||
gui::menu terrain_menu(gui,terrain_names);
|
||||
gui::button tup(gui, "", gui::button::TYPE_PRESS,"uparrow");
|
||||
gui::button tdown(gui, "", gui::button::TYPE_PRESS,"downarrow");
|
||||
gui::button tup(gui, "", gui::button::TYPE_PRESS,"uparrow-button");
|
||||
gui::button tdown(gui, "", gui::button::TYPE_PRESS,"downarrow-button");
|
||||
tup.set_xy(gui.mapx() + 10, 165);
|
||||
tdown.set_xy((gui.x() - tdown.width()) - 10, 165);
|
||||
|
||||
terrain_menu.set_width((gui.x() - gui.mapx()));
|
||||
terrain_menu.set_loc(gui.mapx()+2,200);
|
||||
|
||||
gamemap::TERRAIN selected_terrain = terrains[1];
|
||||
int tstart = 0;
|
||||
|
||||
|
|
|
@ -421,8 +421,6 @@ SDL_Rect menu::get_item_rect(int item) const
|
|||
if(x_ > 0 && y_ > 0)
|
||||
itemRects_.insert(std::pair<int,SDL_Rect>(item,res));
|
||||
|
||||
std::cerr << "item " << item << " is " << res.w << "," << res.h << "\n";
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue