Skip to content

Commit

Permalink
Minor UI fixes and version update
Browse files Browse the repository at this point in the history
  • Loading branch information
AMacro committed Jun 30, 2024
1 parent 499dacf commit 0fa44a6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 39 deletions.
10 changes: 9 additions & 1 deletion Multiplayer/Components/MainMenu/HostGamePane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private void ValidateInputs(string text)
if( port.text == "" && (Multiplayer.Settings.Port < MIN_PORT || Multiplayer.Settings.Port > MAX_PORT))
valid = false;

startButton.interactable = valid;
startButton.ToggleInteractable(valid);

Debug.Log($"Validated: {valid}");
}
Expand Down Expand Up @@ -368,6 +368,14 @@ private void StartClick()
}


Multiplayer.Settings.ServerName = serverData.Name;
Multiplayer.Settings.Password = password.text;
Multiplayer.Settings.PublicGame = gamePublic.isOn;
Multiplayer.Settings.Port = serverData.port;
Multiplayer.Settings.MaxPlayers = serverData.MaxPlayers;
Multiplayer.Settings.Details = serverData.ServerDetails;


//Pass the server data to the NetworkLifecycle manager
NetworkLifecycle.Instance.serverData = serverData;
//Mark the game as public/private
Expand Down
32 changes: 16 additions & 16 deletions Multiplayer/Components/MainMenu/ServerBrowserPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public class ServerBrowserPane : MonoBehaviour
private IServerBrowserGameDetails selectedServer;

//Button variables
private Button buttonJoin;
private ButtonDV buttonJoin;
//private Button buttonHost;
private Button buttonRefresh;
private Button buttonDirectIP;
private ButtonDV buttonRefresh;
private ButtonDV buttonDirectIP;

private bool serverRefreshing = false;

Expand Down Expand Up @@ -76,8 +76,8 @@ private void OnEnable()
this.SetupListeners(true);
this.serverIDOnRefresh = "";

buttonDirectIP.interactable = true;
buttonRefresh.interactable = true;
buttonDirectIP.ToggleInteractable(true);
buttonRefresh.ToggleInteractable(true);
//buttonHost.interactable = true;

}
Expand Down Expand Up @@ -124,7 +124,7 @@ private void SetupMultiplayerButtons()
goJoin.SetActive(true);
goRefresh.SetActive(true);

buttonJoin.interactable = false;
buttonJoin.ToggleInteractable(false);

}

Expand Down Expand Up @@ -177,7 +177,7 @@ private void RefreshAction()
return;

serverRefreshing = true;
buttonJoin.interactable = false;
buttonJoin.ToggleInteractable(false);

if (selectedServer != null)
{
Expand All @@ -191,8 +191,8 @@ private void JoinAction()
{
if (selectedServer != null)
{
buttonDirectIP.interactable = false;
buttonJoin.interactable = false;
buttonDirectIP.ToggleInteractable(false);
buttonJoin.ToggleInteractable(false);
//buttonHost.interactable = false;

if (selectedServer.HasPassword)
Expand All @@ -214,8 +214,8 @@ private void JoinAction()
private void DirectAction()
{
Debug.Log($"DirectAction()");
buttonDirectIP.interactable = false;
buttonJoin.interactable = false;
buttonDirectIP.ToggleInteractable(false);
buttonJoin.ToggleInteractable(false) ;
//buttonHost.interactable = false;

//making a direct connection
Expand All @@ -235,11 +235,11 @@ private void IndexChanged(AGridView<IServerBrowserGameDetails> gridView)
Debug.Log($"Selected server: {gridViewModel[gridView.SelectedModelIndex].Name}");

selectedServer = gridViewModel[gridView.SelectedModelIndex];
buttonJoin.interactable = true;
buttonJoin.ToggleInteractable(true);
}
else
{
buttonJoin.interactable = false;
buttonJoin.ToggleInteractable(false);
}
}

Expand All @@ -262,7 +262,7 @@ private void ShowIpPopup()
{
if (result.closedBy == PopupClosedByAction.Abortion)
{
buttonDirectIP.interactable = true;
buttonDirectIP.ToggleInteractable(true);
return;
}

Expand Down Expand Up @@ -295,7 +295,7 @@ private void ShowPortPopup()
{
if (result.closedBy == PopupClosedByAction.Abortion)
{
buttonDirectIP.interactable = true;
buttonDirectIP.ToggleInteractable(true);
return;
}

Expand Down Expand Up @@ -338,7 +338,7 @@ private void ShowPasswordPopup()
{
if (result.closedBy == PopupClosedByAction.Abortion)
{
buttonDirectIP.interactable = true;
buttonDirectIP.ToggleInteractable(true);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions Multiplayer/Patches/MainMenu/LauncherControllerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ private static void OnEnable(LauncherController __instance)

btnHostRT.localPosition = new Vector3(curPos.x - curSize.x - PADDING, curPos.y,curPos.z);

__instance.transform.gameObject.UpdateButton("ButtonTextIcon Host", "ButtonTextIcon Host", Locale.SERVER_BROWSER__HOST_KEY, null, Multiplayer.AssetIndex.lockIcon);

Sprite arrowSprite = GameObject.FindObjectOfType<MainMenuController>().continueButton.FindChildByName("icon").GetComponent<Image>().sprite;
__instance.transform.gameObject.UpdateButton("ButtonTextIcon Host", "ButtonTextIcon Host", Locale.SERVER_BROWSER__HOST_KEY, null, arrowSprite);

// Set up event listeners
Button btnHost = goHost.GetComponent<ButtonDV>();
Expand Down
5 changes: 4 additions & 1 deletion Multiplayer/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ public class Settings : UnityModManager.ModSettings, IDrawable
public int MaxPlayers = 4;
[Draw("Port", Tooltip = "The port that your server will listen on. You generally don't need to change this.")]
public int Port = 7777;
[Draw("Details", Tooltip = "Details shown in the server browser")]
public string Details = "";


[Space(10)]
[Header("Lobby Server")]
[Draw("Lobby Server address", Tooltip = "Address of lobby server for finding multiplayer games")]
public string LobbyServerAddress = "http://localhost:8080";
public string LobbyServerAddress = "http://dv.mineit.space";//"http://localhost:8080";
[Header("Last Server Connected to by IP")]
[Draw("Last Remote IP", Tooltip = "The IP for the last server connected to by IP.")]
public string LastRemoteIP = "";
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Id": "Multiplayer",
"Version": "0.1.0",
"Version": "0.1.5",
"DisplayName": "Multiplayer",
"Author": "Insprill",
"EntryMethod": "Multiplayer.Multiplayer.Load",
Expand Down
20 changes: 2 additions & 18 deletions locale.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ sb/host__tooltip_disabled,Unused,,,,,,,,,,,,,,,,,,,,,,,,,,
sb/join_game,Join Game,Join Game,Присъединете се към играта ,加入游戏 ,加入遊戲 ,Připojte se ke hře,Deltag i spil,Speel mee,Liity peliin,Rejoins une partie,Spiel beitreten,खेल में शामिल हो,Belépni a játékba,Unisciti al gioco,ゲームに参加します,게임 참여,Bli med i spillet,Dołącz do gry,Entrar no jogo ,Entrar no jogo ,Alatura-te jocului,Присоединиться к игре,Pridať sa do hry,Unete al juego,Gå med i spel,Oyuna katılmak,Приєднуйся до гри
sb/join_game__tooltip,The tooltip shown when hovering over the 'Join Server' button.,Join a multiplayer session.,Присъединете се към мултиплейър сесия. ,加入多人游戏会话。 ,加入多人遊戲會話。 ,Připojte se k relaci pro více hráčů. ,Deltag i en multiplayer session.,Neem deel aan een multiplayersessie.,Liity moninpeliistuntoon.,Rejoignez une session multijoueur.,Nehmen Sie an einer Multiplayer-Sitzung teil.,मल्टीप्लेयर सत्र में शामिल हों.,Csatlakozz egy többjátékos munkamenethez.,Partecipa a una sessione multigiocatore.,マルチプレイヤー セッションに参加します。,멀티플레이어 세션에 참여하세요.,Bli med på en flerspillerøkt.,Dołącz do sesji wieloosobowej.,Participe de uma sessão multijogador.,Participe numa sessão multijogador. ,Alăturați-vă unei sesiuni multiplayer.,Присоединяйтесь к многопользовательской сессии.,Pripojte sa k relácii pre viacerých hráčov.,Únete a una sesión multijugador.,Gå med i en multiplayer-session.,Çok oyunculu bir oturuma katılın.,Приєднуйтеся до багатокористувацької сесії.
sb/join_game__tooltip_disabled,The tooltip shown when hovering over the 'Join Server' button.,Select a game to join.,,,,,,,,,,,,,,,,,,,,,,,,
sb/Refresh,refresh,Refresh,Опресняване ,刷新 ,重新整理 ,Obnovit ,Opdater,Vernieuwen,virkistää,Rafraîchir,Aktualisierung,ताज़ा करना,Frissítés,ricaricare,リフレッシュ,새로 고치다,Forfriske,Odświeżać,Atualizar ,Atualizar ,Reîmprospăta,Обновить,Obnoviť,Actualizar,Uppdatera,Yenile,Оновити
sb/Refresh__tooltip,The tooltip shown when hovering over the 'Refresh Server' button.,Refresh Server list.,Обновяване на списъка със сървъри. ,刷新服务器列表。 ,刷新伺服器清單。 ,Obnovit seznam serverů. ,Opdater serverliste.,Vernieuw de serverlijst.,Päivitä palvelinluettelo.,Actualiser la liste des serveurs.,Serverliste aktualisieren.,सर्वर सूची ताज़ा करें.,Szerverlista frissítése.,Aggiorna l'elenco dei server.,サーバーリストを更新します。,서버 목록을 새로 고칩니다.,Oppdater serverlisten.,Odśwież listę serwerów.,Atualizar lista de servidores.,Atualizar lista de servidores. ,Actualizează lista de servere.,Обновить список серверов.,Obnoviť zoznam serverov.,Actualizar la lista de servidores.,Uppdatera serverlistan.,Sunucu listesini yenileyin.,Оновити список серверів.
sb/refresh,refresh,Refresh,Опресняване ,刷新 ,重新整理 ,Obnovit ,Opdater,Vernieuwen,virkistää,Rafraîchir,Aktualisierung,ताज़ा करना,Frissítés,ricaricare,リフレッシュ,새로 고치다,Forfriske,Odświeżać,Atualizar ,Atualizar ,Reîmprospăta,Обновить,Obnoviť,Actualizar,Uppdatera,Yenile,Оновити
sb/refresh__tooltip,The tooltip shown when hovering over the 'Refresh Server' button.,Refresh server list.,Обновяване на списъка със сървъри. ,刷新服务器列表。 ,刷新伺服器清單。 ,Obnovit seznam serverů. ,Opdater serverliste.,Vernieuw de serverlijst.,Päivitä palvelinluettelo.,Actualiser la liste des serveurs.,Serverliste aktualisieren.,सर्वर सूची ताज़ा करें.,Szerverlista frissítése.,Aggiorna l'elenco dei server.,サーバーリストを更新します。,서버 목록을 새로 고칩니다.,Oppdater serverlisten.,Odśwież listę serwerów.,Atualizar lista de servidores.,Atualizar lista de servidores. ,Actualizează lista de servere.,Обновить список серверов.,Obnoviť zoznam serverov.,Actualizar la lista de servidores.,Uppdatera serverlistan.,Sunucu listesini yenileyin.,Оновити список серверів.
sb/refresh__tooltip_disabled,Unused,,,,,,,,,,,,,,,,,,,,,,,,,,
sb/ip,IP popup,Enter IP Address,Въведете IP адрес,输入IP地址 ,輸入IP位址 ,Zadejte IP adresu ,Indtast IP-adresse,Voer het IP-adres in,Anna IP-osoite,Entrer l’adresse IP,IP Adresse eingeben,आईपी ​​पता दर्ज करें,Írja be az IP-címet,Inserire Indirizzo IP,IPアドレスを入力してください,IP 주소를 입력하세요,Skriv inn IP-adresse,Wprowadź adres IP,Digite o endereço IP ,Introduza o endereço IP ,Introduceți adresa IP,Введите IP-адрес,Zadajte IP adresu,Ingrese la dirección IP,Ange IP-adress,IP Adresini Girin,Введіть IP-адресу
sb/ip_invalid,Invalid IP popup.,Invalid IP Address!,Невалиден IP адрес! ,IP 地址无效! ,IP 位址無效! ,Neplatná IP adresa! ,Ugyldig IP-adresse!,Ongeldig IP-adres!,Virheellinen IP-osoite!,Adresse IP invalide,Ungültige IP Adresse!,अमान्य आईपी पता!,Érvénytelen IP-cím!,Indirizzo IP Invalido!,IP アドレスが無効です!,IP 주소가 잘못되었습니다!,Ugyldig IP-adresse!,Nieprawidłowy adres IP!,Endereço IP inválido! ,Endereço IP inválido! ,Adresă IP nevalidă!,Неверный IP-адрес!,Neplatná IP adresa!,¡Dirección IP inválida!,Ogiltig IP-adress!,Geçersiz IP adresi!,Недійсна IP-адреса!
Expand All @@ -45,22 +45,6 @@ host/start,Maximum players slider label,Start,Започнете,开始 ,開始,
host/start__tooltip,Maximum players slider tooltip,Start the server.,Стартирайте сървъра. ,启动服务器。 ,啟動伺服器。 ,Spusťte server.,Start serveren.,Start de server.,Käynnistä palvelin.,Démarrez le serveur.,Starten Sie den Server.,सर्वर प्रारंभ करें.,Indítsa el a szervert.,Avviare il server.,サーバーを起動します。,서버를 시작합니다.,Start serveren.,Uruchom serwer.,Inicie o servidor. ,Inicie o servidor. ,Porniți serverul.,Запустите сервер.,Spustite server.,Inicie el servidor.,Starta servern.,Sunucuyu başlatın.,Запустіть сервер.
host/start__tooltip_disabled,Maximum players slider tooltip,Check your settings are valid.,Проверете дали вашите настройки са валидни. ,检查您的设置是否有效。 ,檢查您的設定是否有效。 ,"Zkontrolujte, zda jsou vaše nastavení platná. ",Tjek at dine indstillinger er gyldige.,Controleer of uw instellingen geldig zijn.,"Tarkista, että asetuksesi ovat oikein.",Vérifiez que vos paramètres sont valides.,"Überprüfen Sie, ob Ihre Einstellungen gültig sind.",जांचें कि आपकी सेटिंग्स वैध हैं।,"Ellenőrizze, hogy a beállítások érvényesek-e.",Controlla che le tue impostazioni siano valide.,設定が有効であることを確認してください。,설정이 유효한지 확인하세요.,Sjekk at innstillingene dine er gyldige.,"Sprawdź, czy ustawienia są prawidłowe.",Verifique se suas configurações são válidas. ,Verifique se as suas definições são válidas. ,Verificați că setările dvs. sunt valide.,"Убедитесь, что ваши настройки действительны.","Skontrolujte, či sú vaše nastavenia platné.",Verifique que su configuración sea válida.,Kontrollera att dina inställningar är giltiga.,Ayarlarınızın geçerli olup olmadığını kontrol edin.,Перевірте правильність ваших налаштувань.
,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Server Host,,,,,,,,,,,,,,,,,,,,,,,,,,
host/title,The title of the Host Game page,Host Game,,,,,,,,,,,,,,,,,,,,,,,,,
host/name,Server name field placeholder,Server Name,,,,,,,,,,,,,,,,,,,,,,,,,
host/name__tooltip,Server name field tooltip,The name of the server that other players will see in the server browser,,,,,,,,,,,,,,,,,,,,,,,,,
host/password,Password field placeholder,Password (leave blank for no password),,,,,,,,,,,,,,,,,,,,,,,,,
host/password__tooltip,Password field placeholder,Password for joining the game. Leave blank if no password is required,,,,,,,,,,,,,,,,,,,,,,,,,
host/public,Public checkbox label,Public Game,,,,,,,,,,,,,,,,,,,,,,,,,
host/public__tooltip,Public checkbox tooltip,List this game in the server browser.,,,,,,,,,,,,,,,,,,,,,,,,,
host/details,Details field placeholder,Enter some details about your server,,,,,,,,,,,,,,,,,,,,,,,,,
host/details__tooltip,Details field tooltip,Details about your server visible in the server browser.,,,,,,,,,,,,,,,,,,,,,,,,,
host/max_players,Maximum players slider label,Maximum Players,,,,,,,,,,,,,,,,,,,,,,,,,
host/max_players__tooltip,Maximum players slider tooltip,Maximum players allowed to join the game.,,,,,,,,,,,,,,,,,,,,,,,,,
host/start,Maximum players slider label,Start,,,,,,,,,,,,,,,,,,,,,,,,,
host/start__tooltip,Maximum players slider tooltip,Start the server.,,,,,,,,,,,,,,,,,,,,,,,,,
host/start__tooltip_disabled,Maximum players slider tooltip,Check your settings are valid.,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Disconnect Reason,,,,,,,,,,,,,,,,,,,,,,,,,,
dr/invalid_password,Invalid password popup.,Invalid Password!,Невалидна парола! ,无效的密码! ,無效的密碼! ,Neplatné heslo! ,Forkert kodeord!,Ongeldig wachtwoord!,Väärä salasana!,Mot de passe incorrect !,Ungültiges Passwort!,अवैध पासवर्ड!,Érvénytelen jelszó!,Password non valida!,無効なパスワード!,유효하지 않은 비밀번호!,Ugyldig passord!,Nieprawidłowe hasło!,Senha inválida! ,Verifique se as suas definições são válidas. ,Parolă Invalidă!,Неверный пароль!,Nesprávne heslo!,¡Contraseña invalida!,Felaktigt lösenord!,Geçersiz şifre!,Невірний пароль!
dr/game_version,Different game versions.,"Game version mismatch! Server version: {0}, your version: {1}.","Несъответствие на версията на играта! Версия на сървъра: {0}, вашата версия: {1}. ",游戏版本不匹配!服务器版本:{0},您的版本:{1}。 ,遊戲版本不符!伺服器版本:{0},您的版本:{1}。 ,"Nesoulad verze hry! Verze serveru: {0}, vaše verze: {1}.","Spilversionen stemmer ikke overens! Serverversion: {0}, din version: {1}.","Spelversie komt niet overeen! Serverversie: {0}, jouw versie: {1}.","Peliversio ei täsmää! Palvelimen versio: {0}, sinun versiosi: {1}.","Version du jeu incompatible ! Version du serveur : {0}, version locale : {1}","Spielversion stimmt nicht überein! Server Version: {0}, Lokale Version: {1}.","गेम संस्करण बेमेल! सर्वर संस्करण: {0}, आपका संस्करण: {1}.","Nem egyezik a játék verziója! Szerververzió: {0}, az Ön verziója: {1}.","Versioni del gioco non combacianti! Versione del Server: {0}, La tua versione: {1}.",ゲームのバージョンが不一致です!サーバーのバージョン: {0}、あなたのバージョン: {1}。,"게임 버전이 일치하지 않습니다! 서버 버전: {0}, 귀하의 버전: {1}.","Spillversjonen samsvarer ikke! Serverversjon: {0}, din versjon: {1}.","Niezgodna wersja gry! Wersja serwera: {0}, Twoja wersja: {1}.","Incompatibilidade de versão do jogo! Versão do servidor: {0}, sua versão: {1}. ","Incompatibilidade de versão do jogo! Versão do servidor: {0}, a sua versão: {1}. ","Versiunea jocului nepotrivită! Versiunea serverului: {0}, versiunea dvs.: {1}.","Несоответствие версии игры! Версия сервера: {0}, ваша версия: {1}.","Nesúlad verzie hry! Verzia servera: {0}, vaša verzia: {1}.","¡La versión del juego no coincide! Versión del servidor: {0}, tu versión: {1}.","Spelversionen matchar inte! Serverversion: {0}, din version: {1}.","Oyun sürümü uyuşmazlığı! Sunucu sürümü: {0}, sürümünüz: {1}.","Невідповідність версії гри! Версія сервера: {0}, ваша версія: {1}."
Expand Down

0 comments on commit 0fa44a6

Please sign in to comment.