Author Topic: [request] static UIToggle.GetActivatedToggle(group)  (Read 3535 times)

magicpotato

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
[request] static UIToggle.GetActivatedToggle(group)
« on: November 11, 2013, 12:35:42 AM »
Hello 8) I want to put following code into UIToggle.cs

Also I want to change the type of group to string for development efficiency.
The compare cost this case is not big issue on today.

    static public UIToggle GetActivatedToggle(int group)
    {
        foreach(UIToggle toggle in list)
            if (toggle.group == group && toggle.value)
                return toggle;
        return null;
    }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [request] static UIToggle.GetActivatedToggle(group)
« Reply #1 on: November 11, 2013, 12:27:44 PM »
Sounds useful to me. I've added
  1. static public UIToggle GetActiveToggle (int group)
to UIToggle on my end, so you will see it in the next update.