- All Carbon code is gone - Many dialogs converted; some are still left unimplemented since they still need to be converted - Menus converted to a xib file - The giant arrays specifying the configuration of the special node dialog for each special node type have been replaced with maps and sets. Changes to dialogs: - pict choice dialog can now show picts of differing types; this was required for picking a monster graphic, as monsters of all sizes need to be shown in the same dialog - string choice dialog can set the title, and properly shows the currently selected string - LEDs now accept font format - Fixed LED group's calculation of its rect - Fixed LED group crashing if it has no selection - Tabbing between text fields now works - Fix display of larger monster graphics in dialogs - Fix the script element content showing in the browser preview
64 lines
1.8 KiB
C++
64 lines
1.8 KiB
C++
/*
|
|
* fileio.h
|
|
* BoE
|
|
*
|
|
* Created by Celtic Minstrel on 22/04/09.
|
|
*
|
|
*/
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <sstream>
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
#include "town.h"
|
|
#include "outdoors.h"
|
|
|
|
namespace fs = boost::filesystem; // TODO: Centralize this alias!
|
|
|
|
bool load_scenario(fs::path file_to_load, bool skip_strings = false);
|
|
bool load_town(short which_town, cTown*& the_town);
|
|
bool load_town_talk(short which_town);
|
|
bool load_town_str(short which_town, short which_str, char* str);
|
|
bool load_town_str(short which_town, cTown*& the_town);
|
|
bool load_outdoors(location which_out,cOutdoors& the_out);
|
|
bool load_outdoors(location which_out, short mode, ter_num_t borders[4][50]);
|
|
bool load_outdoor_str(location which_out, short which_str, char* str);
|
|
void load_spec_graphics();
|
|
|
|
bool load_party(fs::path file_to_load);
|
|
bool save_party(fs::path dest_file);
|
|
|
|
void init_directories(const char* exec_path);
|
|
|
|
std::string read_maybe_quoted_string(std::istream& from);
|
|
std::string maybe_quote_string(std::string which);
|
|
|
|
template<typename T, int D>
|
|
void writeArray(std::ostream& to, const T(* array)[D], int width, int height) {
|
|
using int_type = decltype(T() + 1);
|
|
for(int i = 0; i < width; i++) {
|
|
to << array[i][0];
|
|
for(int j = 1; j < height; j++)
|
|
to << '\t' << int_type(array[i][j]);
|
|
to << '\n';
|
|
}
|
|
to << '\f';
|
|
}
|
|
|
|
template<typename T, int D>
|
|
void readArray(std::istream& from, T(* array)[D], int width, int height) {
|
|
using int_type = decltype(T() + 1);
|
|
std::string arrayContents;
|
|
getline(from, arrayContents, '\f');
|
|
std::istringstream arrayIn(arrayContents);
|
|
for(int i = 0; i < width; i++) {
|
|
std::string line;
|
|
getline(arrayIn, line);
|
|
std::istringstream lineIn(line);
|
|
for(int j = 0; j < height; j++)
|
|
lineIn >> array[i][j];
|
|
if(!arrayIn) break;
|
|
}
|
|
}
|