In no particular order:
- Added some of the most basic dialogs - Changed C-style <xxx.h> headers to C++-style <cxxx> headers - Switched graphics to load from the PNG files in graphics.exd rather than from Blades of Exile Graphics (NOTE: Some graphics still don't work, probably because of incorrect source rects) - Switched cursors to load from GIF files in graphics.exd rather than from Blades of Exile Graphics - Moved Niemand's tileImage functions from boe.graphics.cpp to graphtool.cpp, so they can be used by all three programs. - Added some string lists in .txt files - Made cursors into an enum - Rewrote the code for displaying the Edit Terrain dialog to use the new engine (not tested yet) - Fixed some __attribute__((deprecated)) stuff - Most graphics are now loaded just after the custom graphics. This means they will be overridden by a file of the same name in the scenario's .exr folder. - Altered modes a little so that when at the startup screen you are in MODE_STARTUP rather than MODE_OUTDOORS. - Switched from function pointers to boost::function – the Boost libraries are now required. - Finished off the new dialog engine and made gess necessary - Added status icons as another type that can be drawn in dialogs - C Wrappers for Cocoa cursors based on an Apple example. This is tested, and works perfectly. - Added a switch in the program for using Windows graphics; however, there is no way as yet to set this flag, and in fact there aren't even any Windows graphics to use. - Added include guards to graphtool.h - Made separate mac and win directories within sounds.exa, since the Mac and Windows sounds are mostly subtly different (with two completely different!) git-svn-id: http://openexile.googlecode.com/svn/trunk@90 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -101,8 +101,17 @@ GWorldPtr cButton::buttons[7] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL};
|
||||
Rect cButton::btnRects[13][2];
|
||||
|
||||
void cButton::init(){
|
||||
static const char*const buttonFiles[7] = {
|
||||
"dlogbtnsm.png",
|
||||
"dlogbtnmed.png",
|
||||
"dlogbtnlg.png",
|
||||
"dlogbtntall.png",
|
||||
"dlogbtnhelp.png",
|
||||
"dlogbtnled.png",
|
||||
"dlogbtnred.png"
|
||||
};
|
||||
for(int i = 0; i < 7; i++)
|
||||
buttons[i] = load_pict(i + 2030);
|
||||
buttons[i] = load_pict(buttonFiles[i]);
|
||||
SetRect(&btnRects[BTN_SM][0],0,0,23,23);
|
||||
SetRect(&btnRects[BTN_REG][0],0,0,63,23);
|
||||
SetRect(&btnRects[BTN_LEFT][0],0,23,63,46);
|
||||
@@ -267,7 +276,9 @@ bool cLedGroup::triggerClickHandler(cDialog& me, std::string id, eKeyMod mods, P
|
||||
iter++;
|
||||
}
|
||||
|
||||
if(choices[which_clicked]->triggerClickHandler(me,curSelect,mods,where)){
|
||||
if(which_clicked == "") return false;
|
||||
|
||||
if(choices[which_clicked]->triggerClickHandler(me,which_clicked,mods,where)){
|
||||
eLedState a, b;
|
||||
a = choices[curSelect]->getState();
|
||||
b = choices[which_clicked]->getState();
|
||||
@@ -278,7 +289,7 @@ bool cLedGroup::triggerClickHandler(cDialog& me, std::string id, eKeyMod mods, P
|
||||
choices[which_clicked]->setState(b);
|
||||
return false;
|
||||
}
|
||||
if(!choices[which_clicked]->triggerFocusHandler(me,curSelect,false)){
|
||||
if(!choices[which_clicked]->triggerFocusHandler(me,which_clicked,false)){
|
||||
choices[curSelect]->setState(a);
|
||||
choices[which_clicked]->setState(b);
|
||||
return false;
|
||||
@@ -328,7 +339,17 @@ cLed& cLedGroup::operator[](std::string id){
|
||||
return *(iter->second);
|
||||
}
|
||||
|
||||
void cLedGroup::setSelection(std::string id){
|
||||
void cLedGroup::setSelected(std::string id){
|
||||
if(id == "") { // deselect all
|
||||
eLedState was = choices[curSelect]->getState();
|
||||
choices[curSelect]->setState(led_off);
|
||||
if(choices[curSelect]->triggerFocusHandler(*parent,curSelect,true))
|
||||
curSelect = "";
|
||||
else
|
||||
choices[curSelect]->setState(was);
|
||||
return;
|
||||
}
|
||||
|
||||
ledIter iter = choices.find(id);
|
||||
if(iter == choices.end()) throw std::invalid_argument(id + " does not exist in the ledgroup.");
|
||||
|
||||
@@ -350,7 +371,7 @@ void cLedGroup::setSelection(std::string id){
|
||||
curSelect = iter->first;
|
||||
}
|
||||
|
||||
std::string cLedGroup::getSelection(){
|
||||
std::string cLedGroup::getSelected(){
|
||||
return curSelect;
|
||||
}
|
||||
|
||||
@@ -365,3 +386,12 @@ void cLedGroup::draw(){
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
void cButton::setType(eBtnType newType){
|
||||
if(type == BTN_LED) return; // can't change type
|
||||
type = newType;
|
||||
}
|
||||
|
||||
eBtnType cButton::getType(){
|
||||
return type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user