diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc index 8afe3eb..ff3d184 100644 --- a/src/mapper/mapper.cc +++ b/src/mapper/mapper.cc @@ -46,6 +46,7 @@ static void edit_mapper(); static void mapper_load_toolbar(int a1, int a2); static void redraw_toolname(); static void clear_toolname(); +static void update_toolname(int* pid, int type, int id); static void update_high_obj_name(Object* obj); static int mapper_mark_exit_grid(); static void mapper_mark_all_exit_grids(); @@ -1408,6 +1409,85 @@ void clear_toolname() redraw_toolname(); } +// 0x48B328 +void update_toolname(int* pid, int type, int id) +{ + Proto* proto; + + *pid = toolbar_proto(type, id); + + if (protoGetProto(*pid, &proto) == -1) { + return; + } + + windowDrawText(tool_win, + protoGetName(proto->pid), + 120, + _scr_size.right - _scr_size.left - 149, + 60, + 260); + + switch (PID_TYPE(proto->pid)) { + case OBJ_TYPE_ITEM: + windowDrawText(tool_win, + gItemTypeNames[proto->item.type], + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + case OBJ_TYPE_CRITTER: + windowDrawText(tool_win, + "", + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + case OBJ_TYPE_WALL: + windowDrawText(tool_win, + proto_wall_light_str(proto->wall.flags), + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + case OBJ_TYPE_TILE: + windowDrawText(tool_win, + "", + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + case OBJ_TYPE_MISC: + windowDrawText(tool_win, + "", + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + default: + windowDrawText(tool_win, + "", + 120, + _scr_size.right - _scr_size.left - 149, + 70, + 260); + break; + } + + windowDrawText(tool_win, + "", + 120, + _scr_size.right - _scr_size.left - 149, + 80, + 260); + + redraw_toolname(); +} + // 0x48B5BC void update_high_obj_name(Object* obj) { diff --git a/src/proto.cc b/src/proto.cc index f266498..0920054 100644 --- a/src/proto.cc +++ b/src/proto.cc @@ -167,7 +167,7 @@ char* _proto_none_str; static char* gBodyTypeNames[BODY_TYPE_COUNT]; // 0x664834 -static char* gItemTypeNames[ITEM_TYPE_COUNT]; +char* gItemTypeNames[ITEM_TYPE_COUNT]; // 0x66484C static char* gDamageTypeNames[DAMAGE_TYPE_COUNT]; diff --git a/src/proto.h b/src/proto.h index f49d1a6..40cded9 100644 --- a/src/proto.h +++ b/src/proto.h @@ -101,6 +101,7 @@ extern char _cd_path_base[COMPAT_MAX_PATH]; extern MessageList gProtoMessageList; extern char* _proto_none_str; +extern char* gItemTypeNames[ITEM_TYPE_COUNT]; void proto_make_path(char* path, int pid); int _proto_list_str(int pid, char* proto_path);