Add toolbar_proto

This commit is contained in:
Alexander Batalov 2023-09-02 19:47:15 +03:00
parent 84288612ef
commit 9178abc53d
4 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,7 @@
#include "mapper/map_func.h" #include "mapper/map_func.h"
#include "proto.h"
namespace fallout { namespace fallout {
// 0x5595CC // 0x5595CC
@ -17,6 +19,16 @@ void copy_proto_lists()
// TODO: Incomplete. // TODO: Incomplete.
} }
// 0x484400
int toolbar_proto(int type, int id)
{
if (id < proto_max_id(type)) {
return (type << 24) | id;
} else {
return -1;
}
}
// 0x485D44 // 0x485D44
bool map_toggle_block_obj_viewing_on() bool map_toggle_block_obj_viewing_on()
{ {

View File

@ -5,6 +5,7 @@ namespace fallout {
void setup_map_dirs(); void setup_map_dirs();
void copy_proto_lists(); void copy_proto_lists();
int toolbar_proto(int type, int id);
bool map_toggle_block_obj_viewing_on(); bool map_toggle_block_obj_viewing_on();
} // namespace fallout } // namespace fallout

View File

@ -39,7 +39,6 @@ static int _proto_find_free_subnode(int type, Proto** out_ptr);
static void _proto_remove_some_list(int type); static void _proto_remove_some_list(int type);
static void _proto_remove_list(int type); static void _proto_remove_list(int type);
static int _proto_new_id(int type); static int _proto_new_id(int type);
static int _proto_max_id(int type);
// 0x50CF3C // 0x50CF3C
static char _aProto_0[] = "proto\\"; static char _aProto_0[] = "proto\\";
@ -2170,7 +2169,7 @@ static int _proto_new_id(int type)
} }
// 0x4A2214 // 0x4A2214
static int _proto_max_id(int type) int proto_max_id(int type)
{ {
return _protoLists[type].max_entries_num; return _protoLists[type].max_entries_num;
} }

View File

@ -137,6 +137,7 @@ int proto_new(int* pid, int type);
void _proto_remove_all(); void _proto_remove_all();
int protoGetProto(int pid, Proto** protoPtr); int protoGetProto(int pid, Proto** protoPtr);
int _ResetPlayer(); int _ResetPlayer();
int proto_max_id(int type);
static bool isExitGridPid(int pid) static bool isExitGridPid(int pid)
{ {