Merge branch 'dev' of https://github.com/Regalis11/Barotrauma.git into unstable-tests

This commit is contained in:
Evil Factory
2022-04-11 15:58:36 -03:00
38 changed files with 361 additions and 184 deletions
@@ -67,7 +67,7 @@ namespace Barotrauma
{
OnClicked = (guiButton, o) =>
{
GameMain.Client.Disconnect();
GameMain.Client?.Disconnect();
GameMain.MainMenuScreen.Select();
return false;
}
@@ -153,7 +153,7 @@ namespace Barotrauma
buttonContainerSpacing(0.2f);
button(TextManager.Get("No"), () =>
{
GameMain.Client.Disconnect();
GameMain.Client?.Disconnect();
GameMain.MainMenuScreen.Select();
});
buttonContainerSpacing(0.1f);
@@ -170,11 +170,14 @@ namespace Barotrauma
buttonContainerSpacing(0.15f);
button(TextManager.Get("SubscribeToAllOnWorkshop"), () =>
{
BulkDownloader.SubscribeToServerMods(missingIds,
rejoinEndpoint: GameMain.Client.ClientPeer.ServerConnection.EndPointString,
rejoinLobby: SteamManager.CurrentLobbyID,
rejoinServerName: GameMain.NetLobbyScreen.ServerName.Text);
GameMain.Client.Disconnect();
if (GameMain.Client != null)
{
BulkDownloader.SubscribeToServerMods(missingIds,
rejoinEndpoint: GameMain.Client.ClientPeer.ServerConnection.EndPointString,
rejoinLobby: SteamManager.CurrentLobbyID,
rejoinServerName: GameMain.NetLobbyScreen.ServerName.Text);
GameMain.Client.Disconnect();
}
GameMain.MainMenuScreen.Select();
}, width: 0.7f);
buttonContainerSpacing(0.15f);
@@ -3796,20 +3796,27 @@ namespace Barotrauma
OnSelected = SelectWire
};
List<ItemPrefab> wirePrefabs = new List<ItemPrefab>();
foreach (ItemPrefab itemPrefab in ItemPrefab.Prefabs)
{
if (itemPrefab.Name.IsNullOrEmpty()) { continue; }
if (itemPrefab.Name.IsNullOrEmpty() || itemPrefab.HideInMenus) { continue; }
if (!itemPrefab.Tags.Contains("wire")) { continue; }
wirePrefabs.Add(itemPrefab);
}
foreach (ItemPrefab itemPrefab in wirePrefabs.OrderBy(w => !w.CanBeBought).ThenBy(w => w.UintIdentifier))
{
GUIFrame imgFrame = new GUIFrame(new RectTransform(new Point(listBox.Content.Rect.Width, listBox.Rect.Width / 2), listBox.Content.RectTransform), style: "ListBoxElement")
{
UserData = itemPrefab
};
var img = new GUIImage(new RectTransform(new Vector2(0.9f), imgFrame.RectTransform, Anchor.Center), itemPrefab.Sprite, scaleToFit: true)
{
UserData = itemPrefab,
Color = itemPrefab.SpriteColor
Color = itemPrefab.SpriteColor,
HoverColor = Color.Lerp(itemPrefab.SpriteColor, Color.White, 0.3f),
SelectedColor = Color.Lerp(itemPrefab.SpriteColor, Color.White, 0.6f)
};
}