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