Add target_pick_map_var

This commit is contained in:
Alexander Batalov 2023-07-24 08:17:04 +03:00
parent f6461a44dc
commit ca206da4af
4 changed files with 31 additions and 2 deletions

View File

@ -108,7 +108,7 @@ int* gMapLocalVars = NULL;
// map_vars
// 0x51956C
static int* gMapGlobalVars = NULL;
int* gMapGlobalVars = NULL;
// local_vars_num
// 0x519570
@ -116,7 +116,7 @@ int gMapLocalVarsLength = 0;
// map_vars_num
// 0x519574
static int gMapGlobalVarsLength = 0;
int gMapGlobalVarsLength = 0;
// Current elevation.
//

View File

@ -69,7 +69,9 @@ typedef void IsoWindowRefreshProc(Rect* rect);
extern int gMapSid;
extern int* gMapLocalVars;
extern int* gMapGlobalVars;
extern int gMapLocalVarsLength;
extern int gMapGlobalVarsLength;
extern int gElevation;
extern MessageList gMapMessageList;

View File

@ -4,6 +4,7 @@
#include "art.h"
#include "game.h"
#include "map.h"
#include "proto.h"
#include "window_manager_private.h"
@ -100,4 +101,29 @@ int target_pick_global_var(int* value_ptr)
return 0;
}
// 0x49BE20
int target_pick_map_var(int* value_ptr)
{
int value;
int rc;
if (gMapGlobalVarsLength == 0) {
return -1;
}
rc = win_get_num_i(&value,
0,
gMapGlobalVarsLength - 1,
false,
"Map Variable Index #:",
100,
100);
if (rc == -1) {
return -1;
}
*value_ptr = value;
return 0;
}
} // namespace fallout

View File

@ -10,6 +10,7 @@ int target_init();
int target_exit();
int pick_rot();
int target_pick_global_var(int* value_ptr);
int target_pick_map_var(int* value_ptr);
} // namespace fallout