From b3b9149592befc9fe8f5349d472fcc0ca1380989 Mon Sep 17 00:00:00 2001 From: Kaehvaman Date: Sat, 26 Oct 2024 18:26:07 +0400 Subject: [PATCH] Minor changes --- lab16/lab16/lab16.cpp | 6 ++++-- lab16/lab16/savefile.txt | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lab16/lab16/lab16.cpp b/lab16/lab16/lab16.cpp index 01c6101..0498409 100644 --- a/lab16/lab16/lab16.cpp +++ b/lab16/lab16/lab16.cpp @@ -344,7 +344,7 @@ int clip(int n, int lower, int upper) { return max(lower, min(n, upper)); } -char count_string[30]; +char count_string[50]; bool netToggle = false; @@ -404,8 +404,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (netToggle) drawNet(hdc); if (selected_element == gold) sprintf(count_string, "gold = %d", inventory[gold]); - else sprintf(count_string, "wall = %d", inventory[wall]); + else if (selected_element == wall) sprintf(count_string, "wall = %d", inventory[wall]); + else sprintf(count_string, "not selected"); + //SetBkColor(hdc, RGB(255, 0, 0)); //SetBkMode(hdc, TRANSPARENT); DrawTextA(hdc, count_string, -1, &textrect, (DT_SINGLELINE | DT_TOP | DT_CENTER)); diff --git a/lab16/lab16/savefile.txt b/lab16/lab16/savefile.txt index 6722302..7544ffa 100644 --- a/lab16/lab16/savefile.txt +++ b/lab16/lab16/savefile.txt @@ -1,13 +1,13 @@ 10 15 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 -0 0 0 3 3 3 3 0 0 0 3 3 0 0 0 -0 0 0 0 0 0 3 0 0 0 3 3 0 0 0 -0 0 0 0 0 0 3 3 3 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 3 0 2 0 0 2 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 2 2 2 2 2 2 2 2 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 18 0 -1 7 3 +3 0 0 0 0 0 0 0 0 0 0 0 0 2 2 +3 0 0 0 0 0 0 0 0 0 0 0 0 2 2 +3 0 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 0 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 0 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 3 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 3 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 3 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 3 0 0 0 0 0 0 0 0 0 0 2 2 2 +3 3 0 0 0 0 0 0 0 0 0 0 2 2 2 +0 0 0 0 +5 4 2