Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
TxtAdv/Print_Output.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (39 sloc)
1.28 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "print_menu.h" | |
#include <ncurses.h> | |
#include "window.h" | |
#include "newWindow.h" | |
#include <string> | |
using namespace std; | |
void Print_Output(string inputAction, Window outputWindow, int outputY) | |
{ | |
int x = outputWindow.Start_x - outputWindow.Width + 2; | |
int y = outputWindow.Start_y - outputWindow.Height + 1; | |
string arrows = ">>> "; | |
string message = "You chose " + inputAction; | |
string finalMessage = arrows + message; | |
string output2 = "This resulted in " + inputAction; | |
mvprintw(y+outputY, x, finalMessage.c_str()); | |
mvprintw(y+outputY+1, x, output2.c_str()); | |
} | |
void WindowPrint(string text, Window outputWindow, bool isOutput, int outputY) | |
{ | |
int x = outputWindow.Start_x - outputWindow.Width + 2; | |
int y = outputWindow.Start_y - outputWindow.Height+1; | |
string message = text; | |
if (isOutput) | |
{ | |
message = " >>> " + text; | |
} | |
mvprintw(y+outputY, x, message.c_str()); | |
} | |
void Refresh_Window(Window outputWindow) | |
{ | |
int x = outputWindow.Start_x - outputWindow.Width + 2; | |
int y = outputWindow.Start_y - outputWindow.Height +1; | |
for (int i = 0; i < 18; i++) | |
{ | |
mvprintw(y+i, x, " "); | |
refresh(); | |
} | |
refresh(); | |
} |