Exemplo n.º 1
0
        public void CopyUserMembership(NTLocalUser sourceRemoteUser, NTLocalUser destLocalUser)
        {
            ActionObserver.NotifyAction("Copying", "User Membership", sourceRemoteUser.FullName, destLocalUser.FullName);
            TextBank    existingMembers = new TextBank(destLocalUser.GetMembership());
            GroupCopier groupCopier     = new GroupCopier(false, false, true, DefaultUserPassword, false, ActionObserver);

            foreach (NTLocalGroup remoteGroup in sourceRemoteUser.GetMembership())
            {
                if (!existingMembers.ContainsText(remoteGroup.Name))
                {
                    NTLocalGroup localGroup = null;

                    // find a user by the same name of local machine
                    if (!NTHost.CurrentMachine.TryGetLocalGroup(remoteGroup.Name, out localGroup))
                    {
                        if (_importLocalGroups)
                        {
                            groupCopier.CopyRemoteGroupToLocalMachine(remoteGroup);
                        }
                    }

                    if (localGroup != null)
                    {
                        if (!existingMembers.ContainsText(localGroup.Name))
                        {
                            destLocalUser.AddMembership(localGroup);
                        }
                    }
                }
            }
        }
 void Start()
 {
     gameController = GameObject.Find("_GameController").GetComponent <GameController>();
     textBank       = GameObject.Find("_TextBank").GetComponent <TextBank>();
     player         = GameObject.Find("Player");
     currHealth     = maxHealth;
 }
Exemplo n.º 3
0
        void OnSelectPet(int qual)
        {
            lPet.PodeMudar = false;
            string nomeCriature = lista[qual].GetNomeEmLinguas;
            string txtNivelNum  = lista[qual].PetFeat.mNivel.Nivel.ToString();

            if (lista[qual].PetFeat.meusAtributos.PV.Corrente > 0)
            {
                string texto =
                    !armagedom?string.Format(TextBank.RetornaListaDeTextoDoIdioma(TextKey.criatureParaMostrador)[0], nomeCriature)
                        : string.Format(TextBank.RetornaListaDeTextoDoIdioma(TextKey.frasesDeArmagedom)[7], nomeCriature, txtNivelNum);


                AbstractGlobalController.Instance.Confirmation.StartConfirmationPanel(() => { QueroColocarEsse(qual); }, DeVoltaAoMenu,
                                                                                      texto
                                                                                      );
                thisState = LocalState.confirmationOpened;
                //if (cliqueDoPersonagem != null)
                //    cliqueDoPersonagem(transform.GetSiblingIndex() - 1);
            }
            else
            {
                AbstractGlobalController.Instance.OneMessage.StartMessagePanel(DeVoltaAoMenu,
                                                                               string.Format(TextBank.RetornaListaDeTextoDoIdioma(TextKey.criatureParaMostrador)[1], nomeCriature)
                                                                               );

                thisState = LocalState.singleMessageOpened;
            }
        }
        // Use this for initialization
        new void Start()
        {
            KeyVar myKeys = AbstractGameController.Instance.MyKeys;

            if (!myKeys.VerificaAutoShift(ID))
            {
                for (int i = 0; i < colocarTrue.Length; i++)
                {
                    myKeys.MudaShift(colocarTrue[i], true);
                }
            }

            if (colocarTrueCondicional != null)
            {
                for (int i = 0; i < colocarTrueCondicional.Length; i++)
                {
                    if (!myKeys.VerificaAutoShift(colocarTrueCondicional[i].condicao))
                    {
                        myKeys.MudaShift(colocarTrueCondicional[i].alvo, true);
                    }
                }
            }

            //myKeys.MudaAutoShift(ID, true);// Herika buga com esse mudaShift aqui
            myKeys.MudaShift(KeyShift.sempretrue, true);
            textoDoBotao = TextBank.RetornaFraseDoIdioma(TextKey.textoBaseDeAcao);

            NPC = esseNpc;
            base.Start();
        }
 void Awake()
 {
     playerRB  = GameObject.Find("Player").GetComponent <Rigidbody>();
     audioBank = GameObject.Find("_AudioBank").GetComponent <AudioBank>();
     textBank  = GameObject.Find("_TextBank").GetComponent <TextBank>();
     status    = GameObject.Find("Player").GetComponent <PlayerStatus>();
 }
Exemplo n.º 6
0
        void VerificaQualFala()
        {
            KeyVar myKeys = AbstractGameController.Instance.MyKeys;

            Debug.Log("ultimo indice no inicio: " + ultimoIndice);


            int indiceFinal = ultimoIndice > 0 ? Mathf.Min(ultimoIndice, falas.Length) : falas.Length;


            for (int i = 0; i < indiceFinal; i++)
            {
                if (myKeys.VerificaAutoShift(falas[i].ChaveCondicionalDaConversa))
                {
                    conversa     = TextBank.RetornaListaDeTextoDoIdioma(falas[i].ChaveDeTextoDaConversa).ToArray();
                    ultimoIndice = i;
                }
            }

            Debug.Log(indiceFinal + " : " + ultimoIndice);

            if (falas[ultimoIndice].Repetir >= 0)
            {
                string kCont = falas[ultimoIndice].ChaveCondicionalDaConversa.ToString();

                myKeys.SomaAutoCont(kCont, 1);
                if (falas[ultimoIndice].Repetir < myKeys.VerificaAutoCont(kCont))
                {
                    myKeys.MudaShift(falas[ultimoIndice].ChaveCondicionalDaConversa, false);
                }
            }
        }
Exemplo n.º 7
0
 private void OnRequestShowItem(MsgShowItem obj)
 {
     labelIntroduction.transform.parent.gameObject.SetActive(true);
     imgItem.sprite          = ResourcesFolders.GetMiniItem(obj.idItem);
     labelIntroduction.text  = "Você recebeu";
     numItens.text           = obj.quantidade.ToString();
     txtNameItem.text        = ItemBase.NomeEmLinguas(obj.idItem);
     txtDescriptionItem.text = TextBank.RetornaListaDeTextoDoIdioma(TextKey.shopInfoItem)[(int)obj.idItem];
 }
 void Start()
 {
     gameController           = GameObject.Find("_GameController").GetComponent <GameController>();
     audioBank                = GameObject.Find("_AudioBank").GetComponent <AudioBank>();
     textBank                 = GameObject.Find("_TextBank").GetComponent <TextBank>();
     controller               = GetComponent <PlayerController>();
     currHealth               = maxHealth;
     textBank.healthText.text = "Health: " + currHealth;
     initialHealthFrac        = healthBar.transform.localScale.x;
 }
Exemplo n.º 9
0
        public override void IniciaUsoDeMenu(GameObject dono, List <ItemBase> lista)
        {
            base.IniciaUsoDeMenu(dono, lista);
            Estado = ItemUseState.emEspera;

            Debug.LogError("painel de info na carta luva menu");
            MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
            {
                message = TextBank.RetornaFraseDoIdioma(TextKey.mensLuta)
            });

            //GameController.g.HudM.UmaMensagem.ConstroiPainelUmaMensagem(FecharMensagem, BancoDeTextos.RetornaFraseDoIdioma(ChaveDeTexto.mensLuta));
        }
Exemplo n.º 10
0
 public static string NomeEmLinguas(AttackNameId nome)
 {
     string[] arr = TextBank.RetornaListaDeTextoDoIdioma(TextKey.nomesDosGolpes).ToArray();
     if (arr.Length > (int)nome)
     {
         return(arr[(int)nome]);
     }
     else
     {
         Debug.LogError("O array de nomes de golpes não contem um nome para o ID= " + nome);
         return(nome.ToString());// BancoDeTextos.falacoes[heroi.lingua]["listaDeGolpes"][(int)Nome];
     }
 }
Exemplo n.º 11
0
        public void CopyRemoteGroupMembership(NTLocalGroup sourceRemoteGroup, NTLocalGroup destinationLocalGroup, NTObject[] destinationLocalGroupMembers)
        {
            ActionObserver.NotifyAction("Copy", "Remote Group Membership", sourceRemoteGroup.FullName, destinationLocalGroup.FullName);
            TextBank existingMembers = new TextBank(
                from obj in destinationLocalGroupMembers
                where obj is NTObject
                select(object) obj
                );


            #region debug region
            NTRemoteObject[] tmpObjects = sourceRemoteGroup.GetRemoteMembers();
            if (tmpObjects == null)
            {
                tmpObjects = new NTRemoteObject[0];
            }
            ActionObserver.NotifyInformation("Detected a total of {0} members for remote local group {1}", tmpObjects.Length, sourceRemoteGroup.FullName);
            foreach (NTRemoteObject remoteObject in tmpObjects)
            {
                ActionObserver.NotifyInformation("Member '{0}' its type is {1}", remoteObject.FullName, remoteObject.GetType().FullName);
            }

            #endregion


            NTRemoteObject[] remoteObjects = sourceRemoteGroup.GetRemoteMembers();
            if (remoteObjects == null)
            {
                remoteObjects = new NTRemoteObject[0];
            }
            ActionObserver.NotifyInformation("Detected a total of {0} AD members for remote local group {1}", remoteObjects.Length, sourceRemoteGroup.FullName);
            foreach (NTRemoteObject remoteObject in remoteObjects)
            {
                ActionObserver.NotifyInformation("AD Member '{0}' its is {1}", remoteObject.FullName, remoteObject.GetType().FullName);
            }



            foreach (NTRemoteObject remoteObject in remoteObjects)
            {
                string remoteObjectName = remoteObject.Domain + "\\" + remoteObject.Name;
                if (!existingMembers.ContainsText(remoteObjectName))
                {
                    destinationLocalGroup.AddMember(remoteObjectName);
                }
            }
        }
Exemplo n.º 12
0
        protected void IniciaUsoDesseItem(GameObject dono, bool podeUsar, bool temTipo = true, NomeTipos nomeDoTipo = NomeTipos.nulo)
        {
            //Manager = GameController.g.Manager;
            CriatureAlvoDoItem = dono.GetComponent <CharacterManager>().ActivePet;
            Transform pet = CriatureAlvoDoItem.transform;

            if (podeUsar && temTipo && RetirarUmItem(Lista, this, 1))
            {
                //GameController.g.HudM.ModoCriature(false);
                InicializacaoComum(dono, pet);
                Estado = ItemUseState.animandoBraco;
            }
            else
            {
                Estado = ItemUseState.finalizaUsaItem;
                if (!temTipo)
                {
                    Debug.LogError("Uma mensagem de não tem tipo");

                    MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
                    {
                        message = string.Format(TextBank.RetornaFraseDoIdioma(TextKey.itens),
                                                "<color = orange>" + nomeDoTipo + "</color>")
                    });

                    //GameController.g.HudM.Painel.AtivarNovaMens(string.Format(
                    //   BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.itens)[3], nomeDoTipo), 30, 5);
                }
                else if (!podeUsar)
                {
                    Debug.LogError("Uma mensagem de não pode usar");

                    MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
                    {
                        message = string.Format(TextBank.RetornaListaDeTextoDoIdioma(TextKey.mensLuta)[2],
                                                CriatureAlvoDoItem.MeuCriatureBase.GetNomeEmLinguas
                                                )
                    });

                    //GameController.g.HudM.Painel.AtivarNovaMens(string.Format(
                    //BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.mensLuta)[2],
                    //    CriatureAlvoDoItem.MeuCriatureBase.NomeEmLinguas), 30, 5);
                }
            }
        }
Exemplo n.º 13
0
        private void IniciaUsoDaCarta()
        {
            if (PodeUsar())
            {
                //Manager = GameController.g.Manager;
                Estado = ItemUseState.animandoBraco;
                RetirarUmItem(Lista, this, 1);
                PetManagerEnemy P = FindByOwner.GetManagerEnemy(Dono) as PetManagerEnemy;

                if (P)
                {
                    InicializacaoComum(Dono, P.transform /*GameController.g.InimigoAtivo.transform*/);
                    P.StopWithRememberedState();
                }
                else
                {
                    Debug.LogError("Uma mensagem para criature não focado");
                }
            }
            else
            {
                Estado = ItemUseState.finalizaUsaItem;

                MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
                {
                    message = TextBank.RetornaFraseDoIdioma(TextKey.mensLuta)
                });

                Debug.LogError("Uma mensagem de não pode usar");

                if (!FindByOwner.GetManagerEnemy(Dono))
                {
                    MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
                    {
                        message = TextBank.RetornaListaDeTextoDoIdioma(TextKey.mensLuta)[5]
                    });
                }


                //if (!GameController.g.estaEmLuta)
                //    GameController.g.HudM.Painel.AtivarNovaMens(BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.mensLuta)[0], 30, 7);
                //else if (GameController.g.ContraTreinador)
                //    GameController.g.HudM.Painel.AtivarNovaMens(BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.mensLuta)[3], 30, 7);
            }
        }
Exemplo n.º 14
0
 void Start()
 {
     playerActions    = new MyCharacterActions();
     playerController = GameObject.Find("Player").GetComponent <PlayerController>();
     healthBar.SetActive(false);
     Time.timeScale = 1f;
     audioBank      = GameObject.Find("_AudioBank").GetComponent <AudioBank>();
     textBank       = GameObject.Find("_TextBank").GetComponent <TextBank>();
     beginText      = textBank.beginText;
     quitText       = textBank.quitText;
     restartText    = textBank.restartText;
     textBank.healthText.enabled       = true;
     textBank.currentScoreText.enabled = true;
     StartCoroutine(KamikazeSpawnIncreases());
     StartCoroutine(StarshipSpawnIncreases());
     StartCoroutine(DisclaimerTimer());
     BeginGame();
     // StartCoroutine(AcquireInputType());
 }
Exemplo n.º 15
0
        // Use this for initialization
        void Start()
        {
            if (StaticInstanceExistence <IGameController> .SchelduleExistence(Start, this, () => {
                return(AbstractGameController.Instance);
            }))
            {
                if (AbstractGameController.Instance.MyKeys.VerificaAutoShift(ID))
                {
                    A.Play("bauAberto");
                }

                textoDoBotao = TextBank.RetornaListaDeTextoDoIdioma(TextKey.textoBaseDeAcao)[1];
                SempreEstaNoTrigger();
            }

            MessageAgregator <MsgSendExternaPanelCommand> .AddListener(OnReceiveCommands);

            MessageAgregator <MsgAnimationPointCheck> .AddListener(OnReceiveAnimationPointCheck);
        }
Exemplo n.º 16
0
        public void CopyLocalGroupMembership(NTLocalGroup sourceRemoteGroup, NTLocalGroup destinationLocalGroup, NTObject[] destinationLocalGroupMembers)
        {
            ActionObserver.NotifyAction("Copy", "Local Group Membership", sourceRemoteGroup.FullName, destinationLocalGroup.FullName);
            TextBank existingMembers = new TextBank(
                from obj in destinationLocalGroupMembers
                where obj is NTLocalObject
                select(object) obj
                );

            UserCopier userCopier = new UserCopier(
                false,
                false,
                DefaultUserPassword,
                false,
                ActionObserver
                );

            foreach (NTLocalUser remoteUser in sourceRemoteGroup.GetLocalMembers())
            {
                NTLocalUser localUser = null;

                // find a user by the same name of local machine
                if (!NTHost.CurrentMachine.TryGetLocalUser(remoteUser.Name, out localUser))
                {
                    // import the user if required
                    if (_importLocalUsers)
                    {
                        localUser = userCopier.CopyRemoteUserToLocalMachine(remoteUser);
                    }
                }

                if (localUser != null)
                {
                    if (!existingMembers.ContainsText(localUser.Name))
                    {
                        destinationLocalGroup.AddLocalMember(localUser);
                    }
                }
            }
        }
Exemplo n.º 17
0
        public override void FuncaoDoBotao()
        {
            SomDoIniciar();
            FluxoDeBotao();

            //commandR = GameController.g.CommandR;
            //ActionManager.Instance.ModificarAcao(this, AcaoDeOpcaoLida);

            if (AbstractGameController.Instance.MyKeys.VerificaAutoShift(ID))
            {
                fase = FasesDoBau.aberto;
                VerificaItem();
                externalCommand = new MsgSendExternaPanelCommand();
                MessageAgregator <MsgStartExternalInteraction> .Publish();
            }
            else
            {
                fase = FasesDoBau.nula;

                SupportSingleton.Instance.InvokeOnCountFrame(() =>
                {
                    fase = FasesDoBau.lendoOpcoes;
                }, 2);

                MessageAgregator <MsgRequestUpperLargeMessage> .Publish(new MsgRequestUpperLargeMessage()
                {
                    message = textos[0]
                });

                MessageAgregator <MsgStartExternalInteraction> .Publish();

                //GameController.g.HudM.Painel.AtivarNovaMens(textos[0], 25);

                YesOrNoMenu.instance.Menu.StartHud(QualOpcao,
                                                   TextBank.RetornaListaDeTextoDoIdioma(TextKey.simOuNao).ToArray()
                                                   );
            }
        }
Exemplo n.º 18
0
        void PreparaFinalSemCaptura()
        {
            ParticleOfSubstitution.ParticulaSaiDaLuva(CriatureAlvoDoItem.transform.position, GeneralParticles.captureEscape);
            CriatureAlvoDoItem.transform.localScale = new Vector3(1, 1, 1);
            //animator.SetBool("dano1", false);
            //animator.SetBool("dano2", false);
            MessageAgregator <MsgEndDamageState> .Publish(new MsgEndDamageState()
            {
                gameObject = CriatureAlvoDoItem
            });

            Debug.LogError("ota HUd");

            MessageAgregator <MsgRequestRapidInfo> .Publish(new MsgRequestRapidInfo()
            {
                message = string.Format(TextBank.RetornaFraseDoIdioma(TextKey.tentaCapturar),
                                        PetBase.NomeEmLinguas(FindByOwner.GetManagerEnemy(dono).MeuCriatureBase.NomeID))
            });

            //GameController.g.HudM.Painel.AtivarNovaMens(
            //   GameController.g.InimigoAtivo.MeuCriatureBase.NomeEmLinguas + BancoDeTextos.RetornaFraseDoIdioma(ChaveDeTexto.tentaCapturar),
            //    24, 5);
        }
Exemplo n.º 19
0
        private static void ReadRomPayload(object sender, DoWorkEventArgs args)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            MarioKart64ReaderResults results = new MarioKart64ReaderResults();

            //The rom should be loaded as the first file in the rom project
            byte[] rawData = RomProject.Instance.Files[0].GetAsBytes();

            //NOTE: THIS IS HOW YOU DO A CANCELLATION
            //if ((worker.CancellationPending == true))
            //{
            //    args.Cancel = true;
            //    return;
            //}

            /*ProgressService.SetMessage("Reading TKMK00 Textures");
             *
             * N64DataElement preExistingElement;
             *
             * //Now read the different data bits here, if they haven't been read in yet
             * for (int i = 0; i < MarioKartRomInfo.TKMK00TextureLocations.Length; i++)
             * {
             *  preExistingElement = RomProject.Instance.Files[0].GetElementAt(MarioKartRomInfo.TKMK00TextureLocations[i].RomOffset);
             *  if (preExistingElement != null && preExistingElement.GetType() == typeof(UnknownData))
             *  {
             *      ushort alpha = MarioKartRomInfo.TKMK00TextureLocations[i].AlphaColor;
             *      int offset = MarioKartRomInfo.TKMK00TextureLocations[i].RomOffset;
             *      int length = MarioKartRomInfo.TKMK00TextureLocations[i].Length;
             *
             *      TKMK00Block tkmk;
             *
             *      byte[] bytes = new byte[length];
             *      Array.Copy(rawData, offset, bytes, 0, length);
             *
             *      tkmk = new TKMK00Block(offset, bytes, alpha);
             *
             *      if (MarioKart64ElementHub.Instance.OriginalTKMK00Blocks.SingleOrDefault(t => t.FileOffset == tkmk.FileOffset) == null)
             *      {
             *          results.NewElements.Add(tkmk);
             *          results.OriginalTKMK00Blocks.Add(tkmk);
             *      }
             *  }
             *  else if (preExistingElement is TKMK00Block &&
             *      MarioKart64ElementHub.Instance.OriginalTKMK00Blocks.SingleOrDefault(t => t.FileOffset == preExistingElement.FileOffset) == null)
             *  {
             *      results.OriginalTKMK00Blocks.Add((TKMK00Block)preExistingElement);
             *  }
             * }
             */
            //Text bank!
            TextBankBlock      textBankBlock      = null;
            TextReferenceBlock textReferenceBlock = null;
            bool previouslyLoadedText             = false;

            //To do: add a function to automate this pre-existing check, like
            //        bool hasExistingElement<T:N64DataElement> (offset, out T)
            N64DataElement preExistingElement;

            if (RomProject.Instance.Files[0].HasElementAt(TextBankBlock.TEXT_BLOCK_START, out preExistingElement) &&
                preExistingElement.GetType() == typeof(UnknownData))
            {
                byte[] bytes = new byte[TextBankBlock.TEXT_BLOCK_LENGTH];
                Array.Copy(rawData, TextBankBlock.TEXT_BLOCK_START, bytes, 0, bytes.Length);

                textBankBlock = new TextBankBlock(TextBankBlock.TEXT_BLOCK_START, bytes);
                results.NewElements.Add(textBankBlock);
            }
            else if (preExistingElement.GetType() == typeof(TextBankBlock))
            {
                previouslyLoadedText = true;
                textBankBlock        = (TextBankBlock)preExistingElement;
            }

            if (RomProject.Instance.Files[0].HasElementAt(TextReferenceBlock.TEXT_REFERENCE_SECTION_1, out preExistingElement) &&
                preExistingElement.GetType() == typeof(UnknownData))
            {
                byte[] bytes = new byte[TextReferenceBlock.TEXT_REFERENCE_END - TextReferenceBlock.TEXT_REFERENCE_SECTION_1];
                Array.Copy(rawData, TextReferenceBlock.TEXT_REFERENCE_SECTION_1, bytes, 0, bytes.Length);

                textReferenceBlock = new TextReferenceBlock(TextReferenceBlock.TEXT_REFERENCE_SECTION_1, bytes);
                results.NewElements.Add(textReferenceBlock);
            }
            else if (preExistingElement.GetType() == typeof(TextReferenceBlock))
            {
                previouslyLoadedText = true;
                textReferenceBlock   = (TextReferenceBlock)preExistingElement;
            }

            if (textBankBlock != null && textReferenceBlock != null)
            {
                TextBank textBank = new TextBank(textBankBlock, textReferenceBlock, !previouslyLoadedText);
                results.TextBank = textBank;
            }

            TextureReader.ReadRom(worker, rawData, results);

            KartReader.ReadRom(worker, rawData, results);

            args.Result = results;
        }
Exemplo n.º 20
0
 public static string Get(PetTypeName p)
 {
     return(TextBank.RetornaListaDeTextoDoIdioma(TextKey.nomeTipos)[(int)p]);
 }
Exemplo n.º 21
0
        public void LoadFromXML()
        {
            //TextBank/TextReferences - Only use the offset currently being used
            //KartReference - Only use the names of the karts selected
            //MIOBlocks/TKMK00Bocks - Offsets for each one
            //Karts - Full listing of information

            //Elements should already have been cleared
            //ClearElements();

            NewElementOffset = int.Parse(_loadedXml.Attribute(NEW_ELEMENT_OFFSET).Value);

            //Before we start, load up all saved karts and tracks
            ProgressService.SetMessage("Loading Kart Resources");
            foreach (RomItem item in RomProject.Instance.Items)
            {
                //If the same name kart hasn't been loaded yet
                if (item is KartInfo && Karts.FirstOrDefault(k => k.KartName == ((KartInfo)item).KartName) == null)
                {
                    this.Karts.Add((KartInfo)item);
                }
                //else if is trackinfo
            }

            //Also the text bank is all elements, so we don't need an xml in here for it
            ProgressService.SetMessage("Loading Text Blocks");
            N64DataElement textRefEl, textBlockEl;

            if (RomProject.Instance.Files[0].HasElementExactlyAt(TextReferenceBlock.TEXT_REFERENCE_SECTION_1, out textRefEl) &&
                RomProject.Instance.Files[0].HasElementExactlyAt(TextBankBlock.TEXT_BLOCK_START, out textBlockEl))
            {
                TextReferenceBlock refBlock  = (TextReferenceBlock)textRefEl;
                TextBankBlock      bankBlock = (TextBankBlock)textBlockEl;

                TextBank = new TextBank(bankBlock, refBlock, true);
            }

            int            offset;
            int            count     = 0;
            int            fullCount = _loadedXml.Elements().Count();
            N64DataElement n64Element;

            foreach (XElement element in _loadedXml.Elements())
            {
                ProgressService.SetMessage(string.Format("Storing Special Elements {0:0.0}%", (double)count / fullCount));
                switch (element.Name.ToString())
                {
                case TURN_PALETTE_BLOCK:
                    foreach (XElement el in element.Elements())
                    {
                        offset = int.Parse(el.Value);
                        if (RomProject.Instance.Files[0].HasElementExactlyAt(offset, out n64Element))
                        {
                            int            paletteOffset = offset;
                            List <Palette> palettes      = new List <Palette>();
                            palettes.Add((Palette)n64Element);
                            paletteOffset += 0x40 * 2;

                            for (int i = 1; i < 84; i++)     //Make not hardcoded later
                            {
                                if (!RomProject.Instance.Files[0].HasElementAt(paletteOffset, out n64Element))
                                {
                                    throw new Exception();
                                }

                                palettes.Add((Palette)n64Element);
                                paletteOffset += 0x40 * 2;
                            }

                            KartPaletteBlock block = new KartPaletteBlock(offset, palettes);
                            TurnKartPaletteBlocks.Add(block);
                        }
                    }
                    break;

                case SPIN_PALETTE_BLOCK:
                    foreach (XElement el in element.Elements())
                    {
                        offset = int.Parse(el.Value);
                        if (RomProject.Instance.Files[0].HasElementExactlyAt(offset, out n64Element))
                        {
                            int            paletteOffset = offset;
                            List <Palette> palettes      = new List <Palette>();
                            palettes.Add((Palette)n64Element);
                            paletteOffset += 0x40 * 2;

                            for (int i = 1; i < 80; i++)     //Make not hardcoded later
                            {
                                if (!RomProject.Instance.Files[0].HasElementAt(paletteOffset, out n64Element))
                                {
                                    throw new Exception();
                                }

                                palettes.Add((Palette)n64Element);
                                paletteOffset += 0x40 * 2;
                            }

                            KartPaletteBlock block = new KartPaletteBlock(offset, palettes);
                            SpinKartPaletteBlocks.Add(block);
                        }
                    }
                    break;

                case KARTS_GRAPHICS_REFERENCE_BLOCK:
                    offset = int.Parse(element.Value);
                    if (RomProject.Instance.Files[0].HasElementExactlyAt(offset, out n64Element))
                    {
                        if (n64Element is KartGraphicsReferenceBlock)
                        {
                            KartGraphicsBlock = (KartGraphicsReferenceBlock)n64Element;
                            //KartReader.LoadKartGraphicDmaReferences(KartGraphicsBlock);
                        }
                    }
                    break;

                case KARTS_PORTRAITS_REFERENCE_TABLE:
                    offset = int.Parse(element.Value);
                    if (RomProject.Instance.Files[0].HasElementExactlyAt(offset, out n64Element))
                    {
                        if (n64Element is KartPortraitTable)
                        {
                            KartPortraitsTable = (KartPortraitTable)n64Element;
                            //KartReader.LoadKartPortraitDmaReferences(KartPortraitsTable);
                        }
                    }
                    break;

                case SELECTED_KARTS:
                    int kartIndex = 0;
                    foreach (XElement selKart in element.Elements())
                    {
                        KartInfo selectedKart = Karts.SingleOrDefault(k => k.KartName == selKart.Name);
                        if (selectedKart != null)
                        {
                            SelectedKarts[kartIndex] = selectedKart;
                        }
                        kartIndex++;
                    }
                    break;

                case TextureHub.TEXTURE_HUB:
                    TextureHub.LoadReferencesFromXML(element);
                    break;
                }
                count++;
            }
        }
Exemplo n.º 22
0
 public void ChangeTalkKey(TextKey chave)
 {
     conversa = TextBank.RetornaListaDeTextoDoIdioma(chave).ToArray();
 }
Exemplo n.º 23
0
 public void Start()
 {
     conversa = TextBank.RetornaListaDeTextoDoIdioma(chaveDaConversa).ToArray();
 }