Convert scenario details dialog and make numeric fields validate their contents
This commit is contained in:
@@ -676,8 +676,12 @@ template<> pair<string,cTextField*> cDialog::parse(Element& who /*field*/){
|
|||||||
else if(name == "type"){
|
else if(name == "type"){
|
||||||
std::string val;
|
std::string val;
|
||||||
attr->GetValue(&val);
|
attr->GetValue(&val);
|
||||||
if(val == "num")
|
if(val == "int")
|
||||||
p.second->setInputType(FLD_NUM);
|
p.second->setInputType(FLD_INT);
|
||||||
|
else if(val == "uint")
|
||||||
|
p.second->setInputType(FLD_UINT);
|
||||||
|
else if(val == "real")
|
||||||
|
p.second->setInputType(FLD_REAL);
|
||||||
else if(val == "text")
|
else if(val == "text")
|
||||||
p.second->setInputType(FLD_TEXT);
|
p.second->setInputType(FLD_TEXT);
|
||||||
else throw xBadVal("field",name,val,attr->Row(),attr->Column(),fname);
|
else throw xBadVal("field",name,val,attr->Row(),attr->Column(),fname);
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
|
|
||||||
#include "field.h"
|
#include "field.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <map>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
|
#include "dlogutil.h"
|
||||||
#include "graphtool.h"
|
#include "graphtool.h"
|
||||||
|
|
||||||
void cTextField::attachClickHandler(click_callback_t) throw(xHandlerNotSupported){
|
void cTextField::attachClickHandler(click_callback_t) throw(xHandlerNotSupported){
|
||||||
@@ -20,7 +23,31 @@ void cTextField::attachFocusHandler(focus_callback_t f) throw(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cTextField::triggerFocusHandler(cDialog& me, std::string id, bool losingFocus){
|
bool cTextField::triggerFocusHandler(cDialog& me, std::string id, bool losingFocus){
|
||||||
// TODO: If isNumericField, verify that the contents are in fact a number.
|
if(losingFocus && field_type != FLD_TEXT) {
|
||||||
|
try {
|
||||||
|
std::string contents = getText();
|
||||||
|
switch(field_type) {
|
||||||
|
case FLD_TEXT: break;
|
||||||
|
case FLD_INT:
|
||||||
|
boost::lexical_cast<long long>(contents);
|
||||||
|
break;
|
||||||
|
case FLD_UINT:
|
||||||
|
boost::lexical_cast<unsigned long long>(contents);
|
||||||
|
break;
|
||||||
|
case FLD_REAL:
|
||||||
|
boost::lexical_cast<long double>(contents);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch(boost::bad_lexical_cast) {
|
||||||
|
static const std::map<const eFldType, const std::string> typeNames = {
|
||||||
|
{FLD_INT, "an integer"},
|
||||||
|
{FLD_UINT, "a positive integer"},
|
||||||
|
{FLD_REAL, "a number"},
|
||||||
|
};
|
||||||
|
giveError("You need to enter " + typeNames.at(field_type) + "!","",parent);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
bool passed = true;
|
bool passed = true;
|
||||||
if(onFocus != NULL) passed = onFocus(me,id,losingFocus);
|
if(onFocus != NULL) passed = onFocus(me,id,losingFocus);
|
||||||
if(passed) haveFocus = !losingFocus;
|
if(passed) haveFocus = !losingFocus;
|
||||||
@@ -31,6 +58,7 @@ bool cTextField::triggerFocusHandler(cDialog& me, std::string id, bool losingFoc
|
|||||||
|
|
||||||
bool cTextField::handleClick(location) {
|
bool cTextField::handleClick(location) {
|
||||||
// TODO: Set the insertion point, handle selection, etc
|
// TODO: Set the insertion point, handle selection, etc
|
||||||
|
if(haveFocus) return true;
|
||||||
if(parent && !parent->setFocus(this)) return true;
|
if(parent && !parent->setFocus(this)) return true;
|
||||||
haveFocus = true;
|
haveFocus = true;
|
||||||
return true;
|
return true;
|
||||||
@@ -53,19 +81,11 @@ sf::Color cTextField::getColour() throw(xUnsupportedProp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
eFldType cTextField::getInputType() {
|
eFldType cTextField::getInputType() {
|
||||||
if(isNumericField) return FLD_NUM;
|
return field_type;
|
||||||
else return FLD_TEXT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTextField::setInputType(eFldType type) {
|
void cTextField::setInputType(eFldType type) {
|
||||||
switch(type) {
|
field_type = type;
|
||||||
case FLD_NUM:
|
|
||||||
isNumericField = true;
|
|
||||||
break;
|
|
||||||
case FLD_TEXT:
|
|
||||||
isNumericField = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTextField::isClickable(){
|
bool cTextField::isClickable(){
|
||||||
@@ -82,7 +102,7 @@ cTextField::cTextField(cDialog* parent) :
|
|||||||
insertionPoint(-1),
|
insertionPoint(-1),
|
||||||
selectionPoint(0),
|
selectionPoint(0),
|
||||||
haveFocus(false),
|
haveFocus(false),
|
||||||
isNumericField(false) {}
|
field_type(FLD_TEXT) {}
|
||||||
|
|
||||||
cTextField::~cTextField(){}
|
cTextField::~cTextField(){}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
|
||||||
enum eFldType {
|
enum eFldType {
|
||||||
FLD_NUM,
|
FLD_INT,
|
||||||
|
FLD_UINT,
|
||||||
|
FLD_REAL,
|
||||||
FLD_TEXT,
|
FLD_TEXT,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ public:
|
|||||||
cTextField(cTextField& other) = delete;
|
cTextField(cTextField& other) = delete;
|
||||||
long tabOrder = 0;
|
long tabOrder = 0;
|
||||||
private:
|
private:
|
||||||
bool isNumericField;
|
eFldType field_type;
|
||||||
focus_callback_t onFocus;
|
focus_callback_t onFocus;
|
||||||
bool haveFocus;
|
bool haveFocus;
|
||||||
int insertionPoint;
|
int insertionPoint;
|
||||||
|
|||||||
@@ -1525,74 +1525,52 @@ void edit_item_placement() {
|
|||||||
shortcut_dlg.run();
|
shortcut_dlg.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool save_scen_details() {
|
static bool save_scen_details(cDialog& me) {
|
||||||
#if 0
|
|
||||||
char str[256];
|
|
||||||
short i;
|
short i;
|
||||||
|
|
||||||
scenario.difficulty = cd_get_led_range(803,30,33);
|
{
|
||||||
scenario.rating = cd_get_led_range(803,21,24);
|
cLedGroup& difficulty = dynamic_cast<cLedGroup&>(me["difficulty"]);
|
||||||
scenario.format.ver[0] = CDGN(803,2);
|
scenario.difficulty = difficulty.getSelected()[3] - '1';
|
||||||
scenario.format.ver[1] = CDGN(803,3);
|
}{
|
||||||
scenario.format.ver[2] = CDGN(803,4);
|
cLedGroup& rating = dynamic_cast<cLedGroup&>(me["rating"]);
|
||||||
for (i = 0; i < 3; i++)
|
scenario.rating = rating.getSelected()[4] - '1';
|
||||||
if (cre(scenario.format.ver[i],
|
}
|
||||||
0,9,"The digits in the version number must be in the 0 to 9 range.","",803) == true) return false;
|
for(i = 0; i < 3; i++)
|
||||||
CDGT(803,5,(char *) str);
|
scenario.format.ver[i] = me["ver" + std::to_string(i + 1)].getTextAsNum();
|
||||||
str[59] = 0;
|
strncpy(scenario.scen_strs(1), me["who1"].getText().c_str(), 60);
|
||||||
strcpy(scenario.scen_strs(1),(char *) str);
|
scenario.scen_strs(1)[59] = 0;
|
||||||
CDGT(803,6,(char *) str);
|
strncpy(scenario.scen_strs(2), me["who2"].getText().c_str(), 60);
|
||||||
str[59] = 0;
|
scenario.scen_strs(2)[59] = 0;
|
||||||
strcpy(scenario.scen_strs(2),(char *) str);
|
strncpy(scenario.scen_strs(3), me["contact"].getText().c_str(), 256);
|
||||||
CDGT(803,7,scenario.scen_strs(3));
|
scenario.scen_strs(3)[255] = 0;
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void put_scen_details_in_dlog() {
|
static void put_scen_details_in_dlog(cDialog& me) {
|
||||||
#if 0
|
dynamic_cast<cLedGroup&>(me["difficulty"]).setSelected("lvl" + std::to_string(scenario.difficulty + 1));
|
||||||
cd_set_led_range(803,30,33,scenario.difficulty);
|
dynamic_cast<cLedGroup&>(me["rating"]).setSelected("rate" + std::to_string(scenario.rating + 1));
|
||||||
cd_set_led_range(803,21,24,scenario.rating);
|
for(int i = 0; i < 3; i++)
|
||||||
CDSN(803,2,scenario.format.ver[0]);
|
me["ver" + std::to_string(i + 1)].setTextToNum(scenario.format.ver[i]);
|
||||||
CDSN(803,3,scenario.format.ver[1]);
|
me["who1"].setText(scenario.scen_strs(1));
|
||||||
CDSN(803,4,scenario.format.ver[2]);
|
me["who2"].setText(scenario.scen_strs(2));
|
||||||
CDST(803,5,scenario.scen_strs(1));
|
me["contact"].setText(scenario.scen_strs(3));
|
||||||
CDST(803,6,scenario.scen_strs(2));
|
|
||||||
CDST(803,7,scenario.scen_strs(3));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void edit_scen_details_event_filter (short item_hit) {
|
static bool edit_scen_details_event_filter(cDialog& me, std::string, eKeyMod) {
|
||||||
#if 0
|
if(save_scen_details(me))
|
||||||
switch (item_hit) {
|
me.toast(true);
|
||||||
case 8:
|
return true;
|
||||||
if (save_scen_details() == true)
|
|
||||||
toast_dialog();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cd_hit_led_range(803,21,24,item_hit);
|
|
||||||
cd_hit_led_range(803,30,33,item_hit);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void edit_scen_details() {
|
void edit_scen_details() {
|
||||||
#if 0
|
cDialog info_dlg("edit-scenario-details.xml");
|
||||||
// ignore parent in Mac version
|
info_dlg["okay"].attachClickHandler(edit_scen_details_event_filter);
|
||||||
short scen_details_hit;
|
|
||||||
|
|
||||||
cd_create_dialog_parent_num(803,0);
|
put_scen_details_in_dlog(info_dlg);
|
||||||
|
|
||||||
put_scen_details_in_dlog();
|
info_dlg.run();
|
||||||
|
|
||||||
scen_details_hit = cd_run_dialog();
|
|
||||||
cd_kill_dialog(803);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void put_make_scen_1_in_dlog() {
|
void put_make_scen_1_in_dlog() {
|
||||||
#if 0
|
#if 0
|
||||||
CDST(800,2,"Scenario name");
|
CDST(800,2,"Scenario name");
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
<field name='town1' top='100' left='214' width='67' height='16'/>
|
<field name='town1' type='int' top='100' left='214' width='67' height='16'/>
|
||||||
<field name='town2' top='128' left='214' width='67' height='16'/>
|
<field name='town2' type='int' top='128' left='214' width='67' height='16'/>
|
||||||
<field name='town3' top='156' left='214' width='67' height='16'/>
|
<field name='town3' type='int' top='156' left='214' width='67' height='16'/>
|
||||||
<field name='town4' top='184' left='214' width='67' height='16'/>
|
<field name='town4' type='int' top='184' left='214' width='67' height='16'/>
|
||||||
<field name='town5' top='212' left='214' width='67' height='16'/>
|
<field name='town5' type='int' top='212' left='214' width='67' height='16'/>
|
||||||
<field name='town6' top='240' left='214' width='67' height='16'/>
|
<field name='town6' type='int' top='240' left='214' width='67' height='16'/>
|
||||||
<field name='x1' top='100' left='329' width='39' height='16'/>
|
<field name='x1' type='uint' top='100' left='329' width='39' height='16'/>
|
||||||
<field name='x2' top='128' left='329' width='39' height='16'/>
|
<field name='x2' type='uint' top='128' left='329' width='39' height='16'/>
|
||||||
<field name='x3' top='156' left='329' width='39' height='16'/>
|
<field name='x3' type='uint' top='156' left='329' width='39' height='16'/>
|
||||||
<field name='x4' top='184' left='329' width='39' height='16'/>
|
<field name='x4' type='uint' top='184' left='329' width='39' height='16'/>
|
||||||
<field name='x5' top='212' left='329' width='39' height='16'/>
|
<field name='x5' type='uint' top='212' left='329' width='39' height='16'/>
|
||||||
<field name='x6' top='240' left='329' width='39' height='16'/>
|
<field name='x6' type='uint' top='240' left='329' width='39' height='16'/>
|
||||||
<field name='y1' top='100' left='410' width='39' height='16'/>
|
<field name='y1' type='uint' top='100' left='410' width='39' height='16'/>
|
||||||
<field name='y2' top='128' left='410' width='39' height='16'/>
|
<field name='y2' type='uint' top='128' left='410' width='39' height='16'/>
|
||||||
<field name='y3' top='156' left='410' width='39' height='16'/>
|
<field name='y3' type='uint' top='156' left='410' width='39' height='16'/>
|
||||||
<field name='y4' top='184' left='410' width='39' height='16'/>
|
<field name='y4' type='uint' top='184' left='410' width='39' height='16'/>
|
||||||
<field name='y5' top='212' left='410' width='39' height='16'/>
|
<field name='y5' type='uint' top='212' left='410' width='39' height='16'/>
|
||||||
<field name='y6' top='240' left='410' width='39' height='16'/>
|
<field name='y6' type='uint' top='240' left='410' width='39' height='16'/>
|
||||||
<button name='okay' type='regular' top='268' left='468'>OK</button>
|
<button name='okay' type='regular' top='268' left='468'>OK</button>
|
||||||
<text top='268' left='381' width='75' height='16'/>
|
<text top='268' left='381' width='75' height='16'/>
|
||||||
<button name='left' type='left' top='268' left='51'/>
|
<button name='left' type='left' top='268' left='51'/>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='dark' defbtn='okay'>
|
<dialog skin='dark' defbtn='okay'>
|
||||||
<field name="number" type='num' top='36' left='133' width='75' height='16'/>
|
<field name="number" type='uint' top='36' left='133' width='75' height='16'/>
|
||||||
<pict type='dlog' num='2' top='8' left='8'/>
|
<pict type='dlog' num='2' top='8' left='8'/>
|
||||||
<text name='prompt' size='large' top='8' left='49' width='255' height='16'>What day would you like it to be?</text>
|
<text name='prompt' size='large' top='8' left='49' width='255' height='16'>What day would you like it to be?</text>
|
||||||
<button name='okay' type='regular' top='140' left='243'>OK</button>
|
<button name='okay' type='regular' top='140' left='243'>OK</button>
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
<field name='town1' top='143' left='214' width='67' height='16'/>
|
<field name='town1' type='int' top='143' left='214' width='67' height='16'/>
|
||||||
<field name='town2' top='171' left='214' width='67' height='16'/>
|
<field name='town2' type='int' top='171' left='214' width='67' height='16'/>
|
||||||
<field name='town3' top='199' left='214' width='67' height='16'/>
|
<field name='town3' type='int' top='199' left='214' width='67' height='16'/>
|
||||||
<field name='town4' top='227' left='214' width='67' height='16'/>
|
<field name='town4' type='int' top='227' left='214' width='67' height='16'/>
|
||||||
<field name='town5' top='255' left='214' width='67' height='16'/>
|
<field name='town5' type='int' top='255' left='214' width='67' height='16'/>
|
||||||
<field name='town6' top='283' left='214' width='67' height='16'/>
|
<field name='town6' type='int' top='283' left='214' width='67' height='16'/>
|
||||||
<field name='x1' top='143' left='329' width='39' height='16'/>
|
<field name='x1' type='uint' top='143' left='329' width='39' height='16'/>
|
||||||
<field name='x2' top='171' left='329' width='39' height='16'/>
|
<field name='x2' type='uint' top='171' left='329' width='39' height='16'/>
|
||||||
<field name='x3' top='199' left='329' width='39' height='16'/>
|
<field name='x3' type='uint' top='199' left='329' width='39' height='16'/>
|
||||||
<field name='x4' top='227' left='329' width='39' height='16'/>
|
<field name='x4' type='uint' top='227' left='329' width='39' height='16'/>
|
||||||
<field name='x5' top='255' left='329' width='39' height='16'/>
|
<field name='x5' type='uint' top='255' left='329' width='39' height='16'/>
|
||||||
<field name='x6' top='283' left='329' width='39' height='16'/>
|
<field name='x6' type='uint' top='283' left='329' width='39' height='16'/>
|
||||||
<field name='y1' top='143' left='410' width='39' height='16'/>
|
<field name='y1' type='uint' top='143' left='410' width='39' height='16'/>
|
||||||
<field name='y2' top='171' left='410' width='39' height='16'/>
|
<field name='y2' type='uint' top='171' left='410' width='39' height='16'/>
|
||||||
<field name='y3' top='199' left='410' width='39' height='16'/>
|
<field name='y3' type='uint' top='199' left='410' width='39' height='16'/>
|
||||||
<field name='y4' top='227' left='410' width='39' height='16'/>
|
<field name='y4' type='uint' top='227' left='410' width='39' height='16'/>
|
||||||
<field name='y5' top='255' left='410' width='39' height='16'/>
|
<field name='y5' type='uint' top='255' left='410' width='39' height='16'/>
|
||||||
<field name='y6' top='283' left='410' width='39' height='16'/>
|
<field name='y6' type='uint' top='283' left='410' width='39' height='16'/>
|
||||||
<button name='okay' type='regular' top='309' left='463'>OK</button>
|
<button name='okay' type='regular' top='309' left='463'>OK</button>
|
||||||
<button name='left' type='left' top='309' left='52'/>
|
<button name='left' type='left' top='309' left='52'/>
|
||||||
<button name='right' type='right' top='309' left='115'/>
|
<button name='right' type='right' top='309' left='115'/>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<field name='str4' top='221' left='57' width='540' height='39'/>
|
<field name='str4' top='221' left='57' width='540' height='39'/>
|
||||||
<field name='str5' top='267' left='57' width='540' height='39'/>
|
<field name='str5' top='267' left='57' width='540' height='39'/>
|
||||||
<field name='str6' top='313' left='57' width='540' height='39'/>
|
<field name='str6' top='313' left='57' width='540' height='39'/>
|
||||||
<field name='picnum' top='19' left='523' width='70' height='16'/>
|
<field name='picnum' type='uint' top='19' left='523' width='70' height='16'/>
|
||||||
<button name='okay' type='regular' top='358' left='541'>OK</button>
|
<button name='okay' type='regular' top='358' left='541'>OK</button>
|
||||||
<button name='cancel' type='regular' def-key='esc' top='358' left='475'>Cancel</button>
|
<button name='cancel' type='regular' def-key='esc' top='358' left='475'>Cancel</button>
|
||||||
<pict name='pic' type='scen' num='0' top='8' left='8'/>
|
<pict name='pic' type='scen' num='0' top='8' left='8'/>
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
<field name='item1' top='188' left='73' width='39' height='16'/>
|
<field name='item1' type='uint' top='188' left='73' width='39' height='16'/>
|
||||||
<field name='item2' top='216' left='73' width='39' height='16'/>
|
<field name='item2' type='uint' top='216' left='73' width='39' height='16'/>
|
||||||
<field name='item3' top='244' left='73' width='39' height='16'/>
|
<field name='item3' type='uint' top='244' left='73' width='39' height='16'/>
|
||||||
<field name='item4' top='272' left='73' width='39' height='16'/>
|
<field name='item4' type='uint' top='272' left='73' width='39' height='16'/>
|
||||||
<field name='item5' top='300' left='73' width='39' height='16'/>
|
<field name='item5' type='uint' top='300' left='73' width='39' height='16'/>
|
||||||
<field name='item6' top='188' left='309' width='39' height='16'/>
|
<field name='item6' type='uint' top='188' left='309' width='39' height='16'/>
|
||||||
<field name='item7' top='216' left='309' width='39' height='16'/>
|
<field name='item7' type='uint' top='216' left='309' width='39' height='16'/>
|
||||||
<field name='item8' top='244' left='309' width='39' height='16'/>
|
<field name='item8' type='uint' top='244' left='309' width='39' height='16'/>
|
||||||
<field name='item9' top='272' left='309' width='39' height='16'/>
|
<field name='item9' type='uint' top='272' left='309' width='39' height='16'/>
|
||||||
<field name='item10' top='300' left='309' width='39' height='16'/>
|
<field name='item10' type='uint' top='300' left='309' width='39' height='16'/>
|
||||||
<field name='odds1' top='188' left='192' width='39' height='16'/>
|
<field name='odds1' type='uint' top='188' left='192' width='39' height='16'/>
|
||||||
<field name='odds2' top='216' left='192' width='39' height='16'/>
|
<field name='odds2' type='uint' top='216' left='192' width='39' height='16'/>
|
||||||
<field name='odds3' top='244' left='192' width='39' height='16'/>
|
<field name='odds3' type='uint' top='244' left='192' width='39' height='16'/>
|
||||||
<field name='odds4' top='272' left='192' width='39' height='16'/>
|
<field name='odds4' type='uint' top='272' left='192' width='39' height='16'/>
|
||||||
<field name='odds5' top='300' left='192' width='39' height='16'/>
|
<field name='odds5' type='uint' top='300' left='192' width='39' height='16'/>
|
||||||
<field name='odds6' top='188' left='428' width='39' height='16'/>
|
<field name='odds6' type='uint' top='188' left='428' width='39' height='16'/>
|
||||||
<field name='odds7' top='216' left='428' width='39' height='16'/>
|
<field name='odds7' type='uint' top='216' left='428' width='39' height='16'/>
|
||||||
<field name='odds8' top='244' left='428' width='39' height='16'/>
|
<field name='odds8' type='uint' top='244' left='428' width='39' height='16'/>
|
||||||
<field name='odds9' top='272' left='428' width='39' height='16'/>
|
<field name='odds9' type='uint' top='272' left='428' width='39' height='16'/>
|
||||||
<field name='odds10' top='300' left='428' width='39' height='16'/>
|
<field name='odds10' type='uint' top='300' left='428' width='39' height='16'/>
|
||||||
<field name='ter' top='113' left='410' width='42' height='17'/>
|
<field name='ter' type='int' top='113' left='410' width='42' height='17'/>
|
||||||
<button name='okay' type='regular' top='334' left='462'>OK</button>
|
<button name='okay' type='regular' top='334' left='462'>OK</button>
|
||||||
<button name='cancel' type='regular' top='334' left='396' def-key='esc'>Cancel</button>
|
<button name='cancel' type='regular' top='334' left='396' def-key='esc'>Cancel</button>
|
||||||
<button name='right' type='right' top='334' left='73' def-key='right'/>
|
<button name='right' type='right' top='334' left='73' def-key='right'/>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='full' top='30' left='163' width='126' height='16'/>
|
<field name='full' top='30' left='163' width='126' height='16'/>
|
||||||
<field name="short" top='30' left='458' width='125' height='16'/>
|
<field name="short" top='30' left='458' width='125' height='16'/>
|
||||||
<field name='picnum' top='62' left='140' width='52' height='16'/>
|
<field name='picnum' top='62' left='140' width='52' height='16'/>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='poison' top='53' left='206' width='52' height='16'/>
|
<field name='poison' top='53' left='206' width='52' height='16'/>
|
||||||
<field name='breath-str' top='77' left='206' width='52' height='16'/>
|
<field name='breath-str' top='77' left='206' width='52' height='16'/>
|
||||||
<field name='abil-xtra' top='204' left='382' width='53' height='17'/>
|
<field name='abil-xtra' top='204' left='382' width='53' height='17'/>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='name' top='30' left='180' width='186' height='16'/>
|
<field name='name' top='30' left='180' width='186' height='16'/>
|
||||||
<field name='pic' top='57' left='140' width='52' height='16'/>
|
<field name='pic' top='57' left='140' width='52' height='16'/>
|
||||||
<field name='level' top='82' left='206' width='52' height='16'/>
|
<field name='level' top='82' left='206' width='52' height='16'/>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='town1' top='161' left='214' width='67' height='16'/>
|
<field name='town1' top='161' left='214' width='67' height='16'/>
|
||||||
<field name='top1' top='161' left='293' width='39' height='16'/>
|
<field name='top1' top='161' left='293' width='39' height='16'/>
|
||||||
<field name='left1' top='161' left='343' width='39' height='16'/>
|
<field name='left1' top='161' left='343' width='39' height='16'/>
|
||||||
|
|||||||
58
rsrc/dialogs/edit-scenario-details.xml
Normal file
58
rsrc/dialogs/edit-scenario-details.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<field name='ver1' type='uint' top='80' left='181' width='43' height='16'/>
|
||||||
|
<field name='ver2' type='uint' top='80' left='234' width='43' height='16'/>
|
||||||
|
<field name='ver3' type='uint' top='80' left='287' width='43' height='16'/>
|
||||||
|
<field name='who1' top='104' left='181' width='243' height='47'/>
|
||||||
|
<field name='who2' top='159' left='181' width='243' height='47'/>
|
||||||
|
<field name='contact' top='214' left='181' width='243' height='65'/>
|
||||||
|
<button name='okay' type='regular' top='357' left='395'>OK</button>
|
||||||
|
<pict type='dlog' num='16' top='8' left='8'/>
|
||||||
|
<text top='23' left='50' width='372' height='53'>
|
||||||
|
This is where you can define the various pieces of information the user will see when deciding whether or not to play your scenario.
|
||||||
|
The meanings of all these fields are given in the documentation.
|
||||||
|
</text>
|
||||||
|
<text size='large' top='6' left='50' width='256' height='17'>Scenario Details</text>
|
||||||
|
<text top='81' left='50' width='120' height='14'>Version number:</text>
|
||||||
|
<text top='102' left='50' width='120' height='14'>Credits, Part 1:</text>
|
||||||
|
<text top='150' left='50' width='120' height='14'>Credits, Part 2:</text>
|
||||||
|
<text top='213' left='50' width='120' height='14'>Contact Information:</text>
|
||||||
|
<text top='294' left='50' width='120' height='14'>Rating:</text>
|
||||||
|
<!--
|
||||||
|
TODO: Move these LED labels into the LED elements
|
||||||
|
-->
|
||||||
|
<text top='285' left='107' width='23' height='14'>G</text>
|
||||||
|
<text top='301' left='107' width='23' height='14'>PG</text>
|
||||||
|
<text top='318' left='107' width='23' height='14'>R</text>
|
||||||
|
<text top='335' left='107' width='32' height='14'>NC-17</text>
|
||||||
|
<!--
|
||||||
|
NOTE: These LEDs had 18 added to the width of their labels
|
||||||
|
-->
|
||||||
|
<group name='rating'>
|
||||||
|
<led name='rate1' state='off' top='288' left='164' width='41'/>
|
||||||
|
<led name='rate2' state='off' top='305' left='164' width='41'/>
|
||||||
|
<led name='rate3' state='off' top='322' left='164' width='41'/>
|
||||||
|
<led name='rate4' state='off' top='339' left='164' width='50'/>
|
||||||
|
</group>
|
||||||
|
<text top='284' left='199' width='71' height='14'>Difficulty:</text>
|
||||||
|
<!--
|
||||||
|
TODO: Move these LED labels into the LED elements
|
||||||
|
-->
|
||||||
|
<text top='284' left='280' width='76' height='15'>Low Level (1-8)</text>
|
||||||
|
<text top='301' left='281' width='103' height='15'>Medium Level (9-18)</text>
|
||||||
|
<text top='318' left='281' width='76' height='15'>High Level (19-30)</text>
|
||||||
|
<!--
|
||||||
|
TODO: Isn't there a level cap? If so, this should probably say "30-cap" (with cap replaced with the actual cap) rather than 30+.
|
||||||
|
-->
|
||||||
|
<text top='335' left='281' width='76' height='15'>Very High Level (30+)</text>
|
||||||
|
<!--
|
||||||
|
NOTE: These LEDs had 18 added to the width of their labels
|
||||||
|
-->
|
||||||
|
<group name='difficulty'>
|
||||||
|
<led name='lvl1' state='off' top='288' left='423' width='94'/>
|
||||||
|
<led name='lvl2' state='off' top='305' left='423' width='94'/>
|
||||||
|
<led name='lvl3' state='off' top='322' left='423' width='94'/>
|
||||||
|
<led name='lvl4' state='off' top='339' left='423' width='94'/>
|
||||||
|
</group>
|
||||||
|
</dialog>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog defbtn='okay'>
|
<dialog defbtn='okay'>
|
||||||
<field name='num' top='64' left='209' width='75' height='16'/>
|
<field name='num' type='uint' top='64' left='209' width='75' height='16'/>
|
||||||
<pict type='dlog' num='16' top='8' left='8'/>
|
<pict type='dlog' num='16' top='8' left='8'/>
|
||||||
<button name='okay' type='regular' top='87' left='311'>OK</button>
|
<button name='okay' type='regular' top='87' left='311'>OK</button>
|
||||||
<text size='large' top='6' left='50' width='256' height='17'>Set Special Number:</text>
|
<text size='large' top='6' left='50' width='256' height='17'>Set Special Number:</text>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
<field name='name' top='57' left='195' width='252' height='16'/>
|
<field name='name' top='57' left='195' width='252' height='16'/>
|
||||||
<field name='descr' top='84' left='195' width='252' height='104'/>
|
<field name='descr' top='84' left='195' width='252' height='104'/>
|
||||||
<field name='spec' top='249' left='268' width='87' height='16'/>
|
<field name='spec' type='int' top='249' left='268' width='87' height='16'/>
|
||||||
<button name='okay' type='regular' top='288' left='397'>OK</button>
|
<button name='okay' type='regular' top='288' left='397'>OK</button>
|
||||||
<pict type='dlog' num='16' top='8' left='8'/>
|
<pict type='dlog' num='16' top='8' left='8'/>
|
||||||
<text size='large' top='6' left='50' width='256' height='17'>Edit Special Items</text>
|
<text size='large' top='6' left='50' width='256' height='17'>Edit Special Items</text>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog defbtn='okay'>
|
<dialog defbtn='okay'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='sdf1' top='120' left='254' width='51' height='16'/>
|
<field name='sdf1' top='120' left='254' width='51' height='16'/>
|
||||||
<field name='sdf2' top='120' left='510' width='51' height='16'/>
|
<field name='sdf2' top='120' left='510' width='51' height='16'/>
|
||||||
<field name='msg1' top='163' left='270' width='51' height='16'/>
|
<field name='msg1' top='163' left='270' width='51' height='16'/>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
||||||
<dialog skin='light' fore='black' debug='true' defbtn='done'>
|
<dialog skin='light' fore='black' debug='true' defbtn='done'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<text size='large' top='6' left='50' height='17' width='138'>Edit Terrain Type</text>
|
<text size='large' top='6' left='50' height='17' width='138'>Edit Terrain Type</text>
|
||||||
<pict name='graphic' type='ter' num='0' top='8' left='8'/>
|
<pict name='graphic' type='ter' num='0' top='8' left='8'/>
|
||||||
<text top='8' left='222' height='14' width='111'>Terrain number:</text>
|
<text top='8' left='222' height='14' width='111'>Terrain number:</text>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='light' defbtn='okay' debug='true'>
|
<dialog skin='light' defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='town1' top='130' left='146' width='67' height='16'/>
|
<field name='town1' top='130' left='146' width='67' height='16'/>
|
||||||
<field name='town2' top='158' left='146' width='67' height='16'/>
|
<field name='town2' top='158' left='146' width='67' height='16'/>
|
||||||
<field name='town3' top='186' left='146' width='67' height='16'/>
|
<field name='town3' top='186' left='146' width='67' height='16'/>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog defbtn='okay' debug='true'>
|
<dialog defbtn='okay' debug='true'>
|
||||||
|
<!--
|
||||||
|
TODO: Assign numeric types (type = 'int' or 'uint') to fields as appropriate
|
||||||
|
-->
|
||||||
<field name='extra1' top='126' left='221' width='67' height='16'/>
|
<field name='extra1' top='126' left='221' width='67' height='16'/>
|
||||||
<field name='extra2' top='153' left='221' width='67' height='16'/>
|
<field name='extra2' top='153' left='221' width='67' height='16'/>
|
||||||
<field name='death' top='298' left='285' width='67' height='16'/>
|
<field name='death' top='298' left='285' width='67' height='16'/>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<dialog skin='dark' defbtn='okay'>
|
<dialog skin='dark' defbtn='okay'>
|
||||||
<field name="number" type='num' top='127' left='216' width='75' height='16'/>
|
<field name="number" type='uint' top='127' left='216' width='75' height='16'/>
|
||||||
<pict type='dlog' num='2' top='8' left='8'/>
|
<pict type='dlog' num='2' top='8' left='8'/>
|
||||||
<text size='large' top='8' left='49' width='209' height='16'>Changing experience:</text>
|
<text size='large' top='8' left='49' width='209' height='16'>Changing experience:</text>
|
||||||
<text top='27' left='49' width='288' height='67'>
|
<text top='27' left='49' width='288' height='67'>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
<!--<!DOCTYPE dialog SYSTEM "dialog.dtd">-->
|
||||||
<dialog skin='dark' defbtn='okay'>
|
<dialog skin='dark' defbtn='okay'>
|
||||||
<field name="number" type='num' top='33' left='90' width='75' height='16'/>
|
<field name="number" type='int' top='33' left='90' width='75' height='16'/>
|
||||||
<pict type='dlog' num='2' top='8' left='8'/>
|
<pict type='dlog' num='2' top='8' left='8'/>
|
||||||
<text name='prompt' size='large' top='8' left='49' width='163' height='16'>How many?</text>
|
<text name='prompt' size='large' top='8' left='49' width='163' height='16'>How many?</text>
|
||||||
<button name='okay' type='regular' top='63' left='141'>OK</button>
|
<button name='okay' type='regular' top='63' left='141'>OK</button>
|
||||||
|
|||||||
@@ -158,7 +158,9 @@
|
|||||||
<xs:attribute name="type" default="text">
|
<xs:attribute name="type" default="text">
|
||||||
<xs:simpleType>
|
<xs:simpleType>
|
||||||
<xs:restriction base="xs:token">
|
<xs:restriction base="xs:token">
|
||||||
<xs:enumeration value="num"/>
|
<xs:enumeration value="int"/>
|
||||||
|
<xs:enumeration value="uint"/>
|
||||||
|
<xs:enumeration value="real"/>
|
||||||
<xs:enumeration value="text"/>
|
<xs:enumeration value="text"/>
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|||||||
Reference in New Issue
Block a user