public override bool Update(bool hasFocus) { var ret = base.Update(hasFocus); if (m_okButton.Enabled && !MyTutorialHelper.IsUnlocked(((Tuple <string, MyWorldInfo>)m_scenarioTable.SelectedRow.UserData).Item2.SessionName) && !MyFakes.DEVELOPMENT_PRESET) { m_okButton.Enabled = false; } return(ret); }
protected void RefreshGameList(bool tutorials = false) { int selectedIndex = m_scenarioTable.SelectedRowIndex ?? -1; m_scenarioTable.Clear(); Color?color = null; for (int index = 0; index < m_availableSaves.Count; index++) { var checkpoint = m_availableSaves[index].Item2; var name = new StringBuilder(checkpoint.SessionName); if (tutorials) { if (MyTutorialHelper.IsUnlocked(checkpoint.SessionName) || MyFakes.DEVELOPMENT_PRESET) { color = null; } else { color = Color.Gray; } } var row = new MyGuiControlTable.Row(m_availableSaves[index]); row.AddCell(new MyGuiControlTable.Cell(text: String.Empty, textColor: color, icon: GetIcon(m_availableSaves[index]))); row.AddCell(new MyGuiControlTable.Cell(text: name, textColor: color, userData: name)); m_scenarioTable.Add(row); // Select row with same world ID as we had before refresh. if (index == selectedIndex) { m_selectedRow = index; m_scenarioTable.SelectedRow = row; } } m_scenarioTable.SelectedRowIndex = m_selectedRow; m_scenarioTable.ScrollToSelection(); FillRight(); }