Skip to content

Commit 2620540

Browse files
Merge pull request #3 from rforzachamp821/Ryan_WorkingBranch
Ryan working branch v0.8.0 update PR
2 parents 70ee81b + 95955a5 commit 2620540

28 files changed

+1159
-187
lines changed

CommandFiles/CommandFileAssets.cpp

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,19 @@ void RGBColourPresets() {
215215
// Also has tutorial directions text support.
216216
//
217217
void help(bool bFromTutorial) {
218-
ScreenNavigateEngine sneHelp;
218+
// Output title
219+
CentreColouredText(" ___HELP___ ", 1);
220+
std::cout << "\n\n";
219221

220-
sneHelp.nSizeOfScreens = 4;
221-
std::string sScreens[] =
222-
{
223-
"___LIST OF COMMANDS___\n\nTo see more info about a command, type in \"<command> -h\". This will work for all commands, except: echo and title.\n\n"
222+
// Output subheading and information about commands to display help commands under
223+
colourSubheading();
224+
std::cout << wordWrap("___LIST OF COMMANDS___") << NOULINE_STR;
225+
colour(LCYN, ConfigObjMain.sColourGlobalBack);
226+
std::cout << wordWrap("\n\nTo see more info about a command, type in \"<command> -h\". This will work for all commands, except: echo and title.\n\n");
227+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
228+
229+
// Output help commands
230+
std::cout <<
224231
"[1] Help\t\t[16] Stopwatch\t\t[31] Shutdown\t\t[46] Edison\n"
225232
"[2] Exit\t\t[17] Read\t\t[32] Reboot\t\t[47] Tesla\n"
226233
"[3] Tutorial\t\t[18] Timer\t\t[33] Hibernate\t\t[48] Cow\n"
@@ -232,19 +239,26 @@ void help(bool bFromTutorial) {
232239
"[9] Settings\t\t[24] ConfigAction\t[39] SlowChar\t\t[54] Factorial\n"
233240
"[10] Title\t\t[25] BeepSounds\t\t[40] ReverseText\t[55] CalcQuadratic\n"
234241
"[11] Date\t\t[26] RickRoll\t\t[41] Notes\t\t[56] Y2038\n"
235-
"[12] ColourNumbers\t[27] ShellExecute\t[42] FileParse\n"
236-
"[13] MediaPlayer\t[28] Hacker\t\t[43] Disp\n"
237-
"[14] AudioPlayer\t[29] Calculator\t\t[44] SysInfo\n"
238-
"[15] TTS\t\t[30] Logoff\t\t[45] Einstein\n"
242+
"[12] ColourNumbers\t[27] ShellExecute\t[42] FileParse\t\t[57] PiOutput\n"
243+
"[13] MediaPlayer\t[28] Hacker\t\t[43] Disp\t\t[58] Spam\n"
244+
"[14] AudioPlayer\t[29] Calculator\t\t[44] SysInfo\t\t[59] FAQ\n"
245+
"[15] TTS\t\t[30] Logoff\t\t[45] Einstein\t\t[60] About\n"
246+
247+
"\nMore will be added soon!\n";
239248

240-
"\nMore will be added soon!\n",
249+
// Exit
250+
return;
251+
}
241252

242-
"___FREQUENTLY ASKED QUESTIONS___\n\n"
243-
"1) I can't see the terminal text. How can I zoom in?\n 1a) You can zoom in, of course. Press and hold the Ctrl button and scroll with the mouse to your desired text size.\n"
244-
"\n\n2) The error messages shown aren't detailed enough. How do I get better-quality error messages?\n 2a) To get better quality error messages, just enable the Verbosity Messages setting in the Settings command.\n"
245-
"\n\n3) I'm using the Windows 7 terminal. How do I scroll up and down in the terminal without using the mouse?\n 3a) To scroll up and down without the mouse, press Alt + Space and then the keys 'E' and 'L', and then scroll with the up/down arrow keys. Use the PageUp/PageDown keys to scroll full pages in the terminal.\n"
246-
"\n\n4) What is the difference between the 'old' and 'new' OptionSelect Session styles?\n 4a) The 'old' style is an inspiration from the TerminalAppGen2, the previous iteration of this program. It is very robust, simple and works by associating a number with each option, which you type in and press ENTER to select.\nThe 'new' style isn't exactly new, and has been in ZeeTerminal since v0.1.0. However, it is newer than the 'old' style, hence it's referred to as 'new'. It relies on using the arrow/WS keys to move a highlight up and down, to select an option.\n",
253+
// About - A function that displays all about and copyright information for ZeeTerminal,
254+
// using the ScreenNavigate engine.
255+
//
256+
void About(bool bFromTutorial) {
257+
ScreenNavigateEngine sneAbout;
247258

259+
sneAbout.nSizeOfScreens = 2;
260+
std::string sScreens[] =
261+
{
248262
"___ABOUT THIS PROGRAM___\n\nThis is the ZeeTerminal Commandline Program, Build v" + std::string(ZT_VERSION) + ".\n" +
249263
"This is a beta build of ZeeTerminal, with an entirely new engine and components.\nThis program is made in C++, with a few very small parts of C." +
250264
"\n\nThis program uses the DirectShow API in the MediaPlayer command, licensed by Microsoft Corp. (c) Microsoft Corp.\n\n" +
@@ -270,15 +284,15 @@ void help(bool bFromTutorial) {
270284
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n"
271285
};
272286

273-
sneHelp.sScreens = sScreens;
274-
287+
sneAbout.sScreens = sScreens;
288+
289+
// Set custom direction text when coming from tutorial
275290
if (bFromTutorial) {
276-
// Set custom direction text when coming from tutorial
277-
sneHelp.SetDirectionsText("Press the 'A' key or left arrow key to move left.\nPress the 'D' key or right arrow key to move right.\nPress ESC to exit the Help command and continue with the tutorial.");
291+
sneAbout.SetDirectionsText("Press the 'A' key or left arrow key to move left.\nPress the 'D' key or right arrow key to move right.\nPress ESC to exit the About command and continue with the tutorial.");
278292
}
279293

280-
// Call sneHelp.ScreenNavigate for screen strings set.
281-
sneHelp.ScreenNavigate(" ___HELP___ ");
294+
// Call sneAbout.ScreenNavigate for screen strings set.
295+
sneAbout.ScreenNavigate(" ___ABOUT___ ");
282296

283297
return;
284298
}
@@ -332,9 +346,10 @@ void Tutorial() {
332346
std::cout << "Please try again.\n";
333347
}
334348
}
335-
slowcharfn(false, "\nThat previous command also taught you how to use the ScreenNavigate engine.\nYou can move left and right between 'screens' using the the ");
336-
slowcolourfn(LCYN, ConfigObjMain.sColourGlobalBack, "A, D and left/right arrow keys");
337-
slowcharfn(true, ", to look through any information provided.\n");
349+
350+
sleep(1000);
351+
slowcharfn(true, "\nDid you notice how when you typed in 'help', the Help command executed?\nWhen executing commands, type the name of the command and press ENTER to execute it, just like you did to execute the Help command.\n"
352+
"Use the Help command to get a reference of all the commands in the terminal.");
338353

339354
// OptionSelect Engine Tutorial
340355
sleep(1000);

CommandFiles/CommandHelpMessages.cpp

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace helpmsgs
1212
colourSubheading();
1313
std::cout << "What this command does:" << NOULINE_STR;
1414
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
15-
std::cout << wordWrap("\n- Lists all possible commands in ZeeTerminal.")
16-
<< wordWrap("\n- Displays some frequently asked questions with answers.")
17-
<< wordWrap("\n- Displays information about the program, such as copyright information, credits and basic program information.") << "\n\n";
15+
std::cout << wordWrap("\n- Lists all possible commands in ZeeTerminal, with small amounts of extra information.\n\n");
1816

1917
colourSubheading();
2018
std::cout << "Possible arguments for this command:" << NOULINE_STR;
@@ -182,6 +180,8 @@ namespace helpmsgs
182180
<< wordWrap("\n --cdbackground <num>\t\tSet the background colour in the CarDodge game. Put the colour number in place of <num>.")
183181
<< wordWrap("\n --gtnforeground <num>\t\tSet the foreground colour in the Guess The Number game. Put the colour number in place of <num>.")
184182
<< wordWrap("\n --gtnbackground <num>\t\tSet the background colour in the Guess The Number game. Put the colour number in place of <num>.")
183+
<< wordWrap("\n --gtneforeground <num>\t\tSet the foreground colour in the Guess The Number Extreme game. Put the colour number in place of <num>.")
184+
<< wordWrap("\n --gtnebackground <num>\t\tSet the background colour in the Guess The Number Extreme game. Put the colour number in place of <num>.")
185185
<< wordWrap("\n\nExample: settings --titlefore 1")
186186
<< wordWrap("\n\nNote: You can get colour numbers by executing the \"ColourNumbers\" command.") << "\n\n";
187187

@@ -1039,7 +1039,8 @@ namespace helpmsgs
10391039
std::cout << "Possible arguments for this command:" << NOULINE_STR;
10401040
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
10411041
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n --cardodge\tStarts the CarDodge game, a game where you dodge enemy cars to gain points.\n"
1042-
" --gtn\t\tStarts the Guess The Number game, a game where you guess a number between 1 and 100 in as little tries as you can.\n\n"
1042+
" --gtn\t\tStarts the Guess The Number game, a game where you guess a number between 1 and 100 in as little tries as you can.\n"
1043+
" --gtne\t\tStarts the Guess The Number Extreme game, a game where you guess a number between 2 random numbers in under 5 tries, fighting for the highest score.\n\n"
10431044
"Example: game --cardodge\n\n");
10441045

10451046
return;
@@ -1151,4 +1152,88 @@ namespace helpmsgs
11511152

11521153
return;
11531154
}
1155+
1156+
// PiOutputHelp
1157+
void PiOutputHelp() {
1158+
CentreColouredText(" ___PIOUTPUT___ ", 1);
1159+
std::cout << "\n";
1160+
CentreColouredText("This command outputs an argument-specified number of digits of Pi, up to 1 million d.p.", 2);
1161+
std::cout << "\n\n";
1162+
1163+
colourSubheading();
1164+
std::cout << "What this command does:" << NOULINE_STR;
1165+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1166+
std::cout << wordWrap("\n- This command outputs an argument-specified number of digits of Pi, up to 1 million decimal places.\n- For speed and efficiency purposes, the number is truncated, not rounded up or down.\n- For speed and simplistic purposes, the value of Pi is not calculated at run-time, however it was hard-coded at the compile-time of this program."
1167+
"\n- You can learn more about Pi here: ");
1168+
colour(LBLU, ConfigObjMain.sColourGlobalBack);
1169+
std::cout << wordWrap("https://en.wikipedia.org/wiki/Pi\n\n");
1170+
1171+
colourSubheading();
1172+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
1173+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1174+
std::cout << wordWrap("\n -h\tDisplays this help message.\n <dp>\tNumber of decimal places to output Pi to. Put the integer desired in place of <dp>.\n\nExample: pioutput 16\n\nNOTE: <dp> argument cannot be less than 1 or more than 1 million.\n\n");
1175+
1176+
return;
1177+
}
1178+
1179+
// SpamHelp
1180+
void SpamHelp() {
1181+
CentreColouredText(" ___SPAM___ ", 1);
1182+
std::cout << "\n";
1183+
CentreColouredText("This command outputs an argument-specified string non-stop until the ESC key is pressed.", 2);
1184+
std::cout << "\n\n";
1185+
1186+
colourSubheading();
1187+
std::cout << "What this command does:" << NOULINE_STR;
1188+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1189+
std::cout << wordWrap("\n- This command outputs a string a specific number of times until infinity or until the ESC key is pressed on the keyboard.\n\n");
1190+
1191+
colourSubheading();
1192+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
1193+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1194+
std::cout << wordWrap("\n -h\tDisplays this help message.\n <str>\tThe string to spam output of. Put the desired string in place of <str>.\n\nExample: spam \"ZOO WEE MAMA\"\n\n"
1195+
"NOTE: For any strings containing spaces, please enclose them in quotes like the example.\n\n");
1196+
1197+
return;
1198+
}
1199+
1200+
// FAQHelp
1201+
void FAQHelp() {
1202+
CentreColouredText(" ___FAQ___ ", 1);
1203+
std::cout << "\n";
1204+
CentreColouredText("This command outputs frequently-asked questions and answers about ZeeTerminal.", 2);
1205+
std::cout << "\n\n";
1206+
1207+
colourSubheading();
1208+
std::cout << "What this command does:" << NOULINE_STR;
1209+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1210+
std::cout << wordWrap("\n- This command displays frequently-asked questions with answers, about ZeeTerminal.\n\n");
1211+
1212+
colourSubheading();
1213+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
1214+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1215+
std::cout << wordWrap("\n -h\tDisplays this help message.\n\nExample: faq -h\n\n");
1216+
1217+
return;
1218+
}
1219+
1220+
// AboutHelp
1221+
void AboutHelp() {
1222+
CentreColouredText(" ___ABOUT___ ", 1);
1223+
std::cout << "\n";
1224+
CentreColouredText("This command outputs information about ZeeTerminal, including copyright.", 2);
1225+
std::cout << "\n\n";
1226+
1227+
colourSubheading();
1228+
std::cout << "What this command does:" << NOULINE_STR;
1229+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1230+
std::cout << wordWrap("\n- This command outputs information about ZeeTerminal, including copyright information about different modules/APIs, thank-you messages, and license information.\n\n");
1231+
1232+
colourSubheading();
1233+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
1234+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
1235+
std::cout << wordWrap("\n -h\tDisplays this help message.\n\nExample: about -h\n\n");
1236+
1237+
return;
1238+
}
11541239
}

CommandFiles/CommandsFile.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "CalculationAlgorithm/CalculationAlgorithm.h"
3030
#include "../GameFiles/CarDodge/CarDodge.cpp"
3131
#include "../GameFiles/GuessTheNumber/GuessTheNumber.h"
32+
#include "../GameFiles/GuessTheNumberExtreme/GuessTheNumberExtreme.h"
3233

3334
#include <vector>
3435
#include <string>

CommandFiles/CommandsFiles/CommandsFile_1to10.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,34 @@ bool commands::Commands1To10(const std::string sCommand, char* cCommandArgs, con
827827
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
828828
}
829829

830+
return true;
831+
}
832+
else if (sStringOptionCommandArgs[0] == "gtneforeground") {
833+
if (isNumberi(sStringDataCommandArgs[0])) {
834+
GuessTheNumberExtremeGameSettings(1, std::stoi(sStringDataCommandArgs[0]), 0);
835+
}
836+
else {
837+
VerbosityDisplay("In Commands() - ERROR: Could not detect numerical value in string-based number argument.\n");
838+
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
839+
}
840+
841+
return true;
842+
}
843+
else if (sStringOptionCommandArgs[0] == "gtnebackground") {
844+
if (isNumberi(sStringDataCommandArgs[0])) {
845+
GuessTheNumberExtremeGameSettings(2, 0, std::stoi(sStringDataCommandArgs[0]));
846+
}
847+
else {
848+
VerbosityDisplay("In Commands() - ERROR: Could not detect numerical value in string-based number argument.\n");
849+
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
850+
}
851+
830852
return true;
831853
}
832854
}
833855

834856
OptionSelectEngine oseSettings;
835-
oseSettings.nSizeOfOptions = 12;
857+
oseSettings.nSizeOfOptions = 13;
836858
std::string sOptions[] = {
837859
"Highlight Colour Settings",
838860
"Title Colour Settings",
@@ -845,6 +867,7 @@ bool commands::Commands1To10(const std::string sCommand, char* cCommandArgs, con
845867
"LogFile System Settings",
846868
"CarDodge Game Settings",
847869
"Guess The Number Game Settings",
870+
"Guess The Number Extreme Game Settings",
848871
"Other Settings"
849872
};
850873
oseSettings.sOptions = sOptions;
@@ -892,6 +915,9 @@ bool commands::Commands1To10(const std::string sCommand, char* cCommandArgs, con
892915
GuessTheNumberGameSettings();
893916
break;
894917
case 12:
918+
GuessTheNumberExtremeGameSettings();
919+
break;
920+
case 13:
895921
OtherSettings();
896922
break;
897923

0 commit comments

Comments
 (0)