preview special item
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "fileio/resmgr/res_dialog.hpp"
|
||||
#include "sounds.hpp"
|
||||
#include "dialogxml/dialogs/choicedlog.hpp"
|
||||
#include "dialogxml/dialogs/strdlog.hpp"
|
||||
#include "dialogxml/widgets/pict.hpp"
|
||||
#include "dialogxml/widgets/button.hpp"
|
||||
#include "dialogxml/widgets/field.hpp"
|
||||
@@ -38,6 +39,7 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "scenario/scenario.hpp"
|
||||
#include "universe/universe.hpp"
|
||||
#include "item.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace ticpp;
|
||||
@@ -55,7 +57,6 @@ std::function<void(sf::RenderWindow& win)> cDialog::onHandleEvents;
|
||||
extern std::map<std::string,sf::Color> colour_map;
|
||||
|
||||
extern bool check_for_interrupt(std::string);
|
||||
extern void showError(std::string str1, cDialog* parent = nullptr);
|
||||
|
||||
std::string cDialog::generateId(const std::string& explicitId) const {
|
||||
return explicitId.empty() ? cControl::generateRandomString() : explicitId;
|
||||
@@ -1399,3 +1400,10 @@ std::string get_text_response(std::string prompt, pic_num_t pic) {
|
||||
boost::algorithm::to_lower(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void show_spec_item(const cSpecItem& item, const cScenario& scenario, cDialog* parent) {
|
||||
cStrDlog display_strings(item.descr,"",
|
||||
item.name,scenario.intro_pic,PIC_SCEN,parent);
|
||||
display_strings.setSound(57);
|
||||
display_strings.show();
|
||||
}
|
@@ -38,6 +38,8 @@ class cContainer;
|
||||
class cTextField;
|
||||
struct DialogDefn;
|
||||
class cUniverse;
|
||||
class cSpecItem;
|
||||
class cScenario;
|
||||
|
||||
/// Specifies the relative position of a control's labelling text.
|
||||
enum eLabelPos {
|
||||
@@ -399,6 +401,8 @@ void story_dialog(cUniverse& univ, std::string title, str_num_t first, str_num_t
|
||||
void custom_pic_dialog(std::string title, pic_num_t bigpic, pic_num_t icon);
|
||||
std::string get_text_response(std::string prompt = "", pic_num_t pic = 16);
|
||||
|
||||
void show_spec_item(const cSpecItem& item, const cScenario& scenario, cDialog* parent = nullptr);
|
||||
|
||||
// For development/debugging only.
|
||||
void preview_dialog_xml(fs::path dialog_xml);
|
||||
|
||||
|
Reference in New Issue
Block a user