- Removed the ViewDlog target (since it's deprecated by the new dialog engine)
- Renamed some things for shorter filenames - Moved the license into the doc folder - Cleaned up the project internal hierarchy so that it knows of the external file hierarchy (This should reduce the steps needed to fix bad references when a name is changed.) git-svn-id: http://openexile.googlecode.com/svn/trunk@112 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
BIN
osx/scenedit/BOEScen.rsrc
Normal file
BIN
osx/scenedit/BOEScen.rsrc
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 KiB |
BIN
osx/scenedit/Blades of Exile Graphics
Normal file
BIN
osx/scenedit/Blades of Exile Graphics
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 MiB |
BIN
osx/scenedit/Blades of Exile Sounds
Normal file
BIN
osx/scenedit/Blades of Exile Sounds
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 892 KiB |
45
osx/scenedit/BoE Scenario Editor-Info.plist
Normal file
45
osx/scenedit/BoE Scenario Editor-Info.plist
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>exs</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>boescenario</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Scenario</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>BETM</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>Binary</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>BoE Scenario Editor</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.spidweb.boesceneditor</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>BlEd</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
osx/scenedit/BoE Scenario Editor.icns
Normal file
BIN
osx/scenedit/BoE Scenario Editor.icns
Normal file
Binary file not shown.
BIN
osx/scenedit/bladbase.exs
Normal file
BIN
osx/scenedit/bladbase.exs
Normal file
Binary file not shown.
3699
osx/scenedit/scen.actions.cpp
Normal file
3699
osx/scenedit/scen.actions.cpp
Normal file
File diff suppressed because it is too large
Load Diff
71
osx/scenedit/scen.actions.h
Normal file
71
osx/scenedit/scen.actions.h
Normal file
@@ -0,0 +1,71 @@
|
||||
void init_current_terrain();
|
||||
void init_screen_locs();
|
||||
bool handle_action(Point the_point,EventRecord event);
|
||||
void flash_rect(Rect to_flash);
|
||||
void swap_terrain();
|
||||
void set_new_terrain(ter_num_t selected_terrain);
|
||||
void handle_keystroke(char chr,char chr2,EventRecord event);
|
||||
void get_wandering_monst();
|
||||
void get_town_info();
|
||||
void edit_monst(short mode,short x,short y);
|
||||
void get_sign_resource();
|
||||
void set_info_strings();
|
||||
cTown::cItem edit_item(cTown::cItem item);
|
||||
void modify_lists();
|
||||
void set_up_lights();
|
||||
bool is_wall(short i,short j);
|
||||
bool is_correctable_wall(short i,short j);
|
||||
bool is_mountain(short i,short j);
|
||||
bool is_hill(short i,short j);
|
||||
bool is_hill_or_mountain(short i,short j);
|
||||
bool is_water(short i,short j);
|
||||
bool is_correctable_water(short i,short j);
|
||||
void shy_change_circle_terrain(location center,short radius,ter_num_t terrain_type,short probability);
|
||||
void change_circle_terrain(location center,short radius,ter_num_t terrain_type,short probability);
|
||||
void change_rect_terrain(rectangle r,ter_num_t terrain_type,short probability,bool hollow);
|
||||
void swap_val(unsigned char *val,short a,short b);
|
||||
void change_val_4 (unsigned char *val,short a,short b,short c,short d);
|
||||
void change_val (unsigned char *val,short a,short b);
|
||||
void frill_up_terrain();
|
||||
void unfrill_terrain();
|
||||
void set_terrain(location l,ter_num_t terrain_type);
|
||||
bool fix_rubble(location l);
|
||||
bool fix_cave(location l);
|
||||
bool fix_mountain(location l);
|
||||
bool fix_hill(location l);
|
||||
bool fix_water(location l);
|
||||
bool out_fix_rubble(location l);
|
||||
bool out_fix_cave(location l);
|
||||
bool out_fix_mountain(location l);
|
||||
bool out_fix_hill(location l);
|
||||
bool out_fix_water(location l);
|
||||
void adjust_space(location l);
|
||||
bool is_lava(short x,short y);
|
||||
ter_num_t coord_to_ter(short x,short y);
|
||||
short get_obscurity(short x,short y);
|
||||
short can_see(location p1,location p2,short mode);
|
||||
bool place_item(location spot_hit,short which_item,short property,short always,short odds);
|
||||
void place_items_in_town();
|
||||
void set_up_start_screen();
|
||||
void set_up_main_screen();
|
||||
void start_town_edit();
|
||||
void start_out_edit();
|
||||
void shut_down_menus(short mode);
|
||||
void start_terrain_editing();
|
||||
void start_monster_editing(short just_redo_text);
|
||||
void start_item_editing(short just_redo_text);
|
||||
void start_special_item_editing();
|
||||
void start_string_editing(short mode,short just_redo_text);
|
||||
void start_special_editing(short mode,short just_redo_text);
|
||||
void town_entry(location spot_hit);
|
||||
void start_dialogue_editing(short restoring);
|
||||
bool is_erasable_water(short i,short j);
|
||||
|
||||
bool monst_on_space(location loc,short m_num);
|
||||
void place_edit_special(location loc);
|
||||
void set_special(location spot_hit);
|
||||
bool save_check(short which_dlog);
|
||||
void update_item_menu();
|
||||
|
||||
ter_num_t get_ground_from_ter(ter_num_t ter);
|
||||
bool terrain_matches(unsigned char x, unsigned char y, ter_num_t ter);
|
||||
145
osx/scenedit/scen.btnmg.cpp
Normal file
145
osx/scenedit/scen.btnmg.cpp
Normal file
@@ -0,0 +1,145 @@
|
||||
|
||||
#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);
|
||||
}*/
|
||||
}
|
||||
|
||||
6
osx/scenedit/scen.btnmg.h
Normal file
6
osx/scenedit/scen.btnmg.h
Normal file
@@ -0,0 +1,6 @@
|
||||
void init_lb();
|
||||
void reset_lb();
|
||||
void set_lb(short slot, short mode, char *label, short do_draw) ;
|
||||
void init_rb() ;
|
||||
void reset_rb() ;
|
||||
void set_rb(short slot, short mode, char *label, short do_draw) ;
|
||||
2919
osx/scenedit/scen.core.cpp
Normal file
2919
osx/scenedit/scen.core.cpp
Normal file
File diff suppressed because it is too large
Load Diff
66
osx/scenedit/scen.core.h
Normal file
66
osx/scenedit/scen.core.h
Normal file
@@ -0,0 +1,66 @@
|
||||
cMonster return_monster_template(m_num_t store);
|
||||
//item_record_type convert_item (short_item_record_type s_item) ;
|
||||
void init_scenario() __attribute__((deprecated));
|
||||
short edit_ter_type(short which_ter);
|
||||
//void edit_ter_type_event_filter (short item_hit);
|
||||
bool save_ter_info();
|
||||
void put_ter_info_in_dlog();
|
||||
void put_monst_info_in_dlog();
|
||||
bool save_monst_info();
|
||||
void edit_monst_type_event_filter (short item_hit);
|
||||
short edit_monst_type(short which_monst);
|
||||
void put_monst_abils_in_dlog();
|
||||
bool save_monst_abils();
|
||||
void edit_monst_abil_event_filter (short item_hit);
|
||||
cMonster edit_monst_abil(cMonster starting_record,short parent_num);
|
||||
void put_item_info_in_dlog();
|
||||
bool save_item_info();
|
||||
void edit_item_type_event_filter (short item_hit);
|
||||
short edit_item_type(short which_item);
|
||||
void put_item_abils_in_dlog();
|
||||
bool save_item_abils();
|
||||
void edit_item_abil_event_filter (short item_hit);
|
||||
cItemRec edit_item_abil(cItemRec starting_record,short parent_num);
|
||||
void edit_spec_item(short which_item);
|
||||
void edit_spec_item_event_filter (short spec_item_hit);
|
||||
bool save_spec_item();
|
||||
void put_spec_item_in_dlog();
|
||||
void put_save_rects_in_dlog();
|
||||
bool save_save_rects();
|
||||
void edit_save_rects_event_filter (short save_rects_hit);
|
||||
void edit_save_rects();
|
||||
void edit_horses();
|
||||
void edit_horses_event_filter (short item_hit);
|
||||
void put_horses_in_dlog();
|
||||
bool save_horses();
|
||||
bool save_add_town();
|
||||
void put_add_town_in_dlog();
|
||||
void edit_add_town_event_filter (short item_hit);
|
||||
void edit_add_town();
|
||||
void edit_item_placement();
|
||||
void edit_item_placement_event_filter (short item_hit);
|
||||
void put_item_placement_in_dlog();
|
||||
bool save_item_placement();
|
||||
void edit_scen_details_event_filter (short item_hit);
|
||||
void edit_scen_details();
|
||||
short edit_make_scen_2(short *val_array);
|
||||
void edit_make_scen_2_event_filter (short item_hit);
|
||||
void put_make_scen_2_in_dlog();
|
||||
short edit_make_scen_1(char *filename,char *title,short *grass);
|
||||
void edit_make_scen_1_event_filter (short item_hit);
|
||||
void put_make_scen_1_in_dlog();
|
||||
//short get_password();
|
||||
//void give_password_filter (short item_hit);
|
||||
void edit_scenario_events();
|
||||
void edit_scenario_events_event_filter (short item_hit);
|
||||
void put_scenario_events_in_dlog();
|
||||
bool save_scenario_events();
|
||||
//short enter_password();
|
||||
bool build_scenario();
|
||||
void set_starting_loc_filter (short item_hit);
|
||||
void set_starting_loc();
|
||||
void edit_boats_event_filter (short item_hit);
|
||||
void edit_boats();
|
||||
|
||||
//void user_password_filter (short item_hit);
|
||||
//short wd_to_pwd(Str255 str);
|
||||
46
osx/scenedit/scen.dlgutil.cpp
Normal file
46
osx/scenedit/scen.dlgutil.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
#include "scen.global.h"
|
||||
#include "classes.h"
|
||||
#include "scen.dlgutil.h"
|
||||
|
||||
DialogPtr make_dialog(int resource_num) {
|
||||
DialogPtr the_dialog;
|
||||
|
||||
the_dialog = GetNewDialog (resource_num, 0, IN_FRONT);
|
||||
if (the_dialog == NULL)
|
||||
SysBeep(50);
|
||||
ShowWindow (GetDialogWindow(the_dialog));
|
||||
|
||||
return the_dialog;
|
||||
}
|
||||
|
||||
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num) {
|
||||
Str255 text_entry;
|
||||
short the_type;
|
||||
Handle the_handle = NULL;
|
||||
Rect the_rect;
|
||||
|
||||
NumToString ((long) num_to_put , text_entry);
|
||||
GetDialogItem( the_dialog, item_num, &the_type, &the_handle, &the_rect );
|
||||
SetDialogItemText ( the_handle, text_entry);
|
||||
}
|
||||
|
||||
long get_text_item_num(short item_num,DialogPtr the_dialog) {
|
||||
long storage;
|
||||
long number_given = 0;
|
||||
|
||||
short the_type;
|
||||
Handle the_handle = NULL;
|
||||
Rect the_rect;
|
||||
Str255 the_string;
|
||||
|
||||
GetDialogItem( the_dialog, item_num, &the_type, &the_handle, &the_rect );
|
||||
|
||||
GetDialogItemText ( the_handle, the_string);
|
||||
|
||||
StringToNum( the_string, &number_given);
|
||||
storage = number_given;
|
||||
|
||||
return storage;
|
||||
}
|
||||
|
||||
4
osx/scenedit/scen.dlgutil.h
Normal file
4
osx/scenedit/scen.dlgutil.h
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
DialogPtr make_dialog(int resource_num);
|
||||
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num);
|
||||
long get_text_item_num(short item_num,DialogPtr the_dialog);
|
||||
1611
osx/scenedit/scen.fileio.cpp
Normal file
1611
osx/scenedit/scen.fileio.cpp
Normal file
File diff suppressed because it is too large
Load Diff
27
osx/scenedit/scen.fileio.h
Normal file
27
osx/scenedit/scen.fileio.h
Normal file
@@ -0,0 +1,27 @@
|
||||
void init_directories();
|
||||
void save_scenario();
|
||||
//void load_scenario();
|
||||
void augment_terrain(location to_create);
|
||||
//void load_outdoors(location which_out,short mode);
|
||||
//void load_town(short which_town);
|
||||
void import_town(short which_town,FSSpec temp_file_to_load);
|
||||
void create_basic_scenario();
|
||||
void make_new_scenario(Str255 file_name,short out_width,short out_height,short making_warriors_grove,
|
||||
short use_grass);
|
||||
|
||||
void oops_error(short error);
|
||||
//short init_data(short flag);
|
||||
//short town_s(short flag);
|
||||
//short out_s(short flag);
|
||||
//short str_size_1(short flag);
|
||||
//short str_size_2(short flag);
|
||||
//short str_size_3(short flag);
|
||||
//short get_buf_ptr(short flag);
|
||||
//bool check_p (short pword);
|
||||
//bool check_p2 (short pword);
|
||||
//bool check_p3 (short pword);
|
||||
void reset_pwd();
|
||||
void start_data_dump();
|
||||
//bool import_check_p (short pword);
|
||||
void scen_text_dump();
|
||||
|
||||
290
osx/scenedit/scen.global.h
Normal file
290
osx/scenedit/scen.global.h
Normal file
@@ -0,0 +1,290 @@
|
||||
//#include <vector>
|
||||
//#include <string>
|
||||
//#include "scen.consts.h"
|
||||
|
||||
#define DRAG_EDGE 15
|
||||
#define IN_FRONT (WindowPtr)-1L
|
||||
|
||||
#define DISPLAY_LEFT 23
|
||||
#define DISPLAY_TOP 23
|
||||
#define BITMAP_WIDTH 28
|
||||
#define BITMAP_HEIGHT 36
|
||||
#define NUM_BUTTONS 15
|
||||
|
||||
#define NUM_DLOG_B 53
|
||||
|
||||
#define NLS 25
|
||||
// number of left slots for buttons
|
||||
#define NRS 400
|
||||
// number of right slots for scrolling list
|
||||
#define NRSONPAGE 33
|
||||
// number of right slots for scrolling list on page at 1 time
|
||||
|
||||
#define RIGHT_AREA_UL_X 287
|
||||
#define RIGHT_AREA_UL_Y 5
|
||||
#define RIGHT_AREA_WIDTH 290
|
||||
#define RIGHT_AREA_HEIGHT 400
|
||||
|
||||
#define TER_RECT_UL_X 6
|
||||
#define TER_RECT_UL_Y 19 // Formerly 25
|
||||
|
||||
#define CDGT cd_retrieve_text_edit_str
|
||||
#define CDGN cd_retrieve_text_edit_num
|
||||
#define CDST cd_set_text_edit_str
|
||||
#define CDSN cd_set_text_edit_num
|
||||
|
||||
enum eScenMode {
|
||||
MODE_DRAWING = 0,
|
||||
MODE_SET_WANDER_POINTS = 2,
|
||||
MODE_ROOM_RECT = 3,
|
||||
MODE_PLACE_ITEM = 4,
|
||||
MODE_EDIT_ITEM = 5,
|
||||
MODE_TOGGLE_SPECIAL_DOT = 6, // I suspect that's what this was for, anyway – it currently does nothing
|
||||
MODE_SET_TOWN_START = 7, // unused; for something I'd like to add
|
||||
MODE_PLACE_SAME_CREATURE = 8,
|
||||
MODE_SET_TOWN_RECT = 9,
|
||||
MODE_PLACE_NORTH_ENTRANCE = 10,
|
||||
MODE_PLACE_EAST_ENTRANCE = 11,
|
||||
MODE_PLACE_SOUTH_ENTRANCE = 12,
|
||||
MODE_PLACE_WEST_ENTRANCE = 13,
|
||||
MODE_PLACE_WEB = 20,
|
||||
MODE_PLACE_CRATE = 21,
|
||||
MODE_PLACE_BARREL = 22,
|
||||
MODE_PLACE_FIRE_BARRIER = 23,
|
||||
MODE_PLACE_FORCE_BARRIER = 24,
|
||||
MODE_PLACE_QUICKFIRE = 25,
|
||||
MODE_CLEAR_FIELDS = 26,
|
||||
MODE_PLACE_STONE_BLOCK = 27, // unused; for something I'd like to add
|
||||
MODE_PLACE_CREATURE = 28,
|
||||
MODE_LARGE_PAINTBRUSH = 29, // uncertain
|
||||
MODE_SMALL_PAINTBRUSH = 30, // uncertain
|
||||
MODE_LARGE_SPRAYCAN = 31, // uncertain
|
||||
MODE_SMALL_SPRAYCAN = 32, // uncertain
|
||||
MODE_PLACE_SFX = 33, // eg bloodstain or ashes
|
||||
MODE_EYEDROPPER = 34,
|
||||
MODE_HOLLOW_RECT = 35,
|
||||
MODE_FILLED_RECT = 36,
|
||||
MODE_ERASER = 37,
|
||||
MODE_EDIT_SIGN = 38,
|
||||
MODE_EDIT_CREATURE = 39,
|
||||
MODE_EDIT_SPECIAL = 40, // or create a special if there's none there
|
||||
MODE_COPY_SPECIAL = 41,
|
||||
MODE_PASTE_SPECIAL = 42,
|
||||
MODE_ERASE_SPECIAL = 43,
|
||||
MODE_PLACE_SPECIAL = 44, // or set the special to be called if there's already one there
|
||||
MODE_EDIT_TOWN_ENTRANCE = 45, // for outdoors
|
||||
MODE_PLACE_SAME_ITEM = 46,
|
||||
MODE_SET_OUT_START = 47,
|
||||
MODE_ERASE_CREATURE = 48,
|
||||
MODE_ERASE_ITEM = 49,
|
||||
MODE_MAIN_SCREEN = 60,
|
||||
MODE_INTRO_SCREEN = 61,
|
||||
MODE_EDIT_TYPES = 62, // currently only used for editing terrain, but I'd like to use it for editing monsters and items too.
|
||||
};
|
||||
|
||||
enum eDrawMode {
|
||||
DRAW_TERRAIN = 0,
|
||||
DRAW_MONST = 1,
|
||||
DRAW_ITEM = 2,
|
||||
};
|
||||
|
||||
//typedef struct {
|
||||
// short personality,type;
|
||||
// char link1[4],link2[4];
|
||||
// short extras[4];
|
||||
// } talking_node_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char strlens[200];
|
||||
// talking_node_type talk_nodes[60];
|
||||
// } talking_record_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char monst[4];
|
||||
// } wandering_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char monst[7];
|
||||
// unsigned char friendly[3];
|
||||
// short spec_on_meet,spec_on_win,spec_on_flee,cant_flee;
|
||||
// short end_spec1,end_spec2;
|
||||
//} out_wandering_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char terrain[48][48];
|
||||
// location special_locs[18];
|
||||
// unsigned char special_id[18];
|
||||
// location exit_locs[8];
|
||||
// char exit_dests[8];
|
||||
// location sign_locs[8];
|
||||
// out_wandering_type wandering[4],special_enc[4];
|
||||
// location wandering_locs[4];
|
||||
// Rect info_rect[8];
|
||||
// unsigned char strlens[180];
|
||||
// cSpecial specials[60];
|
||||
// } outdoor_record_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char number;
|
||||
// unsigned char start_attitude;
|
||||
// location start_loc;
|
||||
// unsigned char mobile;
|
||||
// unsigned char time_flag;
|
||||
// unsigned char extra1,extra2;
|
||||
// short spec1, spec2;
|
||||
// char spec_enc_code,time_code;
|
||||
// short monster_time,personality;
|
||||
// short special_on_kill,facial_pic;
|
||||
//
|
||||
// } creature_start_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// location item_loc;
|
||||
// short item_code,ability;
|
||||
// unsigned char charges,always_there,property,contained;
|
||||
// } preset_item_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// location field_loc;
|
||||
// short field_type;
|
||||
// } preset_field_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// short town_chop_time,town_chop_key;
|
||||
// wandering_type wandering[4];
|
||||
// location wandering_locs[4];
|
||||
// location special_locs[50];
|
||||
// unsigned char spec_id[50];
|
||||
// location sign_locs[15];
|
||||
// short lighting;
|
||||
// location start_locs[4];
|
||||
// location exit_locs[4];
|
||||
// short exit_specs[4];
|
||||
// Rect in_town_rect;
|
||||
// preset_item_type preset_items[64];
|
||||
// short max_num_monst;
|
||||
// preset_field_type preset_fields[50];
|
||||
// short spec_on_entry,spec_on_entry_if_dead;
|
||||
// short timer_spec_times[8];
|
||||
// short timer_specs[8];
|
||||
// unsigned char strlens[180];
|
||||
// cSpecial specials[100];
|
||||
// unsigned char specials1,specials2,res1,res2;
|
||||
// short difficulty;
|
||||
// } town_record_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char terrain[64][64];
|
||||
// Rect room_rect[16];
|
||||
// creature_start_type creatures[60];
|
||||
// unsigned char lighting[8][64];
|
||||
// } big_tr_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char terrain[48][48];
|
||||
// Rect room_rect[16];
|
||||
// creature_start_type creatures[40];
|
||||
// unsigned char lighting[6][48];
|
||||
// } ave_tr_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// unsigned char terrain[32][32];
|
||||
// Rect room_rect[16];
|
||||
// creature_start_type creatures[30];
|
||||
// unsigned char lighting[4][32];
|
||||
// } tiny_tr_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// short block_type;
|
||||
// short block_destroy_time;
|
||||
// char block_alignment;
|
||||
// char block_key_time;
|
||||
// location block_loc;
|
||||
// } city_block_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// Rect what_rect;
|
||||
// unsigned char ter_type;
|
||||
// unsigned char hollow;
|
||||
// } city_ter_rect_type;
|
||||
//
|
||||
//typedef struct {
|
||||
// creature_start_type creatures[30];
|
||||
// city_block_type city_block[15];
|
||||
// city_ter_rect_type city_ter_rect[10];
|
||||
// } template_town_type;
|
||||
|
||||
//typedef struct {
|
||||
// cItemRec scen_items[400];
|
||||
// char monst_names[256][20];
|
||||
// char ter_names[256][30];
|
||||
// } scen_item_data_type;
|
||||
|
||||
// for game
|
||||
//typedef struct {
|
||||
// short personality;
|
||||
// short str1,str2;
|
||||
// } talk_save_type;
|
||||
|
||||
|
||||
|
||||
//typedef struct {
|
||||
// short active,attitude;
|
||||
// unsigned char number;
|
||||
// location m_loc;
|
||||
// cMonster m_d;
|
||||
// short mobile;
|
||||
// short summoned;
|
||||
// cTown::cCreature monst_start;
|
||||
// } creature_data_type;
|
||||
|
||||
//typedef struct {
|
||||
// creature_data_type dudes[60];
|
||||
// short which_town;
|
||||
// short friendly;
|
||||
// } creature_list_type;
|
||||
|
||||
//typedef struct {
|
||||
// bool exists;
|
||||
// short direction;
|
||||
// cOutdoors::cWandering what_monst;
|
||||
// location which_sector,m_loc;
|
||||
// } outdoor_creature_type;
|
||||
|
||||
//typedef struct {
|
||||
// long age;
|
||||
// short gold,food;
|
||||
// unsigned char stuff_done[310][10],item_taken[200][8];
|
||||
// short light_level;
|
||||
// location outdoor_corner,i_w_c,p_loc,loc_in_sec;
|
||||
// cVehicle boats[30];
|
||||
// cVehicle horses[30];
|
||||
// creature_list_type creature_save[4];
|
||||
// short in_boat,in_horse;
|
||||
// outdoor_creature_type out_c[10];
|
||||
// cItemRec magic_store_items[5][10];
|
||||
// short imprisoned_monst[4];
|
||||
// char m_seen[256];
|
||||
// char journal_str[50];
|
||||
// short journal_day[50];
|
||||
// short special_notes_str[140][2];
|
||||
// talk_save_type talk_save[120];
|
||||
// short direction,at_which_save_slot;
|
||||
// char alchemy[20];
|
||||
// bool can_find_town[200];
|
||||
// short key_times[100];
|
||||
// short party_event_timers[30];
|
||||
// short global_or_town[30];
|
||||
// short node_to_call[30];
|
||||
// char spec_items[50];
|
||||
// } party_record_type;
|
||||
|
||||
//typedef struct {
|
||||
// char strings_ls[NLS][40];
|
||||
// char strings_rs[NRS][40];
|
||||
// char town_strs[180][256];
|
||||
// char out_strs[120][256];
|
||||
// char scen_strs[270][256];
|
||||
// char talk_strs[170][256];
|
||||
// scen_item_data_type scen_item_list;
|
||||
//} piles_of_stuff_dumping_type;
|
||||
1634
osx/scenedit/scen.graphics.cpp
Normal file
1634
osx/scenedit/scen.graphics.cpp
Normal file
File diff suppressed because it is too large
Load Diff
65
osx/scenedit/scen.graphics.h
Normal file
65
osx/scenedit/scen.graphics.h
Normal file
@@ -0,0 +1,65 @@
|
||||
void Set_up_win ();
|
||||
void run_startup_g();
|
||||
void load_graphics();
|
||||
void load_main_screen();
|
||||
void draw_main_screen();
|
||||
void redraw_screen();
|
||||
void draw_lb();
|
||||
void draw_lb_slot (short which,short mode) ;
|
||||
void draw_rb();
|
||||
void draw_rb_slot (short which,short mode) ;
|
||||
void set_up_terrain_buttons();
|
||||
GWorldPtr load_pict(int picture_to_get);
|
||||
void draw_terrain();
|
||||
void draw_monsts();
|
||||
Rect get_item_template_rect (short type_wanted);
|
||||
void draw_items();
|
||||
void force_tiny_redraw();
|
||||
void redraw_selected_ter();
|
||||
void draw_one_terrain_spot (short i,short j,ter_num_t terrain_to_draw);
|
||||
void draw_one_tiny_terrain_spot (short i,short j,ter_num_t terrain_to_draw);
|
||||
void Draw_Some_Item ( GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,location target,short mode = srcCopy);
|
||||
//void rect_draw_some_item (GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,Rect targ_rect,char masked,short main_win);
|
||||
Rect get_template_rect (unsigned short type_wanted);
|
||||
void draw_frames();
|
||||
void place_location();
|
||||
void place_just_location();
|
||||
void set_string(char *string,char *string2);
|
||||
void undo_clip();
|
||||
bool is_special(short i,short j);
|
||||
void take_special(short i,short j);
|
||||
void make_special(short i,short j);
|
||||
void sort_specials();
|
||||
bool is_field_type(short i,short j,short field_type);
|
||||
void make_field_type(short i,short j,short field_type);
|
||||
void take_field_type(short i,short j,short field_type);
|
||||
bool is_web(short i,short j);
|
||||
void make_web(short i,short j);
|
||||
void take_web(short i,short j);
|
||||
bool is_crate(short i,short j);
|
||||
void make_crate(short i,short j);
|
||||
void take_crate(short i,short j);
|
||||
bool is_barrel(short i,short j);
|
||||
void make_barrel(short i,short j);
|
||||
void take_barrel(short i,short j);
|
||||
bool is_fire_barrier(short i,short j);
|
||||
void make_fire_barrier(short i,short j);
|
||||
void take_fire_barrier(short i,short j);
|
||||
bool is_force_barrier(short i,short j);
|
||||
void make_force_barrier(short i,short j);
|
||||
void take_force_barrier(short i,short j);
|
||||
bool is_sfx(short i,short j,short type);
|
||||
void make_sfx(short i,short j,short type);
|
||||
void take_sfx(short i,short j,short type);
|
||||
bool is_quickfire(short i,short j);
|
||||
void make_quickfire(short i,short j);
|
||||
void take_quickfire(short i,short j);
|
||||
bool container_there(location l);
|
||||
bool is_spot(short i,short j);
|
||||
//void get_str(Str255 str,short i, short j);
|
||||
short string_length(char *str);
|
||||
Rect get_custom_rect (short which_rect);
|
||||
GWorldPtr load_bmp(unsigned char *data, long length);
|
||||
void init_dialogs();
|
||||
void record_display_strings();
|
||||
void init_sheets();
|
||||
1285
osx/scenedit/scen.keydlgs.cpp
Normal file
1285
osx/scenedit/scen.keydlgs.cpp
Normal file
File diff suppressed because it is too large
Load Diff
37
osx/scenedit/scen.keydlgs.h
Normal file
37
osx/scenedit/scen.keydlgs.h
Normal file
@@ -0,0 +1,37 @@
|
||||
void fancy_choice_dialog_event_filter (short item_hit);
|
||||
short fancy_choice_dialog(short which_dlog,short parent);
|
||||
void display_strings_event_filter (short item_hit);
|
||||
bool cre(short val,short min,short max,char *text1, char *text2,short parent_num) ;
|
||||
void give_error(char *text1, char *text2,short parent_num);
|
||||
void display_strings_event_filter (short item_hit);
|
||||
void display_strings(char *text1, char *text2,
|
||||
char *title,short sound_num,short graphic_num,short graphic_type,short parent_num);
|
||||
void choose_graphic_event_filter (short item_hit);
|
||||
void put_choice_pics(short g_type);
|
||||
short choose_graphic(short first_g,short last_g,short cur_choice,short g_type,short parent_num);
|
||||
void put_text_res();
|
||||
short choose_text_res(short res_list,short first_t,short last_t,short cur_choice,short parent_num,char *title);
|
||||
void choose_text_res_event_filter (short item_hit);
|
||||
void edit_text_event_filter (short item_hit);
|
||||
void edit_text_str(short which_str,short mode);
|
||||
bool save_spec_enc();
|
||||
void put_spec_enc_in_dlog();
|
||||
void edit_spec_enc_event_filter (short item_hit);
|
||||
void edit_spec_enc(short which_node,short mode,short parent_num);
|
||||
short get_fresh_spec(short which_mode);
|
||||
void edit_spec_text_event_filter (short item_hit);
|
||||
void edit_spec_text(short mode,short *str1,short *str2,short parent);
|
||||
void edit_dialog_text(short mode,short *str1,short parent);
|
||||
void edit_spec_text(short mode,short *str1,short *str2,short parent);
|
||||
void edit_special_num_event_filter (short item_hit);
|
||||
short edit_special_num(short mode,short what_start);
|
||||
void edit_scen_intro_event_filter (short item_hit);
|
||||
void edit_scen_intro();
|
||||
short choice_dialog(short pic,short num);
|
||||
bool edit_area_rect_str(short which_str,short mode);
|
||||
void edit_area_rect_event_filter (short item_hit);
|
||||
void make_cursor_sword() ;
|
||||
void edit_dialog_text_event_filter (short item_hit);
|
||||
void edit_dialog_text(short mode,short *str1,short parent);
|
||||
void set_cursor(short which_c) ;
|
||||
void restore_cursor();
|
||||
910
osx/scenedit/scen.main.cpp
Normal file
910
osx/scenedit/scen.main.cpp
Normal file
@@ -0,0 +1,910 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "scen.global.h"
|
||||
#include "classes.h"
|
||||
#include "graphtool.h"
|
||||
#include "scen.graphics.h"
|
||||
#include "scen.actions.h"
|
||||
#include "scen.fileio.h"
|
||||
#include "dlgtool.h"
|
||||
#include "scen.btnmg.h"
|
||||
#include "soundtool.h"
|
||||
#include "scen.townout.h"
|
||||
#include "scen.core.h"
|
||||
#include "scen.keydlgs.h"
|
||||
#include "mathutil.h"
|
||||
#include "fileio.h"
|
||||
|
||||
cUniverse univ; // not needed; just to silence the compiler
|
||||
|
||||
/* Globals */
|
||||
Rect windRect, Drag_Rect;
|
||||
bool All_Done = false; // delete play_sounds
|
||||
EventRecord event;
|
||||
WindowPtr mainPtr;
|
||||
cTown* town = NULL;
|
||||
//big_tr_type t_d;
|
||||
bool diff_depth_ok = false,mouse_button_held = false,editing_town = false;
|
||||
short cur_viewing_mode = 0;
|
||||
//short town_type = 0; // 0 - big 1 - ave 2 - small
|
||||
//short max_dim[3] = {64,48,32};
|
||||
short cen_x, cen_y;
|
||||
eScenMode overall_mode = MODE_INTRO_SCREEN;
|
||||
Handle menu_bar_handle;
|
||||
ControlHandle right_sbar;
|
||||
short mode_count = 0;
|
||||
MenuHandle apple_menu;
|
||||
cOutdoors current_terrain;
|
||||
//cSpeech talking;
|
||||
//short given_password;
|
||||
//short user_given_password = -1;
|
||||
short pixel_depth,old_depth = 8;
|
||||
|
||||
ter_num_t border1 = 90, border2 = 90; // kludgy thing ... leave right here, before borders
|
||||
ter_num_t borders[4][50];
|
||||
|
||||
bool change_made = false;
|
||||
|
||||
// Numbers of current areas being edited
|
||||
short cur_town;
|
||||
location cur_out;
|
||||
|
||||
/* Prototypes */
|
||||
int main(void);
|
||||
void Initialize(void);
|
||||
void Set_Window_Drag_Bdry();
|
||||
void Handle_One_Event();
|
||||
void Handle_Activate();
|
||||
void Handle_Update();
|
||||
void handle_menu_choice(long choice);
|
||||
void handle_apple_menu(int item_hit);
|
||||
void handle_file_menu(int item_hit);
|
||||
void handle_scenario_menu(int item_hit);
|
||||
void handle_town_menu(int item_hit);
|
||||
void handle_outdoor_menu(int item_hit);
|
||||
void handle_item_menu(int item_hit);
|
||||
void handle_monst_menu(int item_hit);
|
||||
void handle_help_menu(int item_hit);
|
||||
pascal void right_sbar_action(ControlHandle bar, short part);
|
||||
void Mouse_Pressed();
|
||||
void close_program();
|
||||
void ding();
|
||||
void set_pixel_depth();
|
||||
void restore_depth();
|
||||
void find_quickdraw() ;
|
||||
|
||||
cScenario scenario;
|
||||
//piles_of_stuff_dumping_type *data_store;
|
||||
Rect right_sbar_rect;
|
||||
void check_for_intel();
|
||||
bool mac_is_intel;
|
||||
|
||||
//
|
||||
// Main body of program Exileedit
|
||||
//
|
||||
|
||||
//Changed to ISO C specified argument and return type.
|
||||
int main() {
|
||||
//outdoor_record_type dummy_outdoor, *store2;
|
||||
|
||||
|
||||
//data_store = (piles_of_stuff_dumping_type *) NewPtr(sizeof(piles_of_stuff_dumping_type));
|
||||
init_current_terrain();
|
||||
//create_file();
|
||||
//ExitToShell();
|
||||
|
||||
init_directories();
|
||||
Initialize();
|
||||
init_fileio();
|
||||
init_snd_tool();
|
||||
load_graphics();
|
||||
|
||||
init_dialogs();
|
||||
init_graph_tool(redraw_screen);
|
||||
|
||||
cen_x = 18;
|
||||
cen_y = 18;
|
||||
|
||||
run_startup_g();
|
||||
init_lb();
|
||||
init_rb();
|
||||
init_town(1);
|
||||
init_out();
|
||||
init_scenario();
|
||||
|
||||
make_cursor_sword();
|
||||
|
||||
Set_Window_Drag_Bdry();
|
||||
|
||||
Set_up_win();
|
||||
init_screen_locs();
|
||||
|
||||
//create_basic_scenario();
|
||||
|
||||
menu_bar_handle = GetNewMBar(128);
|
||||
if (menu_bar_handle == NULL) {
|
||||
SysBeep(50);
|
||||
SysBeep(50);
|
||||
SysBeep(50);
|
||||
ExitToShell();
|
||||
}
|
||||
SetMenuBar(menu_bar_handle);
|
||||
DisposeHandle(menu_bar_handle);
|
||||
|
||||
apple_menu = GetMenuHandle(500);
|
||||
/*file_menu = GetMenuHandle(550);
|
||||
options_menu = GetMenuHandle(600);
|
||||
create_menu = GetMenuHandle(650);
|
||||
items_menu = GetMenuHandle(700);*/
|
||||
|
||||
AppendResMenu(apple_menu, 'DRVR');
|
||||
shut_down_menus(0);
|
||||
DrawMenuBar();
|
||||
|
||||
//update_item_menu();
|
||||
|
||||
// to_create = get_town_to_edit();
|
||||
|
||||
// load_terrain(to_create);
|
||||
|
||||
// modify_lists();
|
||||
set_up_start_screen();
|
||||
|
||||
TextFace(bold);
|
||||
check_for_intel();
|
||||
redraw_screen();
|
||||
|
||||
while (All_Done == false)
|
||||
Handle_One_Event();
|
||||
|
||||
close_program();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Initialize everything for the program, make sure we can run
|
||||
//
|
||||
|
||||
//MW specified argument and return type.
|
||||
void Initialize(void) {
|
||||
|
||||
Str255 tit = " ";
|
||||
|
||||
|
||||
/* Initialize all the needed managers. */
|
||||
InitCursor();
|
||||
|
||||
//
|
||||
// To make the Random sequences truly random, we need to make the seed start
|
||||
// at a different number. An easy way to do this is to put the current time
|
||||
// and date into the seed. Since it is always incrementing the starting seed
|
||||
// will always be different. Don’t for each call of Random, or the sequence
|
||||
// will no longer be random. Only needed once, here in the init.
|
||||
//
|
||||
//unsigned long time;
|
||||
//GetDateTime(&time);
|
||||
//SetQDGlobalsRandomSeed(time);
|
||||
srand(time(NULL));
|
||||
|
||||
//
|
||||
// Make a new window for drawing in, and it must be a color window.
|
||||
// The window is full screen size, made smaller to make it more visible.
|
||||
//
|
||||
BitMap bmap;
|
||||
GetQDGlobalsScreenBits(&bmap);
|
||||
windRect = bmap.bounds;
|
||||
|
||||
find_quickdraw();
|
||||
set_pixel_depth();
|
||||
|
||||
//InsetRect(&windRect, 5, 34);
|
||||
InsetRect(&windRect,(windRect.right - 584) / 2,(windRect.bottom - 420) / 2);
|
||||
OffsetRect(&windRect,0,18);
|
||||
mainPtr = NewCWindow(nil, &windRect, "\pBlades of Exile Scenario Editor", true, noGrowDocProc,
|
||||
(WindowPtr) -1, false, 0);
|
||||
GetWindowPortBounds(mainPtr,&windRect);
|
||||
SetPortWindowPort(mainPtr); /* set window to current graf port */
|
||||
right_sbar_rect.top = RIGHT_AREA_UL_Y;
|
||||
right_sbar_rect.left = RIGHT_AREA_UL_X + RIGHT_AREA_WIDTH - 1 - 16;
|
||||
right_sbar_rect.bottom = RIGHT_AREA_UL_Y + RIGHT_AREA_HEIGHT;
|
||||
right_sbar_rect.right = RIGHT_AREA_UL_X + RIGHT_AREA_WIDTH - 1;
|
||||
right_sbar = NewControl(mainPtr,&right_sbar_rect,tit,true,0,0,0,scrollBarProc,1);
|
||||
|
||||
}
|
||||
|
||||
void check_for_intel(){
|
||||
long response;
|
||||
OSErr err;
|
||||
err = Gestalt(gestaltSysArchitecture,&response);
|
||||
if(err != noErr){
|
||||
printf("Gestalt error %i\n",err);
|
||||
exit(1);
|
||||
}
|
||||
if(response == gestaltIntel) mac_is_intel = true;
|
||||
else mac_is_intel = false;
|
||||
}
|
||||
|
||||
void Set_Window_Drag_Bdry() {
|
||||
BitMap bmap;
|
||||
GetQDGlobalsScreenBits(&bmap);
|
||||
Drag_Rect = bmap.bounds;
|
||||
// Drag_Rect = (**(GrayRgn)).rgnBBox;
|
||||
Drag_Rect.left += DRAG_EDGE;
|
||||
Drag_Rect.right -= DRAG_EDGE;
|
||||
Drag_Rect.bottom -= DRAG_EDGE;
|
||||
}
|
||||
|
||||
void Handle_One_Event() {
|
||||
short chr,chr2;
|
||||
long menu_choice;
|
||||
|
||||
|
||||
WaitNextEvent(everyEvent, &event, 0, NULL);
|
||||
if ((mouse_button_held == true) && (event.what != 23) && (FrontWindow() == mainPtr)) {
|
||||
GlobalToLocal(&event.where);
|
||||
handle_action(event.where,event);
|
||||
}
|
||||
|
||||
|
||||
switch (event.what)
|
||||
{
|
||||
case keyDown: case autoKey:
|
||||
chr = event.message & charCodeMask;
|
||||
chr2 = (char) ((event.message & keyCodeMask) >> 8);
|
||||
if ((event.modifiers & cmdKey) != 0) {
|
||||
if (event.what != autoKey) {
|
||||
BringToFront(mainPtr);
|
||||
SetPortWindowPort(mainPtr);
|
||||
menu_choice = MenuKey(chr);
|
||||
handle_menu_choice(menu_choice);
|
||||
}
|
||||
}
|
||||
else if (chr == 'Q')
|
||||
All_Done = true;
|
||||
else handle_keystroke(chr,chr2,event);
|
||||
break;
|
||||
|
||||
case mouseDown:
|
||||
Mouse_Pressed();
|
||||
break;
|
||||
|
||||
|
||||
case mouseUp:
|
||||
mouse_button_held = false;
|
||||
break;
|
||||
|
||||
case activateEvt:
|
||||
Handle_Activate();
|
||||
break;
|
||||
|
||||
case updateEvt:
|
||||
Handle_Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Handle_Activate() {
|
||||
restore_cursor();
|
||||
}
|
||||
|
||||
void Handle_Update() {
|
||||
WindowPtr the_window;
|
||||
GrafPtr old_port;
|
||||
|
||||
the_window = (WindowPtr) event.message;
|
||||
|
||||
GetPort (&old_port);
|
||||
SetPortWindowPort(the_window);
|
||||
|
||||
BeginUpdate(the_window);
|
||||
|
||||
redraw_screen();
|
||||
EndUpdate(the_window);
|
||||
|
||||
SetPort(old_port);
|
||||
restore_cursor();
|
||||
}
|
||||
|
||||
void handle_menu_choice(long choice) {
|
||||
int menu,menu_item;
|
||||
|
||||
if (choice != 0) {
|
||||
menu = HiWord(choice);
|
||||
menu_item = LoWord(choice);
|
||||
|
||||
set_cursor(wand_curs);
|
||||
switch (menu) {
|
||||
case 500:
|
||||
handle_apple_menu(menu_item);
|
||||
break;
|
||||
case 550:
|
||||
handle_file_menu(menu_item);
|
||||
break;
|
||||
case 600:
|
||||
handle_scenario_menu(menu_item);
|
||||
break;
|
||||
case 650:
|
||||
handle_town_menu(menu_item);
|
||||
break;
|
||||
case 651:
|
||||
handle_outdoor_menu(menu_item);
|
||||
break;
|
||||
case 675:
|
||||
handle_help_menu(menu_item);
|
||||
break;
|
||||
case 700: case 701: case 702: case 703: case 704:
|
||||
handle_item_menu(menu_item + 80 * (menu - 700) - 1);
|
||||
break;
|
||||
case 750: case 751: case 752: case 753:
|
||||
handle_monst_menu(menu_item + 64 * (menu - 750) - 1);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
HiliteMenu(0);
|
||||
}
|
||||
|
||||
void handle_apple_menu(int item_hit) {
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
fancy_choice_dialog(1062,0);
|
||||
break;
|
||||
default:
|
||||
// GetItem (apple_menu,item_hit,desk_acc_name);
|
||||
// desk_acc_num = OpenDeskAcc(desk_acc_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void handle_file_menu(int item_hit) {
|
||||
switch (item_hit) {
|
||||
case 1: // open
|
||||
try{
|
||||
FSSpec file_to_load = nav_get_scenario();
|
||||
if (load_scenario(file_to_load)) {
|
||||
if(load_town(scenario.last_town_edited,town))
|
||||
cur_town = scenario.last_town_edited;
|
||||
if(load_outdoors(scenario.last_out_edited,current_terrain)){
|
||||
cur_out = scenario.last_out_edited;
|
||||
augment_terrain(cur_out);
|
||||
}
|
||||
overall_mode = MODE_MAIN_SCREEN;
|
||||
change_made = false;
|
||||
update_item_menu();
|
||||
set_up_main_screen();
|
||||
}
|
||||
} catch(no_file_chosen){}
|
||||
break;
|
||||
case 2: // save
|
||||
modify_lists();
|
||||
save_scenario();
|
||||
break;
|
||||
case 3: // new scen
|
||||
build_scenario();
|
||||
if (overall_mode == MODE_MAIN_SCREEN)
|
||||
set_up_main_screen();
|
||||
break;
|
||||
|
||||
case 5: // quit
|
||||
if (save_check(869) == false)
|
||||
break;
|
||||
ExitToShell();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_scenario_menu(int item_hit) {
|
||||
short i;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1: // Create new town
|
||||
if (change_made == true) {
|
||||
give_error("You need to save the changes made to your scenario before you can add a new town.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (scenario.num_towns >= 200) {
|
||||
give_error("You have reached the limit of 200 towns you can have in one scenario.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (new_town(scenario.num_towns) == true)
|
||||
set_up_main_screen();
|
||||
break;
|
||||
case 3: // Scenario Details
|
||||
edit_scen_details();
|
||||
break;
|
||||
case 4: // Scenario Intro Text
|
||||
edit_scen_intro();
|
||||
break;
|
||||
case 5: // Set Starting Location
|
||||
set_starting_loc();
|
||||
break;
|
||||
case 6: // Change Password
|
||||
// if (check_p(user_given_password) == true) {
|
||||
// user_given_password = get_password();
|
||||
// given_password = true;
|
||||
// }
|
||||
give_error("Passwords have been disabled; they are no longer necessary.","",0);
|
||||
break;
|
||||
case 9: // Edit Special Nodes
|
||||
SetControlValue(right_sbar,0);
|
||||
start_special_editing(0,0);
|
||||
break;
|
||||
case 10: // Edit Scenario Text
|
||||
SetControlValue(right_sbar,0);
|
||||
start_string_editing(0,0);
|
||||
break;
|
||||
case 11: // Import Town
|
||||
if (change_made == true) {
|
||||
give_error("You need to save the changes made to your scenario before you can add a new town.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
FSSpec file;
|
||||
i = pick_import_town(0,&file);
|
||||
if (i >= 0) {
|
||||
import_town(i,file);
|
||||
change_made = true;
|
||||
redraw_screen();
|
||||
}
|
||||
break;
|
||||
case 12: // Edit Saved Item Rectangles
|
||||
edit_save_rects();
|
||||
break;
|
||||
case 13: // Edit Horses
|
||||
edit_horses();
|
||||
break;
|
||||
case 14: // Edit Boats
|
||||
edit_boats();
|
||||
break;
|
||||
case 15: // Set Variable Town Entry
|
||||
edit_add_town();
|
||||
break;
|
||||
case 16: // Set Scenario Event Timers
|
||||
edit_scenario_events();
|
||||
break;
|
||||
case 17: // Edit Item Placement Shortcuts
|
||||
edit_item_placement();
|
||||
break;
|
||||
case 18: // Delete Last Town
|
||||
if (change_made == true) {
|
||||
give_error("You need to save the changes made to your scenario before you can delete a town.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (scenario.num_towns == 1) {
|
||||
give_error("You can't delete the last town in a scenario. All scenarios must have at least 1 town.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (scenario.num_towns - 1 == cur_town) {
|
||||
give_error("You can't delete the last town in a scenario while you're working on it. Load a different town, and try this again.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (scenario.num_towns - 1 == scenario.which_town_start) {
|
||||
give_error("You can't delete the last town in a scenario while it's the town the party starts the scenario in. Change the parties starting point and try this again.",
|
||||
"",0);
|
||||
return;
|
||||
}
|
||||
if (fancy_choice_dialog(865,0) == 1)
|
||||
delete_last_town();
|
||||
break;
|
||||
case 19: // Write Data to Text File
|
||||
if (fancy_choice_dialog(866,0) == 1)
|
||||
start_data_dump();
|
||||
break;
|
||||
case 20: // Do Full Text Dump
|
||||
if (fancy_choice_dialog(871,0) == 1)
|
||||
scen_text_dump();
|
||||
redraw_screen();
|
||||
break;
|
||||
}
|
||||
if ((item_hit != 18) && (item_hit != 19))
|
||||
change_made = true;
|
||||
}
|
||||
|
||||
void handle_town_menu(int item_hit) {
|
||||
short i;
|
||||
|
||||
change_made = true;
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
edit_town_details();
|
||||
break;
|
||||
case 2:
|
||||
edit_town_wand();
|
||||
break;
|
||||
case 3:
|
||||
overall_mode = MODE_SET_TOWN_RECT;
|
||||
mode_count = 2;
|
||||
set_cursor(topleft_curs);
|
||||
set_string("Set town boundary","Select upper left corner");
|
||||
break;
|
||||
case 4:
|
||||
frill_up_terrain();
|
||||
break;
|
||||
case 5:
|
||||
unfrill_terrain();
|
||||
break;
|
||||
case 6:
|
||||
edit_town_strs();
|
||||
break;
|
||||
case 8:
|
||||
if (fancy_choice_dialog(863,0) == 2)
|
||||
break;
|
||||
place_items_in_town();
|
||||
break; // add random
|
||||
case 9:
|
||||
for (i = 0; i < 64; i++)
|
||||
town->preset_items[i].property = 0;
|
||||
fancy_choice_dialog(861,0);
|
||||
draw_terrain();
|
||||
break; // set not prop
|
||||
case 10:
|
||||
if (fancy_choice_dialog(862,0) == 2)
|
||||
break;
|
||||
for (i = 0; i < 64; i++)
|
||||
town->preset_items[i].code = -1;
|
||||
draw_terrain();
|
||||
break; // clear all items
|
||||
case 13:
|
||||
SetControlValue(right_sbar,0);
|
||||
start_special_editing(2,0);
|
||||
break;
|
||||
case 14:
|
||||
SetControlValue(right_sbar,0);
|
||||
start_string_editing(2,0);
|
||||
break;
|
||||
case 15:
|
||||
edit_advanced_town();
|
||||
break;
|
||||
case 16:
|
||||
edit_town_events();
|
||||
break;
|
||||
}
|
||||
}
|
||||
void handle_outdoor_menu(int item_hit) {
|
||||
change_made = true;
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
outdoor_details();
|
||||
break;
|
||||
case 2:
|
||||
edit_out_wand(0);
|
||||
break;
|
||||
case 3:
|
||||
edit_out_wand(1);
|
||||
break;
|
||||
case 4:
|
||||
frill_up_terrain();
|
||||
break;
|
||||
case 5:
|
||||
unfrill_terrain();
|
||||
break;
|
||||
case 6:
|
||||
edit_out_strs();
|
||||
break;
|
||||
case 8:
|
||||
overall_mode = MODE_SET_OUT_START;
|
||||
set_string("Select party starting location.","");
|
||||
break;
|
||||
case 11:
|
||||
SetControlValue(right_sbar,0);
|
||||
start_special_editing(1,0);
|
||||
break;
|
||||
case 12:
|
||||
SetControlValue(right_sbar,0);
|
||||
start_string_editing(1,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_help_menu(int item_hit) {
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
fancy_choice_dialog(986,0);
|
||||
break; // started
|
||||
case 2:
|
||||
fancy_choice_dialog(1000,0);
|
||||
break; // testing
|
||||
case 3:
|
||||
fancy_choice_dialog(1001,0);
|
||||
break; // distributing
|
||||
case 5:
|
||||
fancy_choice_dialog(1002,0);
|
||||
break; // contest
|
||||
}
|
||||
}
|
||||
|
||||
void handle_item_menu(int item_hit) {
|
||||
if (scenario.scen_items[item_hit].variety == 0) {
|
||||
give_error("This item has its Variety set to No Item. You can only place items with a Variety set to an actual item type.","",0);
|
||||
return;
|
||||
}
|
||||
overall_mode = MODE_PLACE_ITEM;
|
||||
set_string("Place the item.","Select item location");
|
||||
mode_count = item_hit;
|
||||
}
|
||||
|
||||
void handle_monst_menu(int item_hit) {
|
||||
overall_mode = MODE_PLACE_CREATURE;
|
||||
set_string("Place the monster.","Select monster location");
|
||||
mode_count = item_hit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
pascal void right_sbar_action(ControlHandle bar, short part) {
|
||||
short old_setting,new_setting,max;
|
||||
|
||||
if (part == 0)
|
||||
return;
|
||||
|
||||
old_setting = GetControlValue(bar);
|
||||
new_setting = old_setting;
|
||||
max = GetControlMaximum(bar);
|
||||
|
||||
switch (part) {
|
||||
case kControlUpButtonPart:
|
||||
new_setting--;
|
||||
break;
|
||||
case kControlDownButtonPart:
|
||||
new_setting++;
|
||||
break;
|
||||
case kControlPageUpPart:
|
||||
new_setting -= NRSONPAGE - 1;
|
||||
break;
|
||||
case kControlPageDownPart:
|
||||
new_setting += NRSONPAGE - 1;
|
||||
break;
|
||||
}
|
||||
new_setting = minmax(0,max,new_setting);
|
||||
SetControlValue(bar,new_setting);
|
||||
if (new_setting != old_setting)
|
||||
draw_rb();
|
||||
}
|
||||
|
||||
void Mouse_Pressed() {
|
||||
WindowPtr the_window;
|
||||
short the_part,content_part;
|
||||
long menu_choice;
|
||||
BitMap bmap;
|
||||
ControlHandle control_hit;
|
||||
|
||||
the_part = FindWindow( event.where, &the_window);
|
||||
|
||||
switch (the_part)
|
||||
{
|
||||
case inMenuBar:
|
||||
menu_choice = MenuSelect(event.where);
|
||||
handle_menu_choice(menu_choice);
|
||||
break;
|
||||
|
||||
case inSysWindow:
|
||||
break;
|
||||
|
||||
case inDrag:
|
||||
GetQDGlobalsScreenBits(&bmap);
|
||||
DragWindow(the_window, event.where, &(bmap.bounds));
|
||||
break;
|
||||
|
||||
case inGoAway:
|
||||
All_Done = true;
|
||||
break;
|
||||
|
||||
case inContent:
|
||||
SetPortWindowPort(mainPtr);
|
||||
GlobalToLocal(&event.where);
|
||||
content_part = FindControl(event.where,the_window,&control_hit); // hit sbar?
|
||||
if (content_part != 0) {
|
||||
switch (content_part) {
|
||||
case kControlIndicatorPart:
|
||||
content_part = TrackControl(control_hit,event.where,NULL);
|
||||
if (control_hit == right_sbar)
|
||||
if (content_part == kControlIndicatorPart) {
|
||||
draw_rb();
|
||||
}
|
||||
|
||||
break;
|
||||
case kControlUpButtonPart: case kControlPageUpPart:
|
||||
case kControlDownButtonPart: case kControlPageDownPart:
|
||||
if (control_hit == right_sbar)
|
||||
content_part = TrackControl(control_hit,event.where,(ControlActionUPP)right_sbar_action);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} // a control hit
|
||||
else // ordinary click
|
||||
All_Done = handle_action(event.where,event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void close_program() {
|
||||
restore_depth();
|
||||
if(town != NULL) delete town;
|
||||
clean_up_graphtool();
|
||||
}
|
||||
|
||||
void ding() {
|
||||
SysBeep(1);
|
||||
}
|
||||
|
||||
//pascal bool cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit)
|
||||
//{
|
||||
// char chr,chr2;
|
||||
// short the_type,wind_hit,item_hit;
|
||||
// Handle the_handle = NULL;
|
||||
// Rect the_rect,button_rect;
|
||||
// Point the_point;
|
||||
// WindowRef w;
|
||||
// RgnHandle rgn;
|
||||
//
|
||||
// dummy_item_hit = 0;
|
||||
//
|
||||
// switch (event->what) {
|
||||
// case updateEvt:
|
||||
// w = GetDialogWindow(hDlg);
|
||||
// rgn = NewRgn();
|
||||
// GetWindowRegion(w,kWindowUpdateRgn,rgn);
|
||||
// if (EmptyRgn(rgn) == true) {
|
||||
// DisposeRgn(rgn);
|
||||
// return true;
|
||||
// }
|
||||
// DisposeRgn(rgn);
|
||||
// BeginUpdate(w);
|
||||
// cd_redraw(w);
|
||||
// EndUpdate(w);
|
||||
// DrawDialog(hDlg);
|
||||
// return false;
|
||||
// break;
|
||||
//
|
||||
// case keyDown:
|
||||
// chr = event->message & charCodeMask;
|
||||
// chr2 = (char) ((event->message & keyCodeMask) >> 8);
|
||||
// switch (chr2) {
|
||||
// case 126: chr = 22; break;
|
||||
// case 124: chr = 21; break;
|
||||
// case 123: chr = 20; break;
|
||||
// case 125: chr = 23; break;
|
||||
// case 53: chr = 24; break;
|
||||
// case 36: chr = 31; break;
|
||||
// case 76: chr = 31; break;
|
||||
// }
|
||||
// // specials ... 20 - <- 21 - -> 22 up 23 down 24 esc
|
||||
// // 25-30 ctrl 1-6 31 - return
|
||||
//
|
||||
// wind_hit = cd_process_keystroke(GetDialogWindow(hDlg),chr,&item_hit);
|
||||
// break;
|
||||
//
|
||||
// case mouseDown:
|
||||
// the_point = event->where;
|
||||
// GlobalToLocal(&the_point);
|
||||
// cd_process_click(GetDialogWindow(hDlg),the_point, event->modifiers,&item_hit);
|
||||
// wind_hit = -1;
|
||||
// break;
|
||||
//
|
||||
// case mouseUp:
|
||||
// the_point = event->where;
|
||||
// GlobalToLocal(&the_point);
|
||||
// wind_hit = cd_process_click(GetDialogWindow(hDlg),the_point, event->modifiers,&item_hit);
|
||||
// break;
|
||||
//
|
||||
// default: wind_hit = -1; break;
|
||||
// }
|
||||
//// switch (wind_hit) {
|
||||
//// case -1: break;
|
||||
//// //case 958: _event_filter(item_hit); break;
|
||||
//// case 970: case 971: case 972: case 973: display_strings_event_filter(item_hit); break;
|
||||
//// case 800: edit_make_scen_1_event_filter(item_hit); break;
|
||||
//// case 801: edit_make_scen_2_event_filter(item_hit); break;
|
||||
//// case 802: user_password_filter(item_hit); break;
|
||||
//// case 803: edit_scen_details_event_filter(item_hit); break;
|
||||
//// case 804: edit_scen_intro_event_filter(item_hit); break;
|
||||
//// case 805: set_starting_loc_filter(item_hit); break;
|
||||
//// case 806: edit_spec_item_event_filter(item_hit); break;
|
||||
//// case 807: edit_save_rects_event_filter(item_hit); break;
|
||||
//// case 808: edit_horses_event_filter(item_hit); break;
|
||||
//// case 809: edit_boats_event_filter(item_hit); break;
|
||||
//// case 810: edit_add_town_event_filter(item_hit); break;
|
||||
//// case 811: edit_scenario_events_event_filter(item_hit); break;
|
||||
//// case 812: edit_item_placement_event_filter(item_hit); break;
|
||||
//// case 813: edit_ter_type_event_filter(item_hit); break;
|
||||
//// case 814: edit_monst_type_event_filter(item_hit); break;
|
||||
//// case 815: edit_monst_abil_event_filter(item_hit); break;
|
||||
//// case 816: edit_text_event_filter(item_hit); break;
|
||||
//// case 817: edit_talk_node_event_filter(item_hit); break;
|
||||
//// case 818: edit_item_type_event_filter(item_hit); break;
|
||||
//// case 819: choose_graphic_event_filter(item_hit); break;
|
||||
//// case 820: choose_text_res_event_filter(item_hit); break;
|
||||
//// case 821: edit_basic_dlog_event_filter(item_hit); break;
|
||||
//// case 822: edit_spec_enc_event_filter(item_hit); break;
|
||||
//// case 823: give_password_filter(item_hit); break;
|
||||
//// case 824: edit_item_abil_event_filter(item_hit); break;
|
||||
//// case 825: edit_special_num_event_filter(item_hit); break;
|
||||
//// case 826: edit_spec_text_event_filter(item_hit); break;
|
||||
//// case 830: new_town_event_filter(item_hit); break;
|
||||
//// case 831: edit_sign_event_filter(item_hit); break;
|
||||
//// case 832: edit_town_details_event_filter(item_hit); break;
|
||||
//// case 833: edit_town_events_event_filter(item_hit); break;
|
||||
//// case 834: edit_advanced_town_event_filter(item_hit); break;
|
||||
//// case 835: edit_town_wand_event_filter(item_hit); break;
|
||||
//// case 836: edit_placed_item_event_filter(item_hit); break;
|
||||
//// case 837: edit_placed_monst_event_filter(item_hit); break;
|
||||
//// case 838: edit_placed_monst_adv_event_filter(item_hit); break;
|
||||
//// case 839: edit_town_strs_event_filter(item_hit); break;
|
||||
//// case 840: edit_area_rect_event_filter(item_hit); break;
|
||||
//// case 841: pick_import_town_event_filter(item_hit); break;
|
||||
//// case 842: edit_dialog_text_event_filter(item_hit); break;
|
||||
//// case 850: edit_out_strs_event_filter(item_hit); break;
|
||||
//// case 851: outdoor_details_event_filter(item_hit); break;
|
||||
//// case 852: edit_out_wand_event_filter(item_hit); break;
|
||||
//// case 854: pick_out_event_filter(item_hit); break;
|
||||
//// case 855: case 856: pick_town_num_event_filter(item_hit); break;
|
||||
//// case 857: change_ter_event_filter(item_hit); break;
|
||||
//// default: fancy_choice_dialog_event_filter (item_hit); break;
|
||||
//// }
|
||||
//
|
||||
// if (wind_hit == -1)
|
||||
// return false;
|
||||
// else return true;
|
||||
//}
|
||||
|
||||
void set_pixel_depth() {
|
||||
GDHandle cur_device;
|
||||
PixMapHandle screen_pixmap_handle;
|
||||
cur_device = GetGDevice();
|
||||
|
||||
|
||||
screen_pixmap_handle = (**(cur_device)).gdPMap;
|
||||
pixel_depth = (**(screen_pixmap_handle)).pixelSize;
|
||||
|
||||
if ((pixel_depth <= 8) && (diff_depth_ok == true))
|
||||
return;
|
||||
|
||||
|
||||
diff_depth_ok = true;
|
||||
old_depth = pixel_depth;
|
||||
}
|
||||
|
||||
void restore_depth() {
|
||||
GDHandle cur_device;
|
||||
PixMapHandle screen_pixmap_handle;
|
||||
OSErr err;
|
||||
cur_device = GetGDevice();
|
||||
|
||||
screen_pixmap_handle = (**(cur_device)).gdPMap;
|
||||
|
||||
if (old_depth != 8) {
|
||||
|
||||
err = SetDepth(cur_device,old_depth,1,1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void find_quickdraw() {
|
||||
OSErr err;
|
||||
long response;
|
||||
short choice;
|
||||
|
||||
err = Gestalt(gestaltQuickdrawVersion, &response);
|
||||
if (err == noErr) {
|
||||
if (response == 0x000) {
|
||||
choice = choice_dialog(0,1070);
|
||||
if (choice == 2)
|
||||
ExitToShell();
|
||||
else diff_depth_ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
SysBeep(2);
|
||||
ExitToShell();
|
||||
}
|
||||
}
|
||||
1612
osx/scenedit/scen.townout.cpp
Normal file
1612
osx/scenedit/scen.townout.cpp
Normal file
File diff suppressed because it is too large
Load Diff
62
osx/scenedit/scen.townout.h
Normal file
62
osx/scenedit/scen.townout.h
Normal file
@@ -0,0 +1,62 @@
|
||||
void init_town(short size) __attribute__((deprecated));
|
||||
void init_out() __attribute__((deprecated));
|
||||
void edit_placed_monst(short which_m);
|
||||
void edit_placed_monst_event_filter (short item_hit);
|
||||
bool get_placed_monst_in_dlog();
|
||||
void put_placed_monst_in_dlog();
|
||||
cCreature edit_placed_monst_adv(cCreature monst_record);
|
||||
void edit_placed_monst_adv_event_filter (short item_hit);
|
||||
bool get_placed_monst_adv_in_dlog();
|
||||
void put_placed_monst_adv_in_dlog();
|
||||
void edit_sign(short which_sign,short picture);
|
||||
void edit_sign_event_filter (short item_hit);
|
||||
bool save_out_strs();
|
||||
void put_out_strs_in_dlog();
|
||||
void edit_out_strs_event_filter (short item_hit);
|
||||
void edit_out_strs();
|
||||
bool save_town_strs();
|
||||
void put_town_strs_in_dlog();
|
||||
void edit_town_strs_event_filter (short item_hit);
|
||||
void edit_town_strs();
|
||||
void pick_town_num_event_filter (short item_hit);
|
||||
short pick_town_num(short which_dlog,short def);
|
||||
void change_ter(short *change_from,short *change_to,short *chance);
|
||||
void change_ter_event_filter (short item_hit);
|
||||
void edit_out_wand(short mode);
|
||||
void edit_out_wand_event_filter (short item_hit);
|
||||
bool get_out_wand_in_dlog();
|
||||
void put_out_wand_in_dlog();
|
||||
void outdoor_details_event_filter (short item_hit);
|
||||
void outdoor_details();
|
||||
void edit_town_details();
|
||||
void edit_town_details_event_filter (short item_hit);
|
||||
void put_town_details_in_dlog();
|
||||
bool save_town_details();
|
||||
void edit_town_events();
|
||||
void edit_town_events_event_filter (short item_hit);
|
||||
void put_town_events_in_dlog();
|
||||
bool save_town_events();
|
||||
void edit_advanced_town();
|
||||
void edit_advanced_town_event_filter (short item_hit);
|
||||
void put_advanced_town_in_dlog();
|
||||
bool save_advanced_town();
|
||||
void edit_basic_dlog(short which_node);
|
||||
void edit_basic_dlog_event_filter (short item_hit);
|
||||
void put_basic_dlog_in_dlog();
|
||||
bool save_basic_dlog();
|
||||
void edit_talk_node(short which_node,short parent_num);
|
||||
void edit_talk_node_event_filter (short item_hit);
|
||||
void put_talk_node_in_dlog();
|
||||
bool save_talk_node();
|
||||
void pick_out_event_filter (short item_hit);
|
||||
short pick_out(location default_loc);
|
||||
void pick_import_town_event_filter (short item_hit);
|
||||
short pick_import_town(short def,FSSpec* temp_file_to_load);
|
||||
bool new_town(short which_town);
|
||||
void new_town_event_filter (short item_hit);
|
||||
void edit_placed_item_event_filter (short item_hit);
|
||||
void edit_placed_item(short which_i);
|
||||
|
||||
void delete_last_town();
|
||||
void edit_town_wand_event_filter (short item_hit);
|
||||
void edit_town_wand();
|
||||
20
osx/scenedit/strings/arena-names.txt
Normal file
20
osx/scenedit/strings/arena-names.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
Grassy field
|
||||
Ordinary cave
|
||||
Mountain
|
||||
Surface bridge
|
||||
Cave bridge
|
||||
Rubble-strewn cave
|
||||
Cave tree forest
|
||||
Cave mushrooms
|
||||
Cave swamp
|
||||
Surface rocks
|
||||
Surface swamp
|
||||
Surface woods
|
||||
Shrubbery
|
||||
Stalagmites
|
||||
Cave fumarole
|
||||
Curface fumarole
|
||||
Cave road
|
||||
Surface road
|
||||
Hills road
|
||||
Crops
|
||||
24
osx/scenedit/strings/ter-flag1.txt
Normal file
24
osx/scenedit/strings/ter-flag1.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Small Icon
|
||||
What to change to?
|
||||
Amount of damage done
|
||||
Unused
|
||||
Graphic when occupied
|
||||
Strength (1-8)
|
||||
Unused
|
||||
Terrain to change to
|
||||
Terrain to change to when locked
|
||||
Terrain to change to when unlocked
|
||||
Unused
|
||||
Unused
|
||||
Number of special to call
|
||||
Unused
|
||||
Unused
|
||||
Direction
|
||||
Direction
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Terrain type if hidden
|
||||
Terrain to change to when used
|
||||
Number of special to call
|
||||
24
osx/scenedit/strings/ter-flag2.txt
Normal file
24
osx/scenedit/strings/ter-flag2.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Unused
|
||||
Number of sound (99 - no sound)
|
||||
Damage multiplier
|
||||
Unused
|
||||
Unused
|
||||
Percentage chance
|
||||
Unused
|
||||
Strength
|
||||
Unused
|
||||
Difficulty (0-4 L, 5-9 M, 10 I)
|
||||
Unused
|
||||
Unused
|
||||
Type of special (0 - local, 1 - town/global, 2 - out/global, 3 - global)
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Number of sound (99 - no sound)
|
||||
Type of special (0 - local, 1 - town/global, 2 - out/global, 3 - global)
|
||||
24
osx/scenedit/strings/ter-flag3.txt
Normal file
24
osx/scenedit/strings/ter-flag3.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Unused
|
||||
Unused
|
||||
Damage type
|
||||
Unused
|
||||
Unused
|
||||
Status type
|
||||
Unused
|
||||
Method (1 - Move Mountains, 2 - quickfire, 0 - either)
|
||||
Unused
|
||||
Can be bashed? (0 - can't, 1 - can)
|
||||
Unused
|
||||
Unused
|
||||
Small icon
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
Unused
|
||||
19
osx/scenedit/strings/trim-names.txt
Normal file
19
osx/scenedit/strings/trim-names.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
Not a trim
|
||||
Wall (round off corners)
|
||||
South edge trim
|
||||
Southeast outer corner trim
|
||||
East edge trim
|
||||
Northeast outer corner trim
|
||||
North edge trim
|
||||
Northwest outer corner trim
|
||||
West edge trim
|
||||
Southwest outer corner trim
|
||||
Northeast inner corner trim
|
||||
Southeast inner corner trim
|
||||
Southwest inner corner trim
|
||||
Northwest inner corner trim
|
||||
Frills (draw edge frills)
|
||||
Road (connect with roads)
|
||||
Walkway (round off corners)
|
||||
Waterfall (both wall and water)
|
||||
City trim (connect to roads)
|
||||
Reference in New Issue
Block a user