Fixed inactive messages bug.

This commit is contained in:
Ryan "Lofenyy" Medeiros 2023-07-02 05:03:25 -06:00
parent b0aa6809ef
commit ea0265e200
2 changed files with 13 additions and 9 deletions

View File

@ -28,6 +28,7 @@ uint_fast8_t BtipWalk = 0;
// Show a menu where the user can select their colour // Show a menu where the user can select their colour
int colorPick() int colorPick()
{ {
// Declared Variables
char buffer1[8] = ""; char buffer1[8] = "";
char buffer2[8] = ""; char buffer2[8] = "";
uint_fast8_t a; uint_fast8_t a;
@ -35,6 +36,7 @@ int colorPick()
echo(); echo();
clear(); clear();
// Prompt for foreground colour
mvprintw(0, 0, "Foreground:"); mvprintw(0, 0, "Foreground:");
mvprintw(1, 0, "Black) 0"); mvprintw(1, 0, "Black) 0");
mvprintw(2, 0, "Red) 1"); mvprintw(2, 0, "Red) 1");
@ -47,6 +49,7 @@ int colorPick()
getnstr(buffer1, 8); getnstr(buffer1, 8);
// Prompt for background colour
mvprintw(10, 0, "Background:"); mvprintw(10, 0, "Background:");
mvprintw(11, 0, "Black) 0"); mvprintw(11, 0, "Black) 0");
mvprintw(12, 0, "Red) 1"); mvprintw(12, 0, "Red) 1");
@ -68,6 +71,7 @@ int colorPick()
// Change our tooltip for a different one // Change our tooltip for a different one
int turnTip() int turnTip()
{ {
// Declared Variables
char buffer1[1] = ""; char buffer1[1] = "";
char buffer2[1] = ""; char buffer2[1] = "";
uint_fast8_t walk = 0; uint_fast8_t walk = 0;
@ -158,7 +162,7 @@ int main()
// Start our game engine and start a blank map // Start our game engine and start a blank map
initEngine(); initEngine();
newMap(); newMaps();
// Run through our animation cycle while we draw our tiles. Get and control our input. // Run through our animation cycle while we draw our tiles. Get and control our input.
for (uint_fast8_t A = 0;; A++) for (uint_fast8_t A = 0;; A++)
@ -191,8 +195,8 @@ int main()
map[aMap].Base[C].t); map[aMap].Base[C].t);
attroff(COLOR_PAIR(map[aMap].Base[C].c)); attroff(COLOR_PAIR(map[aMap].Base[C].c));
} }
// If we're hovering over this base tile // If we're hovering over this base tile and it's active
if ((map[aMap].Base[C].x - (xmax / 2) == x) && if ((map[aMap].Base[C].x - (xmax / 2) == x) && (map[aMap].Base[C].active) &&
(map[aMap].Base[C].y - (ymax / 2) == y)) (map[aMap].Base[C].y - (ymax / 2) == y))
{ {
// Print out useful info in the bottom-left screen // Print out useful info in the bottom-left screen
@ -216,7 +220,7 @@ int main()
} }
// If we're hovering over the given info tile // If we're hovering over the given info tile
if ((map[aMap].Info[C].x - (xmax / 2) == x) && if ((map[aMap].Info[C].x - (xmax / 2) == x) && (map[aMap].Info[C].active) &&
(map[aMap].Info[C].y - (ymax / 2) == y)) (map[aMap].Info[C].y - (ymax / 2) == y))
{ {
// Print out its dialog in the bottom left of the screen // Print out its dialog in the bottom left of the screen
@ -238,7 +242,7 @@ int main()
} }
// If we're hovering over the given item tile // If we're hovering over the given item tile
if ((map[aMap].Item[C].x - (xmax / 2) == x) && if ((map[aMap].Item[C].x - (xmax / 2) == x) && (map[aMap].Item[C].active) &&
(map[aMap].Item[C].y - (ymax / 2) == y)) (map[aMap].Item[C].y - (ymax / 2) == y))
{ {
// Print out its the item ID in the bottom left of the screen // Print out its the item ID in the bottom left of the screen
@ -260,7 +264,7 @@ int main()
} }
// If we're hovering over the given item tile // If we're hovering over the given item tile
if ((map[aMap].Door[C].x - (xmax / 2) == x) && if ((map[aMap].Door[C].x - (xmax / 2) == x) && (map[aMap].Door[C].active) &&
(map[aMap].Door[C].y - (ymax / 2) == y)) (map[aMap].Door[C].y - (ymax / 2) == y))
{ {
// Print out useful info in the bottom-left screen // Print out useful info in the bottom-left screen
@ -284,8 +288,8 @@ int main()
attroff(COLOR_PAIR(map[aMap].Char[C].c)); attroff(COLOR_PAIR(map[aMap].Char[C].c));
} }
// If we're hovering over the given item tile // If we're hovering over the given char tile
if ((map[aMap].Char[C].x - (xmax / 2) == x) && if ((map[aMap].Char[C].x - (xmax / 2) == x) && (map[aMap].Char[C].active) &&
(map[aMap].Char[C].y - (ymax / 2) == y)) (map[aMap].Char[C].y - (ymax / 2) == y))
{ {
// Print out useful info in the bottom-left screen // Print out useful info in the bottom-left screen

View File

@ -208,7 +208,7 @@ int delTile(uint_fast16_t x, uint_fast16_t y, uint_fast8_t z, uint_fast8_t xmax,
} }
// Allocate memory for our internal map // Allocate memory for our internal map
int newMap() int newMaps()
{ {
char buffer[1] = ""; char buffer[1] = "";