source: AE/Installer/subs.cpp@ 279

Last change on this file since 279 was 278, checked in by gumby, 16 years ago
File size: 1.7 KB
Line 
1/*
2AE\Mod Installer.
3
4Needs getPackages() now!
5
6*/
7
8#include <string>
9#include <iostream>
10#include "methods.h"
11#include <vector>
12
13using namespace std;
14bool FALSE = 0;
15bool TRUE = 0;
16
17int mainMenu(void) {
18 int choice = '0';
19 bool ok = FALSE;
20 cout << "1. Install new packages\n";
21 cout << "2. Uninstall packages\n";
22 cout << "3. See what is installed\n";
23 cout << "4. About AE\n";
24 cout << "5. Quit\n\n";
25
26 do {
27 ok = TRUE;
28 choice = cin.get();
29 cin.ignore(1);
30 switch(choice) {
31 case '1':
32 installPackages();
33 break;
34 case '2':
35 uninstallPackages();
36 break;
37 case '3':
38 //listInstalledPackages();
39 break;
40 case '5':
41 return 0;
42 default:
43 ok = FALSE;
44 }
45 } while(ok == FALSE);
46 return 0;
47}
48void main(void)
49{
50
51 // SetConsoleTitle("AE Installer"); windows junk, convert to SDL
52// system("color 0A");
53 cout << "\nWelcome to the AE installer!\n";
54
55 cout << "\nWhat would you like to do?\n";
56
57 mainMenu();
58
59
60}
61
62
63void installPackages() {
64 ModPackage package;
65 vector<string> installed_packages;
66 vector<ModPackage> packages; // = getPackages()
67 vector<ModPackage>::iterator iter;
68 iter = packages.begin();
69
70 if (packages.empty()) {
71 cout << "Error: You have no packages!\n";
72 return;
73 }
74
75 cout << "Detecting installed packages...\n";
76
77 for(int i = 0; i < packages.size();) {
78 package = *iter;
79 if(!package.isInstalled){
80 packages.erase(iter);
81 }
82 else {
83 i++;
84 iter++;
85 }
86
87 }
88
89 if (packages.empty()) {
90 cout << "Error: You have no installed packages!\n";
91 return;
92 }
93
94 //listInstalledPackages(packages);
95
96}
97void uninstallPackages() {
98;
99}
100
101void getInstalledPackages() {
102;
103}
Note: See TracBrowser for help on using the repository browser.