Example #1
0
        private void send_signal(CUIEvent uiEvent, GameObject img, int signal_id = 0)
        {
            if ((uiEvent != null) && (img != null))
            {
                byte type    = (byte)uiEvent.m_eventParams.tag2;
                uint tagUInt = uiEvent.m_eventParams.tagUInt;
                if (signal_id == 0)
                {
                    signal_id = uiEvent.m_eventParams.tag3;
                }
                this.Switch(EMapType.Mini);
                SignalPanel panel = (Singleton <CBattleSystem> .GetInstance().FightForm == null) ? null : Singleton <CBattleSystem> .instance.FightForm.GetSignalPanel();

                if (panel != null)
                {
                    switch (type)
                    {
                    case 3:
                    case 1:
                    case 2:
                    case 6:
                    case 4:
                    case 5:
                        panel.SendCommand_SignalMiniMap_Target((byte)signal_id, type, tagUInt);
                        return;
                    }
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        ActorRoot root = ((hostPlayer == null) || (hostPlayer.Captain == 0)) ? null : hostPlayer.Captain.handle;
                        if (root != null)
                        {
                            Vector2 vector = CUIUtility.WorldToScreenPoint(uiEvent.m_srcFormScript.GetCamera(), img.transform.position);
                            float   num4   = uiEvent.m_pointerEventData.position.x - vector.x;
                            float   num5   = uiEvent.m_pointerEventData.position.y - vector.y;
                            num4 = uiEvent.m_srcFormScript.ChangeScreenValueToForm(num4);
                            num5 = uiEvent.m_srcFormScript.ChangeScreenValueToForm(num5);
                            VInt3 zero = VInt3.zero;
                            zero.x = (int)(num4 * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.x);
                            zero.y = (root == null) ? ((int)0.15f) : ((int)((Vector3)root.location).y);
                            zero.z = (int)(num5 * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.y);
                            panel.SendCommand_SignalMiniMap_Position((byte)signal_id, zero);
                        }
                    }
                }
            }
        }