Esempio n. 1
0
    public void OnClickStateUpdateBtn(GameObject obj)
    {
        packet             = new C2G.CreatureEvalStateUpdate();
        packet.creature_id = creature_info.ID;
        packet.board_idx   = info.board_idx;
        if (obj.name.Contains("good"))
        {
            if (m_GoodBtn.ActiveSprite == true)
            {
                packet.eval_state = pe_EvalState.None;
            }
            else
            {
                packet.eval_state = pe_EvalState.Good;
            }
        }
        else
        {
            if (m_BadBtn.ActiveSprite == true)
            {
                packet.eval_state = pe_EvalState.None;
            }
            else
            {
                packet.eval_state = pe_EvalState.Bad;
            }
        }

        if (packet.eval_state == info.my_eval_state)
        {
            return;
        }

        string confirm_msg;

        if (info.my_eval_state != pe_EvalState.None)
        {
            if (packet.eval_state != pe_EvalState.None)
            {
                confirm_msg = Localization.Format("EvalStateChange", Localization.Get(string.Format("{0}{1}", "Eval", info.my_eval_state)), Localization.Get(string.Format("{0}{1}", "Eval", packet.eval_state)));
            }
            else
            {
                confirm_msg = Localization.Format("EvalStateCancel", Localization.Get(string.Format("{0}{1}", "Eval", info.my_eval_state)));
            }

            Popup.Instance.ShowConfirm(new PopupConfirm.Callback(ConfirmStateUpdate), confirm_msg);
        }
        else
        {
            Network.GameServer.JsonAsync <C2G.CreatureEvalStateUpdate, C2G.CreatureEvalStateUpdateAck>(packet, EvalStateUpdateHandler);
        }
    }
Esempio n. 2
0
 void EvalStateUpdateHandler(C2G.CreatureEvalStateUpdate send, C2G.CreatureEvalStateUpdateAck recv)
 {
     change_callback(info.board_idx, send.eval_state);
 }