#ifndef REDXWIN_H_INCLUDED #define REDXWIN_H_INCLUDED #define REDX_WINDOW 1002 #define REDX_MENU 1007 #define Seth_Dialog 1000007 #define Men2Button1 101 #define Men2Button2 102 #define Men2Button3 103 #define Men2Button4 104 #define Men3Button1 1008 #define Men3Button2 1009 #define Men3Button3 1010 #define Men3Button4 1011 #define Men3Button5 1012 #define Men1Button1 1001 #define Men1Button2 1003 #define Men1Button3 1004 #define Men1Button4 1005 #define Men1Button5 1006 #define RedXCursor 2003 #define Men4Button1 105 #define Men3Button6 108 #define Men3Button7 109 #define Men5Button1 110 #define Men5Button2 111 #define Men5Button3 112 #define Men6Button1 113 #define Men6Button2 114 #define Men6Button3 115 #define Men6Button4 116 #define Men6Button5 117 #define Men7Button1 118 #define Men7Button2 119 #define Men7Button3 120 #define Men7Button4 121 #define Men7Button5 122 #define Men8Button1 123 #define Men8Button2 124 #define WM_SETCURSOR 0x0020 #define Men6Option3Button1 126 #define Men6Option3Button2 127 #define Men6Option3Button3 128 #define Men6Option3Button4 129 #define Men6Option3Button5 130 #define Men6Option3Button6 131 #define Men6Option3Button7 132 #define Men6Option3Button8 133 #define Men6Option3Button9 134 #define Men6Option3Button10 135 #define Men6Option3Button11 136 #define Men6Option3Button12 137 #define Men6Option3Button13 138 #define Men6Option3Button14 139 #define Men6Option3Button15 140 #define Men6Option3Button16 141 #define IDD_DLGFIRST 142 #endif #include "REDXWin.h" IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "My About Box" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "&OK",IDOK,174,18,50,14 PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14 GROUPBOX "About this program...",IDC_STATIC,7,7,225,52 CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby theForger", IDC_STATIC,16,18,144,33 END #include #include #include #include #include "REDXWin.h" #include std::string name; float age; int BeginCommandPromptTextBasedGame(){ std::cout << "Before we begin this adventerous 'Text Based Game', we need some things from the player(you). Please input your name, it can be first name, last name, middle name, all three, or even a made up name." << std::endl; std::cin >> name; std::cout << "Now please enter your age. Using letters for your age may brake the application and you will have to re-load it." << std::endl; std::cin >> age; std::cout << "Okay please verify that your name is " << name << ", " << "and your age is " << age << " " << "Right?" << std::endl; std::cout << "Now let us begin the story of " << name << std::endl; system("CLS"); } using namespace std; LPCSTR cursor = IDC_ARROW; std::string Stri1 = "NULL"; BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: EndDialog(hwnd, IDOK); break; case IDCANCEL: EndDialog(hwnd, IDCANCEL); break; } break; default: return FALSE; } return TRUE; } std::string MODE = "NULL"; std::string OpenOrClosed = ""; HWND nurb; static HBRUSH hbrBkgnd = NULL; const char g_szClassName[] = "Custom Story(RedXStudios)"; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_LBUTTONDOWN: { } break; case WM_CREATE: { Sleep(1000); nurb = CreateWindow(TEXT("STATIC"), TEXT(""), WS_VISIBLE | WS_CHILD, 40,80,400,25, hwnd, (HMENU)NULL, NULL, NULL); CreateWindow(TEXT("STATIC"), TEXT("Please Select a Game-Type to begin playing."), WS_VISIBLE | WS_CHILD, 20,40,400,25, hwnd, (HMENU)NULL, NULL, NULL); HMENU Men1, Men2, Men3, Men4, Men5, Men6, Men7, Men8, Men9, Men10; HMENU Options1 = CreateMenu(); HMENU Options2 = CreateMenu(); HMENU Options3 = CreateMenu(); HMENU Options4 = CreateMenu(); Men1 = CreateMenu(); AppendMenu(Men1,MF_POPUP, (UINT_PTR)Options1, "Game Type"); AppendMenu(Options1, MF_STRING, Men1Button1, "CommandPrompt(Text Based)"); AppendMenu(Options1, MF_STRING, Men1Button2, "Windows Mode(Semi-Graphics based)"); AppendMenu(Options1, MF_STRING, Men1Button3, "Windows Mode(Text Based)"); AppendMenu(Options1, MF_STRING, Men1Button4, "2D Mode"); AppendMenu(Options1, MF_STRING, Men1Button5, "3D Mode"); Men2 = CreatePopupMenu(); AppendMenu(Men2, MF_STRING, Men2Button1, "File Location"); AppendMenu(Men2, MF_STRING, Men2Button2, "Exe Location"); AppendMenu(Men2, MF_STRING, Men2Button4, "RedXStudios Website"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men2, "Options"); Men3 = CreatePopupMenu(); AppendMenu(Men3, MF_STRING, Men3Button1, "Seth Pack, Age 17, Beta Tested"); AppendMenu(Men3, MF_STRING, Men3Button2, "Roy Dragon, Age 17, Beta Tested"); AppendMenu(Men3, MF_STRING, Men3Button3, "Adam Talbott, Age 17, Beta Tested"); AppendMenu(Men3, MF_STRING, Men3Button4, "Josh Franklin, Age 18, Programmed, Designed, and Wrote the game"); AppendMenu(Men3, MF_STRING, Men3Button5, "Michael Rubenstein, Age 14, Beta Tested"); AppendMenu(Men3, MF_STRING, Men3Button6, "Andy Burns, Age 15, Beta Tested"); AppendMenu(Men3, MF_STRING, Men3Button7, "Jamie Franklin, Age 15, Beta Tested"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men3, "Credit"); Men4 = CreatePopupMenu(); AppendMenu(Men4, MF_STRING, Men4Button1, "Play"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men4, "Play Now"); Men5 = CreatePopupMenu(); AppendMenu(Men5, MF_STRING, Men5Button1, "GLUT/OPenGL"); AppendMenu(Men5, MF_STRING, Men5Button2, "Win32"); AppendMenu(Men5, MF_STRING, Men5Button3, "IrrKLang"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men5, "Special Thanks"); ShowWindow(hwnd, false); Men6 = CreatePopupMenu(); AppendMenu(Men6, MF_STRING, Men6Button1, "RedXCursors"); AppendMenu(Men6, MF_STRING, Men6Button2, "CustomCursor"); AppendMenu(Men6, MF_STRING|MF_POPUP, (UINT_PTR)Options3, "OtherCursors"); AppendMenu(Options3, MF_STRING, Men6Option3Button1, "Arrow"); AppendMenu(Options3, MF_STRING, Men6Option3Button2, "Loading"); AppendMenu(Options3, MF_STRING, Men6Option3Button3, "Cross"); AppendMenu(Options3, MF_STRING, Men6Option3Button4, "Hand"); AppendMenu(Options3, MF_STRING, Men6Option3Button5, "Help"); AppendMenu(Options3, MF_STRING, Men6Option3Button6, "Ibeam"); AppendMenu(Options3, MF_STRING, Men6Option3Button7, "Icon"); AppendMenu(Options3, MF_STRING, Men6Option3Button8, "No"); AppendMenu(Options3, MF_STRING, Men6Option3Button9, "Size"); AppendMenu(Options3, MF_STRING, Men6Option3Button10, "SizeAll"); AppendMenu(Options3, MF_STRING, Men6Option3Button11, "SIZENESW"); AppendMenu(Options3, MF_STRING, Men6Option3Button12, "Sizens"); AppendMenu(Options3, MF_STRING, Men6Option3Button13, "SizenWSE"); AppendMenu(Options3, MF_STRING, Men6Option3Button14, "SizEWE"); AppendMenu(Options3, MF_STRING, Men6Option3Button15, "UpArrow"); AppendMenu(Options3, MF_STRING, Men6Option3Button16, "Wait"); AppendMenu(Men6, MF_STRING, Men6Button3, "Music"); AppendMenu(Men6, MF_STRING, Men6Button4, "Calculater"); AppendMenu(Men6, MF_STRING, Men6Button5, "CustomFont"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men6, "Extras"); Men7 = CreatePopupMenu(); AppendMenu(Men7, MF_STRING, Men7Button1, "RedXCursor Instructions"); AppendMenu(Men7, MF_STRING, Men7Button2, "CustomCursor Instructions"); AppendMenu(Men7, MF_STRING, Men7Button3, "Music Instructions"); AppendMenu(Men7, MF_STRING, Men7Button4, "Calculater Instructions"); AppendMenu(Men7, MF_STRING, Men7Button5, "CustomFont Instructions"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men7, "Instructions"); Men8 = CreatePopupMenu(); AppendMenu(Men8, MF_STRING, Men8Button1, "Info on extras"); AppendMenu(Men8, MF_STRING, Men8Button2, "Josh Franklin Comments"); AppendMenu(Men1, MF_STRING | MF_POPUP, (UINT)Men8, "Information"); SetMenu(hwnd, Men1); SetCursor(LoadCursor(NULL, IDC_ARROW)); break; } case WM_COMMAND: { } switch( LOWORD(wParam) ) { case Men1Button1: { MODE = "CMD Mode"; SetWindowText(nurb, TEXT("Command Prompt Text-Based has been chosen")); CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD, 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL); static HBRUSH brus1 = NULL; break; } case Men1Button2: { MODE = "Windows Mode(SGB)"; SetWindowText(nurb, TEXT("Windows Mode Semi-Graphics-Based has been chosen")); CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD, 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL); break; } case Men1Button3: { MODE = "Windows Mode(TB)"; SetWindowText(nurb, TEXT("Windows Mode Text-Based has been chosen")); CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD, 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL); break; } case Men1Button4: { MODE = "2D Mode"; SetWindowText(nurb, TEXT("2D Mode has been chosen")); CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD, 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL); break; } case Men1Button5: { MODE = "3D Mode"; SetWindowText(nurb, TEXT("3D Mode has been chosen")); CreateWindow(TEXT("STATIC"), TEXT("Now select play to play your game in your selected type."), WS_VISIBLE | WS_CHILD, 80,120,400,25, hwnd, (HMENU)NULL, NULL, NULL); break; } case Men3Button1: { MessageBox(hwnd, "Seth Pack, Age 17, TGN Content scout, JAVA Programmer", "Seth's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button2: { MessageBox(hwnd, " Roy the dragon, Lua Programmer, Roblox Junkie","Roy's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button3: { MessageBox(hwnd, "Adam Talbott, Lua Programmer, Roblox Junkie","Adam's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button4: { MessageBox(hwnd, "Josh Franklin, C++, Lua, Java, HTML, HTML5, CSS, CSS3, Javascript, PHP Programmer, Roblox Junkie", "Josh's chosen description ", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button5: { MessageBox(hwnd, "Michael Rubinstein, Likes Doctor who, Programs in rbx.lua, Roblox junkie", "Mich's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button6: { MessageBox(hwnd, "Andy Burns, Age 15, Car Addict, Roblox junkie", "Andy's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men3Button7: { MessageBox(hwnd, "Jamie Franklin, Age 15, Crazy, Music Addict", "Jamie's chosen description", MB_ICONEXCLAMATION | MB_OK); break; } case Men4Button1: { if (MODE == "CMD Mode"){ ShowWindow(hwnd, false); cout << "To 'Play' type 'Play' and press enter, for details at anytime type details/ and then press enter, for instructions type instruc/" << std::endl; std::string BeginCom; cin >> BeginCom; bool non = false; while(non == false){ if(BeginCom == "Play"){ system("CLS"); BeginCommandPromptTextBasedGame(); non = true; break; }else if(BeginCom == "play"){ system("CLS"); BeginCommandPromptTextBasedGame(); non = true; break; }else if(BeginCom == "details/"){ std::cout << "This is a Fantasy Mid-Evil RPG(You are currently playing the text version). The point of the game is to live your life and live your story until the very end. The game interacts to choices you make." << std::endl; cin >> BeginCom; }else if(BeginCom == "Details/"){ std::cout << "This is a Fantasy Mid-Evil RPG(You are currently playing the text version). The point of the game is to live your life and live your story until the very end. The game interacts to choices you make." << std::endl; cin >> BeginCom; }else if(BeginCom == "instructions/"){ std::cout << "To save the game at any point in time type 'save/', or 'Save/', to get back to the Main window/options menu type esc(1); and to close the whole program completley type esc(2);" << std::endl; cin >> BeginCom; }else if(BeginCom == "Instructions/"){ std::cout << "To save the game at any point in time type 'save/', or 'Save/', to get back to the Main window/options menu type esc(1); and to close the whole program completley type esc(2);" << std::endl; cin >> BeginCom; } else if(BeginCom != "Details/" and "details/" and "instructions/" and "Instructions/" and "Play" and "play"){ MessageBox(hwnd,"You have chosen a in-valid choice of characters. To fix this type one of the three options play/, instructions/, or details/", "Typing Error", MB_OK); system("CLS"); cout << "To 'Play' type 'Play' and press enter, for details at anytime type details/ and then press enter, for instructions type instruc/" << std::endl; cin >> BeginCom; }; } } else if(MODE == "Windows Mode(SGB)"){ }else if(MODE == "Windows Mode(TB)"){ }else if(MODE == "2D Mode"){ }else if(MODE == "3D Mode"){ }else{ MessageBox(hwnd, "This is either due to not picking a game mode or there is a code error. Try re-opening the program and picking a game mode, if that does not help then re-download the application.", "Game Load Error", MB_ICONEXCLAMATION | MB_OK); } break; } case Men6Option3Button1: { SetCursor(LoadCursor(NULL, IDC_ARROW)); break; } case Men6Option3Button2:{ SetCursor(LoadCursor(NULL, IDC_APPSTARTING)); break; } case Men6Option3Button3:{ SetCursor(LoadCursor(NULL, IDC_CROSS)); break; } case Men6Option3Button4:{ SetCursor(LoadCursor(NULL, IDC_HAND)); break; } case Men6Option3Button5:{ SetCursor(LoadCursor(NULL, IDC_HELP)); break; } case Men6Option3Button6:{ SetCursor(LoadCursor(NULL, IDC_IBEAM)); break; } case Men6Option3Button7:{ SetCursor(LoadCursor(NULL, IDC_ICON)); break; } case Men6Option3Button8:{ SetCursor(LoadCursor(NULL,IDC_NO )); break; } case Men6Option3Button9:{ SetCursor(LoadCursor(NULL, IDC_SIZE)); break; } case Men6Option3Button10:{ SetCursor(LoadCursor(NULL, IDC_SIZEALL)); break; } case Men6Option3Button11:{ SetCursor(LoadCursor(NULL, IDC_SIZENESW)); break; } case Men6Option3Button12:{ SetCursor(LoadCursor(NULL, IDC_SIZENS)); break; } case Men6Option3Button13:{ SetCursor(LoadCursor(NULL, IDC_SIZENWSE)); break; } case Men6Option3Button14:{ SetCursor(LoadCursor(NULL, IDC_SIZEWE)); break; } case Men6Option3Button15:{ SetCursor(LoadCursor(NULL, IDC_UPARROW)); break; } case Men6Option3Button16:{ SetCursor(LoadCursor(NULL, IDC_WAIT)); break; } case Men5Button1:{ MessageBoxEx(hwnd, "I thank 'GLUT/OPenGL' for supplying the libary to dumb down making 3D objects", "Special Thanks", MB_OK, NULL ); break; } case Men5Button2:{ MessageBoxEx(hwnd, "I thank Win32 for all Windows objects created within my application", "Special Thanks", MB_OK, NULL ); break; }case Men5Button3:{ MessageBoxEx(hwnd, "I thank IrrkLang for all audio within my application", "Special Thanks", MB_OK, NULL); break; } }break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_CTLCOLORSTATIC: { HDC hdcStatic = (HDC) wParam; SetBkColor(hdcStatic, RGB( 255, 255, 255)); if (hbrBkgnd == NULL) { hbrBkgnd = CreateSolidBrush(RGB( 255, 255, 255)); } return (INT_PTR)hbrBkgnd; } case WM_DESTROY: PostQuitMessage(0); DeleteObject(hbrBkgnd); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); case WM_SETCURSOR: {hwnd; } } return 0; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX wc; HWND hwnd; MSG Msg; nCmdShow = true; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = g_szClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if(!RegisterClassEx(&wc)) { MessageBox(NULL, "Window could not be loaded, we apologise.", "Error(Please try re-downloading.)", MB_ICONEXCLAMATION | MB_OK); return 0; } hwnd = CreateWindowEx( WS_EX_APPWINDOW, g_szClassName, "Custom Story(Red X Orginization)", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 2000, 900, NULL, NULL, hInstance, NULL); if(hwnd == NULL) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; }