File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ std::string BrowseFile(std::string prompt) {
87
87
ofn.nFilterIndex = 2 ;
88
88
ofn.lpstrFile = f1;
89
89
ofn.nMaxFile = MAX_PATH;
90
- ofn.Flags = OFN_FILEMUSTEXIST;
90
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR ;
91
91
92
92
if (::GetOpenFileName (&ofn) != FALSE )
93
93
return ofn.lpstrFile ;
Original file line number Diff line number Diff line change @@ -124,18 +124,8 @@ int main() {
124
124
}
125
125
else if (gameID.empty () || (gameID.find_first_not_of (' ' ) == std::string::npos))
126
126
break ;
127
- std::cout << " Enter path to game config file: " ;
128
- getline (std::cin, cfgPath);
129
- if (cfgPath.empty () || (cfgPath.find_first_not_of (' ' ) == std::string::npos))
130
- break ;
131
- GetFileAttributes (cfgPath.c_str ());
132
- if (INVALID_FILE_ATTRIBUTES == GetFileAttributes (cfgPath.c_str ()) || GetLastError () == ERROR_FILE_NOT_FOUND)
133
- {
134
- std::cerr << " Error: Specified config file does not exist" << std::endl;
135
- break ;
136
- }
137
- // std::cout << "Select directory containing the " << gameID << " config files..." << std::endl;
138
- // path = BrowseFile("Select directory containing the " + gameID + " config files...");
127
+ std::cout << " Select directory containing the " << gameID << " config files..." << std::endl;
128
+ cfgPath = BrowseFile (" Select directory containing the " + gameID + " config files..." );
139
129
if (settings.addGame (gameID, cfgPath)) {
140
130
std::cout << std::endl << " Successfully added " << gameID << " to configuration" << std::endl;
141
131
}
You can’t perform that action at this time.
0 commit comments