예제 #1
0
        void Start()
        {
            PartyModel model = AmbitionApp.GetModel <PartyModel>();

            _inventory = AmbitionApp.GetModel <InventoryModel>();
            List <GossipVO> gossipList  = AmbitionApp.Gossip.Gossip;
            int             gossipIndex = gossipList.Count - 1;

            PartyText.text     = AmbitionApp.Localize(PartyConstants.PARTY_NAME + model.Party.ID);
            FactionIcon.sprite = FactionIconConfig.GetSprite(model.Party.Faction.ToString());
            List <RewardItem> rewards = AmbitionApp.CreateRewardListItems(model.Rewards, listItem);
            OutfitVO          outfit  = _inventory.GetEquippedItem(ItemType.Outfit) as OutfitVO;

            if (outfit != null)
            {
                int novelty = outfit.Novelty - model.BaseNoveltyLoss - model.CumulativeNoveltyLoss * outfit.TimesWorn;
                if (novelty < 0)
                {
                    novelty = 0;
                }
                OutfitText.text        = AmbitionApp.Localization.GetItemName(outfit);
                NoveltySlider.value    = novelty;
                NoveltySliderText.text = novelty.ToString();
            }
            string host = AmbitionApp.Localize(PartyConstants.PARTY_HOST + model.Party.Host);

            if (string.IsNullOrEmpty(host))
            {
                host = model.Party.Host;
            }
            Dictionary <string, string> subs = new Dictionary <string, string>()
            {
                { HOST_TOKEN, host }
            };

            PartyHostText.text = AmbitionApp.Localize("after_party_dialog.host", subs);
            for (int i = rewards.Count - 1; i >= 0; --i)
            {
                if (rewards[i].Data.Type == CommodityType.Gossip)
                {
                    rewards[i].SetGossip(gossipList[gossipIndex]);
                    --gossipIndex;
                }
            }
        }