]>
Commit | Line | Data |
---|---|---|
f8656e40 | 1 | #include <fstream> |
2 | #include <iostream> | |
3 | ||
f8656e40 | 4 | using std::cout; |
5 | using std::ofstream; | |
6 | ||
7 | char menu(); | |
8 | ||
9 | int main() | |
10 | { | |
11 | ofstream outfile; | |
12 | ||
13 | outfile.open("options.h"); | |
14 | if (outfile.fail()) | |
15 | { | |
9cc5ab57 | 16 | cout << "Error opening options.h" << endl; |
f8656e40 | 17 | return 1; |
18 | } | |
19 | char c = 0; | |
20 | ||
21 | do { | |
22 | c = menu(); | |
23 | switch(c) | |
24 | { | |
25 | case '1': | |
26 | outfile << "#define UNREAL" << endl; | |
27 | outfile << "#undef BAHAMUT" << endl; | |
28 | break; | |
29 | case '2': | |
30 | outfile << "#undef UNREAL" << endl; | |
31 | outfile << "#define BAHAMUT" << endl; | |
32 | break; | |
33 | default: | |
34 | break; | |
35 | } | |
36 | }while (c != 'Q' && c != 'q' && (int(c) < 48) && (int(c) > 57)); | |
37 | ||
38 | outfile.close(); | |
39 | return 0; | |
40 | } | |
41 | ||
42 | char menu() | |
43 | { | |
44 | char selection = 0; | |
45 | ||
46 | cout << "Choose your IRCD" << endl; | |
47 | cout << "1. Unreal3.x\r\n" | |
48 | << "2. bahamut-1.4.x" << endl; | |
49 | cout << "Make your selection: "; | |
50 | cin >> selection; | |
51 | return selection; | |
52 | } |