void EncaixeDeEmblemaSelecionado(int qual) { if (estaNoCheckPoint) { int opcaoGuardada = qual; if (Emblema.VerificarOcupacaoDoEncaixe(dj.MeusEmblemas, opcaoGuardada).NomeId != NomesEmblemas.nulo) { Emblema E = Emblema.ListaDeEncaixados(dj.MeusEmblemas)[opcaoGuardada]; E.OnUnequip(); E.EstaEquipado = false; ReiniciarVisaoDaHud(); emblemasE.SelecionarOpcaoEspecifica(opcaoGuardada); ColocaInfoTexts(dj.MeusEmblemas[0]); numEncaixes.text = Emblema.NumeroDeEspacosOcupados(dj.MeusEmblemas) + " / " + dj.EspacosDeEmblemas; } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); GlobalController.g.UmaMensagem.ConstroiPainelUmaMensagem(OnCheckPanel, BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.frasesDeEmblema)[3]); } } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); EventAgregator.Publish(new SendMethodEvent(EventKey.requestInfoEmblemPanel, OnCheckPanel)); //painelDeInfoEmblema.ConstroiPainelUmaMensagem(OnCheckPanel); } }
public void IniciarHud(bool estaNoCheckPoint) { this.estaNoCheckPoint = estaNoCheckPoint; numEncaixes.transform.parent.gameObject.SetActive(true); estado = EstadoDaqui.sobreDisponiveis; dj = GameController.g.Manager.Dados; emblemasE.IniciarHud(EncaixeDeEmblemaSelecionado); emblemasD.IniciarHud(EmblemaDisponivelSelecionado); emblemasE.RetirarDestaques(); if (dj.MeusEmblemas.Count > 0) { ColocaInfoTexts(dj.MeusEmblemas[0]); } else { InfoDeNaoTemEmblema(); } numEncaixes.text = Emblema.NumeroDeEspacosOcupados(dj.MeusEmblemas) + " / " + dj.EspacosDeEmblemas; EventAgregator.AddListener(EventKey.UiDeEmblemasChange, OnChangeOption); }
void EmblemaDisponivelSelecionado(int qual) { if (estaNoCheckPoint) { Emblema E = dj.MeusEmblemas[qual]; if (!E.EstaEquipado) { if (E.EspacosNecessarios <= dj.EspacosDeEmblemas - Emblema.NumeroDeEspacosOcupados(dj.MeusEmblemas)) { E.EstaEquipado = true; E.OnEquip(); EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); GlobalController.g.UmaMensagem.ConstroiPainelUmaMensagem(OnCheckPanel, string.Format( BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.frasesDeEmblema)[0], E.NomeEmLinguas ) ); int opcaoGuardada = qual; ReiniciarVisaoDaHud(); emblemasD.SelecionarOpcaoEspecifica(opcaoGuardada); ColocaInfoTexts(dj.MeusEmblemas[0]); numEncaixes.text = Emblema.NumeroDeEspacosOcupados(dj.MeusEmblemas) + " / " + dj.EspacosDeEmblemas; } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); GlobalController.g.UmaMensagem.ConstroiPainelUmaMensagem(OnCheckPanel, string.Format( BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.frasesDeEmblema)[1], E.EspacosNecessarios, E.NomeEmLinguas, (dj.EspacosDeEmblemas - Emblema.NumeroDeEspacosOcupados(dj.MeusEmblemas)).ToString())); } } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); GlobalController.g.UmaMensagem.ConstroiPainelUmaMensagem(OnCheckPanel, BancoDeTextos.RetornaListaDeTextoDoIdioma(ChaveDeTexto.frasesDeEmblema)[2]); } } else { EventAgregator.Publish(new StandardSendGameEvent(EventKey.triedToChangeEmblemNoSuccessfull)); EventAgregator.Publish(new SendMethodEvent(EventKey.requestInfoEmblemPanel, OnCheckPanel)); //painelDeInfoEmblema.ConstroiPainelUmaMensagem(OnCheckPanel); } }