- sub list in the main menu is refreshed when MainMenuScreen is selected (-> downloaded and newly created subs appear in the list)
- fixed "editing menu" not disappearing after an entity is removed in the editor - debugconsole textbox is automatically selected when opening the console - clearing the current gamesession if returning to main menu using the console
This commit is contained in:
@@ -95,6 +95,7 @@ namespace Barotrauma
|
|||||||
if (isOpen)
|
if (isOpen)
|
||||||
{
|
{
|
||||||
textBox.Select();
|
textBox.Select();
|
||||||
|
AddToGUIUpdateList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -427,6 +428,14 @@ namespace Barotrauma
|
|||||||
case "mainmenuscreen":
|
case "mainmenuscreen":
|
||||||
case "mainmenu":
|
case "mainmenu":
|
||||||
case "menu":
|
case "menu":
|
||||||
|
GameMain.GameSession = null;
|
||||||
|
|
||||||
|
List<Character> characters = new List<Character>(Character.CharacterList);
|
||||||
|
foreach (Character c in characters)
|
||||||
|
{
|
||||||
|
c.Remove();
|
||||||
|
}
|
||||||
|
|
||||||
GameMain.MainMenuScreen.Select();
|
GameMain.MainMenuScreen.Select();
|
||||||
break;
|
break;
|
||||||
case "gamescreen":
|
case "gamescreen":
|
||||||
|
|||||||
@@ -346,6 +346,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
mapEntityList.Remove(this);
|
mapEntityList.Remove(this);
|
||||||
|
|
||||||
|
if (selectedList.Contains(this))
|
||||||
|
{
|
||||||
|
selectedList.Remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
if (aiTarget != null) aiTarget.Remove();
|
if (aiTarget != null) aiTarget.Remove();
|
||||||
|
|
||||||
if (linkedTo != null)
|
if (linkedTo != null)
|
||||||
|
|||||||
@@ -92,30 +92,7 @@ namespace Barotrauma
|
|||||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Selected submarine:", null, null, Alignment.Left, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Selected submarine:", null, null, Alignment.Left, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||||
subList = new GUIListBox(new Rectangle(0, 30, 230, panelRect.Height-100), GUI.Style, menuTabs[(int)Tab.NewGame]);
|
subList = new GUIListBox(new Rectangle(0, 30, 230, panelRect.Height-100), GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||||
|
|
||||||
var subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
UpdateSubList();
|
||||||
|
|
||||||
foreach (Submarine sub in subsToShow)
|
|
||||||
{
|
|
||||||
var textBlock = new GUITextBlock(
|
|
||||||
new Rectangle(0, 0, 0, 25),
|
|
||||||
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width-65), GUI.Style,
|
|
||||||
Alignment.Left, Alignment.Left, subList)
|
|
||||||
{
|
|
||||||
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
|
||||||
ToolTip = sub.Description,
|
|
||||||
UserData = sub
|
|
||||||
};
|
|
||||||
|
|
||||||
if (sub.HasTag(SubmarineTag.Shuttle))
|
|
||||||
{
|
|
||||||
textBlock.TextColor = textBlock.TextColor * 0.85f;
|
|
||||||
|
|
||||||
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
|
||||||
shuttleText.TextColor = textBlock.TextColor * 0.8f;
|
|
||||||
shuttleText.ToolTip = textBlock.ToolTip;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Submarine.SavedSubmarines.Count > 0) subList.Select(Submarine.SavedSubmarines[0]);
|
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle((int)(subList.Rect.Width + 20), 0, 100, 20),
|
new GUITextBlock(new Rectangle((int)(subList.Rect.Width + 20), 0, 100, 20),
|
||||||
"Save name: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
"Save name: ", GUI.Style, Alignment.Left, Alignment.Left, menuTabs[(int)Tab.NewGame]);
|
||||||
@@ -218,9 +195,41 @@ namespace Barotrauma
|
|||||||
|
|
||||||
Submarine.Unload();
|
Submarine.Unload();
|
||||||
|
|
||||||
|
UpdateSubList();
|
||||||
|
|
||||||
SelectTab(null, 0);
|
SelectTab(null, 0);
|
||||||
//selectedTab = 0;
|
//selectedTab = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateSubList()
|
||||||
|
{
|
||||||
|
var subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
||||||
|
|
||||||
|
subList.ClearChildren();
|
||||||
|
|
||||||
|
foreach (Submarine sub in subsToShow)
|
||||||
|
{
|
||||||
|
var textBlock = new GUITextBlock(
|
||||||
|
new Rectangle(0, 0, 0, 25),
|
||||||
|
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 65), GUI.Style,
|
||||||
|
Alignment.Left, Alignment.Left, subList)
|
||||||
|
{
|
||||||
|
Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f),
|
||||||
|
ToolTip = sub.Description,
|
||||||
|
UserData = sub
|
||||||
|
};
|
||||||
|
|
||||||
|
if (sub.HasTag(SubmarineTag.Shuttle))
|
||||||
|
{
|
||||||
|
textBlock.TextColor = textBlock.TextColor * 0.85f;
|
||||||
|
|
||||||
|
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
|
||||||
|
shuttleText.TextColor = textBlock.TextColor * 0.8f;
|
||||||
|
shuttleText.ToolTip = textBlock.ToolTip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Submarine.SavedSubmarines.Count > 0) subList.Select(Submarine.SavedSubmarines[0]);
|
||||||
|
}
|
||||||
|
|
||||||
public bool SelectTab(GUIButton button, object obj)
|
public bool SelectTab(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user