private void refresh() { bool conflicted = false; int totalIndex = 0; for (int ii = 0; ii < actionButtons.Length; ii++) { int index = ii; if (!Settings.UsedByGamepad((FrameInput.InputType)index)) { continue; } IChoosable choice = TotalChoices[totalIndex / SLOTS_PER_PAGE][totalIndex % SLOTS_PER_PAGE]; ((MenuText)((MenuElementChoice)choice).Elements[1]).SetText("(" + actionButtons[index].ToLocal() + ")"); if (actionConflicts(index)) { ((MenuText)((MenuElementChoice)choice).Elements[0]).Color = Color.Red; ((MenuText)((MenuElementChoice)choice).Elements[1]).Color = Color.Red; conflicted = true; } else if (actionButtons[index] != DiagManager.Instance.CurSettings.ActionButtons[index]) { ((MenuText)((MenuElementChoice)choice).Elements[0]).Color = Color.Yellow; ((MenuText)((MenuElementChoice)choice).Elements[1]).Color = Color.Yellow; } else { ((MenuText)((MenuElementChoice)choice).Elements[0]).Color = Color.White; ((MenuText)((MenuElementChoice)choice).Elements[1]).Color = Color.White; } totalIndex++; } totalIndex++; if (conflicted) { IChoosable choice = TotalChoices[totalIndex / SLOTS_PER_PAGE][totalIndex % SLOTS_PER_PAGE]; ((MenuTextChoice)choice).Enabled = false; ((MenuText)((MenuTextChoice)choice).Text).Color = Color.Red; } else { IChoosable choice = TotalChoices[totalIndex / SLOTS_PER_PAGE][totalIndex % SLOTS_PER_PAGE]; ((MenuTextChoice)choice).Enabled = true; ((MenuText)((MenuTextChoice)choice).Text).Color = Color.White; } }
protected void SetPage(int page) { CurrentPage = page; if (TotalChoices.Length == 1 && !ShowPagesOnSingle) { PageText.Text = ""; } else { PageText.Text = "(" + (CurrentPage + 1) + "/" + TotalChoices.Length + ")"; } IChoosable[] choices = new IChoosable[TotalChoices[CurrentPage].Length]; for (int ii = 0; ii < choices.Length; ii++) { choices[ii] = TotalChoices[CurrentPage][ii]; } SetChoices(choices); CurrentChoice = Math.Min(CurrentChoice, choices.Length - 1); }