From c652312157b834d4c689eefbc43e338be0cc60f2 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 23 Jul 2023 10:01:58 +0300 Subject: [PATCH] Add print_toolbar_name --- src/mapper/mapper.cc | 29 +++++++++++++++++++++++++++++ src/mapper/mapper.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc index 81d7ac7..b74fbef 100644 --- a/src/mapper/mapper.cc +++ b/src/mapper/mapper.cc @@ -1,7 +1,11 @@ #include "mapper/mapper.h" +#include + #include "animation.h" #include "art.h" +#include "color.h" +#include "draw.h" #include "game_mouse.h" #include "inventory.h" #include "object.h" @@ -20,9 +24,34 @@ static void mapper_mark_all_exit_grids(); // 0x559748 MapTransition mapInfo = { -1, -1, 0, 0 }; +// 0x6EC4A8 +unsigned char* tool; + // 0x6EC4AC int tool_win; +// 0x48B16C +void print_toolbar_name(int object_type) +{ + Rect rect; + char name[80]; + + rect.left = 0; + rect.top = 0; + rect.right = 0; + rect.bottom = 22; + bufferFill(tool + 2 + 2 * (_scr_size.right - _scr_size.left) + 2, + 96, + _scr_size.right - _scr_size.left + 1, + 19, + _colorTable[21140]); + + sprintf(name, "%s", artGetObjectTypeName(object_type)); + name[0] = toupper(name[0]); + windowDrawText(tool_win, name, 0, 7, 7, _colorTable[32747] | 0x2000000); + windowRefreshRect(tool_win, &rect); +} + // 0x48B230 void redraw_toolname() { diff --git a/src/mapper/mapper.h b/src/mapper/mapper.h index c85597b..cc106d0 100644 --- a/src/mapper/mapper.h +++ b/src/mapper/mapper.h @@ -8,8 +8,10 @@ namespace fallout { extern MapTransition mapInfo; +extern unsigned char* tool; extern int tool_win; +void print_toolbar_name(int object_type); int mapper_inven_unwield(Object* obj, int right_hand); } // namespace fallout