WriteConfiguration Writes key bindings and archived cvars to config.cfg.
()
| 1331 | * Writes key bindings and archived cvars to config.cfg. |
| 1332 | */ |
| 1333 | public static void WriteConfiguration() { |
| 1334 | RandomAccessFile f; |
| 1335 | String path; |
| 1336 | |
| 1337 | // if (Globals.cls.state == Defines.ca_uninitialized) |
| 1338 | // return; |
| 1339 | |
| 1340 | path = FS.getWriteDir() + "/config.cfg"; |
| 1341 | f = Lib.fopen(path, "rw"); |
| 1342 | if (f == null) { |
| 1343 | Com.Printf("Couldn't write config.cfg.\n"); |
| 1344 | return; |
| 1345 | } |
| 1346 | try { |
| 1347 | f.seek(0); |
| 1348 | f.setLength(0); |
| 1349 | } catch (IOException e1) { |
| 1350 | } |
| 1351 | try { |
| 1352 | f.writeBytes("// generated by quake, do not modify\n"); |
| 1353 | } catch (IOException e) { |
| 1354 | } |
| 1355 | |
| 1356 | Key.WriteBindings(f); |
| 1357 | Lib.fclose(f); |
| 1358 | Cvar.getInstance().writeArchiveVariables(path); |
| 1359 | } |
| 1360 | |
| 1361 | /** |
| 1362 | * FixCvarCheats |
no test coverage detected