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