mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Bug fix for menu items
This commit is contained in:
parent
3d859555ad
commit
3d2c11f469
57 changed files with 73 additions and 172 deletions
|
@ -22,9 +22,12 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void Update()
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
//if (Workspace.animationDef == null) return;
|
||||
|
||||
if (actorID != Workspace.actorID || hashcode != CustomTags.defNames.GetHashCode())
|
||||
//if (actorID != Workspace.actorID || hashcode != CustomTags.defNames.GetHashCode())
|
||||
//{ UpdateDropdown(); }
|
||||
|
||||
if (hashcode != CustomTags.defNames.GetHashCode())
|
||||
{ UpdateDropdown(); }
|
||||
}
|
||||
|
||||
|
@ -33,21 +36,26 @@ namespace RimWorldAnimationStudio
|
|||
if (dropdown == null)
|
||||
{ OnEnable(); }
|
||||
|
||||
string alienRaceDefName = Workspace.animationDef.actors[Workspace.actorID].GetAlienRaceDef().defName;
|
||||
dropdown.ClearOptions();
|
||||
|
||||
/*string alienRaceDefName = Workspace.animationDef.actors[Workspace.actorID].GetAlienRaceDef().defName;
|
||||
|
||||
dropdown.ClearOptions();
|
||||
dropdown.options.Add(new Dropdown.OptionData(alienRaceDefName));
|
||||
dropdown.value = 0;
|
||||
label.text = alienRaceDefName;
|
||||
dropdown.options.Add(new Dropdown.OptionData(alienRaceDefName));*/
|
||||
|
||||
IEnumerable<string> optionsList = Tags.defNames.Concat(CustomTags.defNames);
|
||||
foreach (string defName in optionsList)
|
||||
{
|
||||
if (defName != alienRaceDefName)
|
||||
{ dropdown.options.Add(new Dropdown.OptionData(defName)); }
|
||||
//if (defName != alienRaceDefName)
|
||||
//{ dropdown.options.Add(new Dropdown.OptionData(defName)); }
|
||||
|
||||
dropdown.options.Add(new Dropdown.OptionData(defName));
|
||||
}
|
||||
|
||||
actorID = Workspace.actorID;
|
||||
dropdown.value = 0;
|
||||
label.text = dropdown.options[0].text;
|
||||
|
||||
//actorID = Workspace.actorID;
|
||||
hashcode = CustomTags.defNames.GetHashCode();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue