// -------------------------------------------------------------------------------
        //
        // -------------------------------------------------------------------------------
        private void OnEnable()
        {
            labelBtnNewGame.text  = Finder.txt.buttonNames.NewGame;
            labelBtnLoad.text     = Finder.txt.buttonNames.Load;
            labelBtnSettings.text = Finder.txt.buttonNames.Options;
            labelBtnCredits.text  = Finder.txt.buttonNames.Credits;
            labelBtnQuit.text     = Finder.txt.buttonNames.Quit;

            if (Finder.save.HasSaveFiles())
            {
                btnLoad.SetActive(true);
            }
            else
            {
                btnLoad.SetActive(false);
            }

            // -- Builds the Dictionaries
            DictionaryAttribute.load();
            DictionaryCharacterClass.load();
            DictionaryCharacterHero.load();
            DictionaryCombatStyle.load();
            DictionaryDungeon.load();
            DictionaryElement.load();
            DictionaryEquipment.load();
            DictionaryEquipmentSlot.load();
            DictionaryGossip.load();
            DictionaryItem.load();
            DictionarySkill.load();
            DictionarySpecies.load();
            DictionaryStatus.load();
            DictionaryTile.load();
            DictionaryTown.load();
        }
예제 #2
0
        // -------------------------------------------------------------------------------
        // OnEnable
        // -------------------------------------------------------------------------------
        void OnEnable()
        {
            SetShopType(true);

            gossipIndex = 0;
            gossip      = DictionaryGossip.GetGossip(shop.shopType);

            imageBackground.sprite = shop.imageBackground;
            imageShopkeeper.sprite = shop.imageShopkeeper;

            Finder.log.Clear();

            if (shop.welcomeText.Length > 0)
            {
                Finder.log.Add(shop.welcomeText);
            }

            SetHeaderText(shop.fullName);

            if (buttonRest != null && shop.shopType != ShopType.ShopInn)
            {
                buttonRest.SetActive(false);
            }
            else
            {
                buttonBuy.SetActive(false);
                buttonRest.SetActive(true);
            }

            if (buttonSell != null)
            {
                buttonSell.SetActive(shop.canSell);
            }

            if (buttonGossip != null)
            {
                if (!gossip.Any())
                {
                    buttonGossip.SetActive(false);
                }
                else
                {
                    buttonGossip.SetActive(true);
                }
            }

            if (!shopInsidePanel.activeInHierarchy)
            {
                if (IsSell)
                {
                    buttonGroupOutside.SetActive(false);
                    if (imageShopkeeper != null)
                    {
                        imageShopkeeper.enabled = false;
                    }
                }
                else
                {
                    buttonGroupOutside.SetActive(true);
                    if (imageShopkeeper != null)
                    {
                        imageShopkeeper.enabled = true;
                    }
                }
            }
            else
            {
                if (buttonGroupInside != null)
                {
                    buttonGroupInside.SetActive(true);
                }

                if (imageShopkeeper != null)
                {
                    imageShopkeeper.enabled = false;
                }
            }
        }