- 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
146 lines
3.1 KiB
C++
146 lines
3.1 KiB
C++
|
|
#include <cstring>
|
|
#include <cstdio>
|
|
|
|
#include "scen.global.h"
|
|
#include "classes.h"
|
|
#include "graphtool.h"
|
|
#include "scen.graphics.h"
|
|
#include <cmath>
|
|
#include "scen.btnmg.h"
|
|
|
|
//extern piles_of_stuff_dumping_type *data_store;
|
|
extern Rect right_sbar_rect;
|
|
|
|
|
|
|
|
Rect left_button[NLS];
|
|
extern Rect right_buttons[NRSONPAGE];
|
|
Rect right_scrollbar_rect;
|
|
Rect right_area_rect;
|
|
extern short current_rs_top;
|
|
char strings_ls[NLS][40];
|
|
char strings_rs[NRS][40];
|
|
|
|
bool left_buttons_active = 1,right_buttons_active = 0;
|
|
extern short left_button_status[NLS]; // 0 - clear, 1 - text, 2 - title text, 3 - tabbed text, +10 - button
|
|
extern short right_button_status[NRS];
|
|
extern ControlHandle right_sbar;
|
|
// 0 - clear
|
|
// 1000 + x - terrain type x
|
|
// 2000 + x - monster type x
|
|
// 3000 + x - item type x
|
|
// 4000 + x - global special node
|
|
// 5000 + x - out special node
|
|
// 6000 + x - town special node
|
|
// 7000 + x - global string x
|
|
// 8000 + x - out string x
|
|
// 9000 + x - town string x
|
|
// 10000 + x - scen. special item x
|
|
// 11000 + x - charter intro c
|
|
// 12000 + x - dialogue node x
|
|
// 13000 + x - basic dialogue node x
|
|
|
|
|
|
// for following, lb stands for left button(s)
|
|
|
|
void init_lb() {
|
|
short i;
|
|
for (i = 0; i < NLS; i++) {
|
|
left_button_status[i] = 0;
|
|
strcpy((char *) strings_ls[i], "");
|
|
}
|
|
}
|
|
|
|
void reset_lb() {
|
|
short i;
|
|
for (i = 0; i < NLS; i++) {
|
|
left_button_status[i] = 0;
|
|
draw_lb_slot(i,0);
|
|
}
|
|
}
|
|
|
|
// is slot >= 0, force that slot
|
|
// if -1, use 1st free slot
|
|
void set_lb(short slot, short mode, char *label, short do_draw) {
|
|
short i;
|
|
|
|
if (slot < 0) {
|
|
for (i = 0; i < NLS; i++)
|
|
if (left_button_status[i] == 0) {
|
|
slot = i;
|
|
i = NLS + 5000;
|
|
}
|
|
if (i < NLS + 5000)
|
|
return;
|
|
}
|
|
left_button_status[slot] = mode;
|
|
//sprintf((char *)strings_ls[slot], "%-39.39s", label);
|
|
sprintf((char *)strings_ls[slot], "%-50.50s", label);
|
|
strings_ls[slot][39] = 0;
|
|
if (do_draw > 0)
|
|
draw_lb_slot(slot,0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void init_rb() {
|
|
short i;
|
|
|
|
SetControlMinimum(right_sbar,0);
|
|
SetControlValue(right_sbar,0);
|
|
for (i = 0; i < NRS; i++) {
|
|
right_button_status[i] = 0;
|
|
strcpy((char *) strings_rs[i], "");
|
|
}
|
|
}
|
|
|
|
void reset_rb() {
|
|
short i;
|
|
|
|
for (i = 0; i < NRS; i++) {
|
|
right_button_status[i] = 0;
|
|
}
|
|
draw_rb();
|
|
SetControlMaximum(right_sbar,0);
|
|
SetControlValue(right_sbar,0);
|
|
}
|
|
|
|
// is slot >= 0, force that slot
|
|
// if -1, use 1st free slot
|
|
void set_rb(short slot, short mode, char *label, short do_draw) {
|
|
short i;
|
|
|
|
if (slot < 0) {
|
|
for (i = 0; i < NRS; i++)
|
|
if (right_button_status[i] == 0) {
|
|
slot = i;
|
|
i = NRS + 5000;
|
|
}
|
|
if (i < NRS + 5000)
|
|
return;
|
|
}
|
|
right_button_status[slot] = mode;
|
|
//sprintf((char *)strings_rs[slot], "%-39.39s", label);
|
|
sprintf((char *)strings_rs[slot], "%s", label);
|
|
strings_rs[slot][39] = 0;
|
|
for (i = 0; i < 39; i++)
|
|
if (strings_rs[slot][i] == '|')
|
|
strings_rs[slot][i] = ' ';
|
|
if (do_draw > 0)
|
|
draw_rb_slot(slot,0);
|
|
/* for (i = 0; i < NRS; i++)
|
|
if (right_button_status[i] != 0)
|
|
highest_used = i;
|
|
if (highest_used < NRSONPAGE - 1) {
|
|
SetControlMaximum(right_sbar,0);
|
|
current_rs_top = 0;
|
|
}
|
|
else {
|
|
SetControlMaximum(right_sbar,highest_used - NRSONPAGE - 1);
|
|
//SetControlValue(right_sbar,new_setting);
|
|
}*/
|
|
}
|
|
|