mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 03:02:22 +01:00
Added back host and ingame username
This commit is contained in:
@@ -22,11 +22,6 @@ class GameController extends GetxController {
|
||||
GameController() {
|
||||
_storage = GetStorage("game");
|
||||
|
||||
username = TextEditingController(text: _storage.read("username"));
|
||||
username.addListener(() async {
|
||||
await _storage.write("username", username.text);
|
||||
});
|
||||
|
||||
Iterable decodedVersionsJson =
|
||||
jsonDecode(_storage.read("versions") ?? "[]");
|
||||
var decodedVersions = decodedVersionsJson
|
||||
@@ -41,7 +36,14 @@ class GameController extends GetxController {
|
||||
_selectedVersion = Rxn(decodedSelectedVersion);
|
||||
|
||||
host = RxBool(_storage.read("host") ?? false);
|
||||
|
||||
username = TextEditingController(text: _storage.read("${host.value ? 'host' : 'game'}_username") ?? "");
|
||||
username.addListener(() async {
|
||||
await _storage.write("${host.value ? 'host' : 'game'}_username", username.text);
|
||||
});
|
||||
|
||||
host.listen((value) => _storage.write("host", value));
|
||||
host.listen((value) => username.text = _storage.read("${host.value ? 'host' : 'game'}_username") ?? "");
|
||||
|
||||
started = RxBool(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user