Skip to content

Commit

Permalink
Cache Shit Properly
Browse files Browse the repository at this point in the history
  • Loading branch information
MistressPlague authored Nov 8, 2020
1 parent d630965 commit e9f2636
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions PlagueGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,24 @@ public static DropDownData DropDown(Rect PositionAndScale, string MainButtonText

foreach (KeyValuePair<Tuple<string, string, ButtonType, bool>, Action<bool>> Button in Buttons)
{
if (!DropDownState[DropData].BoolCache.ContainsKey(Button.Value))
if (!DropDownState[DropData].StringCache.ContainsKey(Button.Value))
{
DropDownState[DropData].BoolCache[Button.Value] = Button.Key.Item4;
DropDownState[DropData].StringCache[Button.Value] = Button.Key.Item1;
}

if (!DropDownState[DropData].StringCache.ContainsKey(Button.Value))
if (!DropDownState[DropData].IntCache.ContainsKey(Button.Value))
{
DropDownState[DropData].StringCache[Button.Value] = Button.Key.Item1;
DropDownState[DropData].IntCache[Button.Value] = 0;
}

if (!DropDownState[DropData].FloatCache.ContainsKey(Button.Value))
{
DropDownState[DropData].FloatCache[Button.Value] = 0f;
}

if (!DropDownState[DropData].BoolCache.ContainsKey(Button.Value))
{
DropDownState[DropData].BoolCache[Button.Value] = Button.Key.Item4;
}

void MakeButton()
Expand Down

0 comments on commit e9f2636

Please sign in to comment.