Misc debug mode tweaks

- Disable debug/ghost mode when scenario ends and when loading a saved game
- Show location works in combat mode
- Edit/view SDF and enter town now use numeric response dialog
- Refreshing stores/towns no longer works outside of debug mode
- Ghost mode works in combat
This commit is contained in:
2014-12-10 20:16:54 -05:00
parent e8c2654bad
commit f0066dd76e
3 changed files with 19 additions and 12 deletions

View File

@@ -1388,6 +1388,8 @@ bool handle_action(sf::Event event)
if (end_scenario) {
reload_startup();
overall_mode = MODE_STARTUP;
in_scen_debug = false;
ghost_mode = false;
draw_startup(0);
menu_activate();
univ.party.scen_name = ""; // should be harmless...
@@ -1856,7 +1858,10 @@ bool handle_keystroke(sf::Event& event){
short y = univ.party.p_loc.y;
x += 48 * univ.party.outdoor_corner.x;
y += 48 * univ.party.outdoor_corner.y;
sout << "Debug: You're outside at x " << x << ", y " << y << ',';
sout << "Debug: You're outside at x " << x << ", y " << y << '.';
} else if(is_combat()) {
location loc = pc_pos[current_pc];
sout << "Debug: You're in combat at x " << loc.x << ", y " << loc.y << '.';
}
add_string_to_buf(sout.str());
print_buf();
@@ -1908,14 +1913,11 @@ bool handle_keystroke(sf::Event& event){
case 'S': // TODO: Create a dedicated dialog for this.
if (!in_scen_debug) break;
cStrDlog("Enter Stuff Done Flag Part A (between 1 and 299)","","Which SDFa ?",130,PIC_DLOG).show();
i = atoi(get_text_response().c_str());
if(i > 0 && i < 300){
cStrDlog("Enter Stuff Done Flag Part B (between 0 and 49)","","Which SDFb ?",130,PIC_DLOG).show();
j = atoi(get_text_response().c_str());
i = get_num_response(0,299,"Enter SDF Part A");
if(i >= 0 && i < 300){
j = get_num_response(0,49,"Enter SDF Part B");
if(j >= 0 && j < 50){
cStrDlog("Enter Stuff Done Flag Value (up to 255)","","Which value ?",130,PIC_DLOG).show();
int x = atoi(get_text_response().c_str());
int x = get_num_response(-1,255,"Enter SDF Value or -1 to print");
if(x < 256 && x >= 0)
PSD[i][j] = x;
else if(x == -1){
@@ -1929,7 +1931,8 @@ bool handle_keystroke(sf::Event& event){
case 'T':
if(!in_scen_debug) break;
short find_direction_from;
i = atoi(get_text_response(sout.str(), 130).c_str());
sout << "Enter Town Number (between 0 and " << scenario.num_towns - 1 << ')';
i = get_num_response(0, scenario.num_towns - 1, "Enter Town Number");
if(i >= 0 && i < scenario.num_towns ){
if (univ.party.direction == 0) find_direction_from = 2;
else if (univ.party.direction == 4) find_direction_from = 0;
@@ -1940,6 +1943,7 @@ bool handle_keystroke(sf::Event& event){
break;
case 'W':
if(!in_scen_debug) break;
refresh_store_items();
add_string_to_buf("Debug: Refreshed jobs/shops. ");
print_buf();
@@ -1961,6 +1965,7 @@ bool handle_keystroke(sf::Event& event){
put_pc_screen();
break;
case '>':
if(!in_scen_debug) break;
ASB("DEBUG: Towns have short memory.");
ASB("Your deeds have been forgotten.");
print_buf();

View File

@@ -29,6 +29,7 @@
//extern big_tr_type t_d;
//extern town_item_list t_i;
extern eGameMode overall_mode;
extern bool ghost_mode;
extern short which_combat_type;
extern short stat_window;
extern location center;
@@ -448,8 +449,7 @@ bool pc_combat_move(location destination) ////
if (check_f == true)
forced = true;
if (spec_num == 50)
forced = true;
if(in_scen_debug && ghost_mode) forced = true;
if (keep_going == true) {

View File

@@ -33,7 +33,7 @@
//extern unsigned char out[96][96],out_e[96][96];
extern short give_delays,stat_screen_mode;
extern eGameMode overall_mode;
extern bool play_sounds,sys_7_avail,save_maps,party_in_memory,in_scen_debug;
extern bool play_sounds,sys_7_avail,save_maps,party_in_memory,in_scen_debug,ghost_mode;
//extern current_town_type c_town;
//extern town_item_list t_i;
extern location center;
@@ -102,6 +102,8 @@ void finish_load_party(){
bool in_scen = univ.party.scen_name.length() > 0;
party_in_memory = true;
in_scen_debug = false;
ghost_mode = false;
// now if not in scen, this is it.
if (!in_scen) {