/// <summary>
    /// called by the "create new troop..." option from the demanding troop tier entry.
    /// should open the edit troop type panel for a new TT and then assign that new TT to the demandingEntry
    /// </summary>
    /// <param name="theDemandingEntry"></param>
    public void CreateNewTroopTypeForEntry(FactionTroopListEntry theDemandingEntry)
    {
        TroopType newTT = new TroopType(GameController.instance.LastRelevantTType);

        theDemandingEntry.SetContent(newTT);
        theDemandingEntry.RefreshInfoLabels();
        EditTierEntry(theDemandingEntry);
        GameInterface.instance.editFactionPanel.isDirty = true;
    }
 /// <summary>
 /// refreshes troop option names.
 /// should be called when rebuilding the tree or after a troop type has been edited
 /// </summary>
 public void UpdateTreeTroopOptions()
 {
     for (int i = 0; i < listContainer.childCount - 1; i++)
     {
         Transform             entry       = listContainer.GetChild(i);
         FactionTroopListEntry entryScript = entry.GetComponent <FactionTroopListEntry>();
         if (entryScript)
         {
             entryScript.RefreshInfoLabels();
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// refreshes troop option names.
 /// should be called when rebuilding the tree or after a troop type has been edited
 /// </summary>
 public void UpdateTroopTypeOptions()
 {
     trainedTroopType.RefreshInfoLabels();
 }