a75a560...814f6c9
commit 814f6c9dd4d48b3931e1d3bcb1918ff79324c1d4 Author: Joonas Rikkonen <poe.regalis@gmail.com> Date: Wed Mar 20 19:33:18 2019 +0200 Fixed multiplayer campaign setup UI showing the client's subs instead of the server's (see #1311) commit 4a3e485dea85aa21037b13fd1b86af4a4ec1a5fd Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 19:16:17 2019 +0200 Move new texts in the end of the localization file. commit 5a8af99afe5aad0b2f5343ca6f923d8c7eb19e68 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 19:05:43 2019 +0200 Recreate the editing gui window when resetting the entities with the "resetall" command. commit 0048e6dcb9699e5b1e434ace867bc8f426cdae28 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 19:04:42 2019 +0200 Fix resetting to prefab. commit 88be0923761f5ac2c895364c8ad0e11fe9a66576 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 18:40:13 2019 +0200 Fix item components not being loaded properly. commit 6f970d54ed800eff25ae3643b03c0020336c8621 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 18:21:25 2019 +0200 Add a console command for resetting all items and structures to the prefabs. commit bd561ef43391a2e4251bef18a8738b233f540961 Merge: e8843c30c a75a56088 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 17:47:14 2019 +0200 Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev commit e8843c30cdb966832236ec361494e4c886130590 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Wed Mar 20 17:46:38 2019 +0200 Implement item and structure instance resetting to prefab. Add buttons in the subeditor. Allow to save the msg text in the editor.
This commit is contained in:
@@ -31,14 +31,14 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
private bool isMultiplayer;
|
||||
private readonly bool isMultiplayer;
|
||||
|
||||
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<string> saveFiles=null)
|
||||
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<Submarine> submarines, IEnumerable<string> saveFiles = null)
|
||||
{
|
||||
this.isMultiplayer = isMultiplayer;
|
||||
this.newGameContainer = newGameContainer;
|
||||
this.loadGameContainer = loadGameContainer;
|
||||
|
||||
|
||||
var columnContainer = new GUILayoutGroup(new RectTransform(Vector2.One, newGameContainer.RectTransform), isHorizontal: true)
|
||||
{
|
||||
Stretch = true,
|
||||
@@ -60,7 +60,7 @@ namespace Barotrauma
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), leftColumn.RectTransform), TextManager.Get("SelectedSub") + ":", textAlignment: Alignment.BottomLeft);
|
||||
subList = new GUIListBox(new RectTransform(new Vector2(1.0f, 0.65f), leftColumn.RectTransform));
|
||||
|
||||
UpdateSubList();
|
||||
UpdateSubList(submarines);
|
||||
|
||||
// New game right side
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), rightColumn.RectTransform), TextManager.Get("SaveName") + ":", textAlignment: Alignment.BottomLeft);
|
||||
@@ -87,9 +87,8 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
Submarine selectedSub = subList.SelectedData as Submarine;
|
||||
if (selectedSub == null) return false;
|
||||
|
||||
if (!(subList.SelectedData is Submarine selectedSub)) { return false; }
|
||||
|
||||
if (string.IsNullOrEmpty(selectedSub.MD5Hash.Hash))
|
||||
{
|
||||
((GUITextBlock)subList.SelectedComponent).TextColor = Color.DarkRed * 0.8f;
|
||||
@@ -193,12 +192,12 @@ namespace Barotrauma
|
||||
saveNameBox.Text = Path.GetFileNameWithoutExtension(savePath);
|
||||
}
|
||||
|
||||
public void UpdateSubList()
|
||||
public void UpdateSubList(IEnumerable<Submarine> submarines)
|
||||
{
|
||||
#if DEBUG
|
||||
var subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
||||
var subsToShow = submarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
||||
#else
|
||||
var subsToShow = Submarine.SavedSubmarines;
|
||||
var subsToShow = submarines;
|
||||
#endif
|
||||
|
||||
subList.ClearChildren();
|
||||
|
||||
Reference in New Issue
Block a user