Пример #1
0
 private void Update_AimBot()
 {
     this.heliosBoxPos = Vector2.zero;
     if ((!ChatUI.IsVisible() && GUIAimbot.SetAimKey) && (Input.GetKey(CVars.Aimbot.AimKey) || CVars.Aimbot.AutoAim))
     {
         Character localCharacter     = ESP_UpdateOBJs.LocalCharacter;
         Character closestToCrosshair = this.GetClosestToCrosshair();
         if (closestToCrosshair != null)
         {
             if (!CVars.Aimbot.SilentAim)
             {
                 this.heliosBoxPos = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
                 this.AutoAimAtPlayer(localCharacter, closestToCrosshair);
             }
             else if (this.SilentAim(localCharacter, closestToCrosshair))
             {
                 Vector3 position = Local.GetHeadBone(closestToCrosshair).transform.position;
                 Vector3 vector2  = Camera.main.WorldToScreenPoint(position);
                 if (vector2.z > 0f)
                 {
                     vector2.y         = Screen.height - (vector2.y + 1f);
                     this.heliosBoxPos = new Vector2(vector2.x, vector2.y);
                 }
             }
         }
     }
 }
 void Awake()
 {
     //clientName = MyGameManager.user.Name;
     chatUI          = FindObjectOfType <ChatUI>();
     lobbyUI         = FindObjectOfType <LobbyUI>();
     lobbyController = FindObjectOfType <LobbyController>();
 }
Пример #3
0
 private void ShowInventory(bool show)
 {
     InventoryUI.ShowInventory(show);
     ChatUI.HideChat(show);
     UnityEngine.PostProcessing.PostProcessingProfile profile = PlayerCamera.instance.GetComponent <UnityEngine.PostProcessing.PostProcessingBehaviour>().profile;
     profile.depthOfField.enabled = show;
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     sInstanse = this;
     CreateChatBox();
     SetSendMsgChanel(1);//默认为附近频道
     MsgManager.Instance.AddListener("SC_ChatInfo", new HandleMsg(this.SC_ChatInfo));
 }
Пример #5
0
        private void Update_AimBot()
        {
            this.heliosBoxPos = Vector2.zero;
            if (ChatUI.IsVisible() || !GUIAimbot.SetAimKey)
            {
                return;
            }
            if (!Input.GetKey(CVars.Aimbot.AimKey) && !CVars.Aimbot.AutoAim)
            {
                return;
            }
            Character localCharacter     = HackLocal.LocalCharacter;
            Character closestToCrosshair = this.GetClosestToCrosshair();

            if (closestToCrosshair == null)
            {
                return;
            }
            if (!CVars.Aimbot.SilentAim)
            {
                this.heliosBoxPos = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
                this.AutoAimAtPlayer(localCharacter, closestToCrosshair);
                return;
            }
            if (this.SilentAim(localCharacter, closestToCrosshair))
            {
                Vector3 position = HackLocal.GetHeadBone(closestToCrosshair).transform.position;
                Vector3 vector   = Camera.main.WorldToScreenPoint(position);
                if (vector.z > 0f)
                {
                    vector.y          = (float)Screen.height - (vector.y + 1f);
                    this.heliosBoxPos = new Vector2(vector.x, vector.y);
                }
            }
        }
Пример #6
0
    void RpcUpdateUsername(string user)
    {
        //@TODO
        //myObj.name = "A player named "+username;

        ChatUI.SystemMessage(username + " has joined the game.");
    }
 private static void smethod_8([Optional, DefaultParameterValue(null)] string string_5)
 {
     if ((string_5 != null) && (string_5.Length > 0))
     {
         ChatUI.AddLine(Class3.smethod_10(0x14ea), Class3.smethod_10(0x1508) + string_5 + Class3.smethod_10(0x1528));
     }
     NetCull.isMessageQueueRunning = true;
     NetCull.Disconnect();
 }
Пример #8
0
    public void RpcReceiveChatMessage(ChatMessage message)
    {
        ChatUI chatUI = GameObject.FindObjectOfType <ChatUI>();

        if (chatUI != null)
        {
            chatUI.ReceiveNewMessage(message);
        }
    }
Пример #9
0
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.LogError("More than one instance of ChatUI found!");
         return;
     }
     Instance = this;
 }
Пример #10
0
    public void Init()
    {
        roomListUI    = RoomListUI.Instance();
        chatUI        = ChatUI.Instance();
        uiMgr         = UIMgr.Instance();
        gameHallMesUI = GameHallMesUI.Instance();

        roomListUI.Init();
        chatUI.Init();
        gameHallMesUI.Init();
    }
Пример #11
0
 void Awake()
 {
     if (null == Instance)
     {
         Instance = this;
     }
     else
     {
         Debug.LogError("More Than One ChatUI Exist");
     }
     InitUI();
 }
Пример #12
0
 public static void add(ref ConsoleSystem.Arg arg)
 {
     if (enabled)
     {
         string name = arg.GetString(0, string.Empty);
         string text = arg.GetString(1, string.Empty);
         if ((name != string.Empty) && (text != string.Empty))
         {
             ChatUI.AddLine(name, text);
         }
     }
 }
Пример #13
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
         uiObj.SetActive(true);
     }
     else
     {
         Destroy(gameObject);             //Kill the whole tree
     }
 }
Пример #14
0
 public void Update()
 {
     if (Input.GetKeyDown(KeyCode.M) && !ConsoleWindow.IsVisible() && !ChatUI.IsVisible() && !MainMenu.IsVisible())
     {
         if (ShowMap)
         {
             ShowMap = false;
         }
         else
         {
             ShowMap = true;
         }
     }
 }
Пример #15
0
    public static void @add(ref ConsoleSystem.Arg arg)
    {
        if (!chat.enabled)
        {
            return;
        }
        string str  = arg.GetString(0, string.Empty);
        string str1 = arg.GetString(1, string.Empty);

        if (str == string.Empty || str1 == string.Empty)
        {
            return;
        }
        ChatUI.AddLine(str, str1);
    }
Пример #16
0
    public void Update()
    {
        if (!ChatUI.IsReady() || !InventoryUI.IsReady())
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.I) && CanShowInventory())
        {
            ShowInventory(!InventoryUI.IsInventoryVisible());
        }

        if (Input.GetKeyDown(KeyCode.G) && CanShowGuild())
        {
            ShowGuild(!GuildUI.IsGuildVisible());
        }
    }
Пример #17
0
    public void showHeadSelect(UnityEntity unit)
    {
        var headselect = UIPackage.CreateObject("GameUI", "HeadSelect").asCom;

        //GRoot.inst.AddChild(headselect);
        GRoot.inst.ShowPopup(headselect);
        headselect.xy = maininfo.xy;
        headselect.x += 50;
        headselect.y += 50;


        //注销组队功能
        //headselect.GetChild("team").asButton.onClick.Add(() =>
        //{

        //    if (GameScene.Singleton.m_MyMainUnit == null || unit == null)
        //    {
        //        GRoot.inst.HidePopup(headselect);
        //        return;
        //    }

        //    Protomsg.CS_OrganizeTeam msg1 = new Protomsg.CS_OrganizeTeam();
        //    msg1.Player1 = GameScene.Singleton.m_MyMainUnit.ControlID;
        //    msg1.Player2 = unit.ControlID;
        //    MyKcp.Instance.SendMsg(GameScene.Singleton.m_ServerName, "CS_OrganizeTeam", msg1);
        //    GRoot.inst.HidePopup(headselect);
        //});

        headselect.GetChild("info").asButton.onClick.Add(() =>
        {
            GRoot.inst.HidePopup(headselect);
            MyInfo myinfo = new MyInfo(unit);
        });
        headselect.GetChild("siliao").asButton.onClick.Add(() =>
        {
            ChatUI.SOpenChatBox("zonghe", unit.Name, unit.ControlID);
            GRoot.inst.HidePopup(headselect);
        });
    }
Пример #18
0
    public void SetChatMode(bool isPublicMode)
    {
        chatManager.SetChatMode(isPublicMode);

        if (isPublicMode)
        {
            privateChat.SavePrivateMessages(privateChatUI.GetText());

            activeChatUI = publicChatUI;
            publicChatUI.SetMessageReceiver("Общий:");
        }
        else
        {
            privateChatTweener.Show();

            var userData = privateChat.MessageReceiver.Value;

            activeChatUI = privateChatUI;
            privateChatUI.Append(privateChat.GetMessages());
            privateChatUI.SetMessageReceiver($"To {userData.id} {userData.nick}: ");
        }

        activeChatUI.Activate();
    }
Пример #19
0
 void RpcReceiveChat(string msg)
 {
     ChatUI.ReceiveChat(msg);
 }
Пример #20
0
    public void InitGame()
    {
        GameObject.Find("LoadingScreen").transform.GetChild(0).gameObject.SetActive(true);

        if (PhotonNetwork.IsMasterClient)
        {
            isWereWolf = new bool[playersNameList.Count];
            int randomIndex = UnityEngine.Random.Range(0, playersNameList.Count);
            isWereWolf[randomIndex] = true;

            photonView.RPC("RPC_ChooseWereWolf", RpcTarget.AllBufferedViaServer, isWereWolf);


            PhotonNetwork.CurrentRoom.IsOpen = false;
        }

        if (fov == null)
        {
            fov = FindObjectOfType <FieldOfView>();
        }
        if (barrelManager == null)
        {
            barrelManager = FindObjectOfType <BarrelManager>();
        }
        if (camera == null)
        {
            camera = FindObjectOfType <CameraController>();
        }
        if (votingArea == null)
        {
            votingArea = FindObjectOfType <VotingArea>();
        }
        if (chat == null)
        {
            chat = FindObjectOfType <ChatUI>();
        }
        if (shop == null)
        {
            shop = FindObjectOfType <Shop>();
        }
        if (gameTimeUI == null)
        {
            gameTimeUI = FindObjectOfType <GameTimeUI>();
        }
        if (playerItemsUI == null)
        {
            playerItemsUI = FindObjectOfType <playerItemsUI>();
        }

        timer     = dayTime;
        gamePhase = GamePhases.Day;



        barrelManager.canStartGeneration = true;
        barrelManager.GenerateBarrels();


        shop.canGenerateNewRecipe = true;
        if (shop.canGenerateNewRecipe)
        {
            if (PhotonNetwork.IsMasterClient)
            {
                shop.canGetReward = true;
                shop.GenerateNewRecipe();
            }
        }



        if (PhotonNetwork.IsMasterClient)
        {
            photonView.RPC("RPC_test", RpcTarget.AllBufferedViaServer);
        }
        StartCoroutine(delayedList());
    }
Пример #21
0
 public static HumanController.InputSample Poll(bool noLamp, bool noLaser)
 {
     HumanController.InputSample inputSample = new HumanController.InputSample();
     if (ConsoleWindow.IsVisible())
     {
         return(new HumanController.InputSample());
     }
     if (MainMenu.IsVisible())
     {
         return(new HumanController.InputSample());
     }
     if (ChatUI.IsVisible())
     {
         return(new HumanController.InputSample());
     }
     if (LockEntry.IsVisible())
     {
         return(new HumanController.InputSample());
     }
     if (LockCursorManager.IsLocked(true))
     {
         float single = Time.deltaTime;
         inputSample.info__crouchBlocked = false;
         inputSample.walk = 0f;
         if (GameInput.GetButton("Up").IsDown())
         {
             inputSample.walk = inputSample.walk + 1f;
         }
         if (GameInput.GetButton("Down").IsDown())
         {
             inputSample.walk = inputSample.walk - 1f;
         }
         inputSample.strafe = 0f;
         if (GameInput.GetButton("Right").IsDown())
         {
             inputSample.strafe = inputSample.strafe + 1f;
         }
         if (GameInput.GetButton("Left").IsDown())
         {
             inputSample.strafe = inputSample.strafe - 1f;
         }
         inputSample.yaw   = GameInput.mouseDeltaX + HumanController.InputSample.yawSensitivityJoy * Input.GetAxis("Yaw") * single;
         inputSample.pitch = GameInput.mouseDeltaY + HumanController.InputSample.pitchSensitivityJoy * Input.GetAxis("Pitch") * single;
         if (input.flipy)
         {
             inputSample.pitch = inputSample.pitch * -1f;
         }
         inputSample.jump      = GameInput.GetButton("Jump").IsDown();
         inputSample.crouch    = GameInput.GetButton("Duck").IsDown();
         inputSample.sprint    = GameInput.GetButton("Sprint").IsDown();
         inputSample.aim       = false;
         inputSample.attack    = GameInput.GetButton("Fire").IsDown();
         inputSample.attack2   = GameInput.GetButton("AltFire").IsDown();
         inputSample.reload    = GameInput.GetButton("Reload").IsDown();
         inputSample.inventory = GameInput.GetButton("Inventory").IsPressed();
         inputSample.lamp      = (!noLamp ? HumanController.InputSample.saved.GetLamp(GameInput.GetButton("Flashlight").IsPressed()) : HumanController.InputSample.saved.lamp);
         inputSample.laser     = (!noLaser ? HumanController.InputSample.saved.GetLaser(GameInput.GetButton("Laser").IsPressed()) : HumanController.InputSample.saved.laser);
     }
     else
     {
         inputSample = new HumanController.InputSample();
         if (!UIUnityEvents.shouldBlockButtonInput)
         {
             inputSample.inventory = GameInput.GetButton("Inventory").IsPressed();
         }
         inputSample.lamp  = HumanController.InputSample.saved.lamp;
         inputSample.laser = HumanController.InputSample.saved.laser;
     }
     if (GameInput.GetButton("Chat").IsPressed())
     {
         ChatUI.Open();
     }
     return(inputSample);
 }
Пример #22
0
 public void Awake()
 {
     instance = this;
 }
Пример #23
0
    public bool SC_GetFriendsList(Protomsg.MsgBase d1)
    {
        Debug.Log("SC_GetFriendsList:");
        IMessage IMperson = new Protomsg.SC_GetFriendsList();

        Protomsg.SC_GetFriendsList p2 = (Protomsg.SC_GetFriendsList)IMperson.Descriptor.Parser.ParseFrom(d1.Datas);

        var list = FriendsCom.GetChild("list").asList;

        list.RemoveChildren();

        foreach (var p1 in p2.FriendsRequest)
        {
            var teamrequest = UIPackage.CreateObject("GameUI", "FriendRequest").asCom;
            list.AddChild(teamrequest);
            AudioManager.Am.Play2DSound(AudioManager.Sound_OpenLittleUI);
            //SrcUnitTypeID
            var clientitem = ExcelManager.Instance.GetUnitInfoManager().GetUnitInfoByID(p1.Typeid);
            if (clientitem != null)
            {
                teamrequest.GetChild("headicon").asLoader.url = clientitem.IconPath;
            }
            teamrequest.GetChild("name").asTextField.text  = p1.Name;
            teamrequest.GetChild("level").asTextField.text = p1.Level + "";

            teamrequest.GetChild("no_btn").asButton.onClick.Add(() =>
            {
                //回复拒绝好友请求
                Protomsg.CS_AddFriendResponse msg = new Protomsg.CS_AddFriendResponse();
                msg.Result     = 2;//1同意  2拒绝
                msg.FriendInfo = p1;
                MyKcp.Instance.SendMsg(GameScene.Singleton.m_ServerName, "CS_AddFriendResponse", msg);

                list.RemoveChild(teamrequest);
            });

            teamrequest.GetChild("yes_btn").asButton.onClick.Add(() =>
            {
                //回复同意组队请求
                Protomsg.CS_AddFriendResponse msg = new Protomsg.CS_AddFriendResponse();
                msg.Result     = 1;//1同意  2拒绝
                msg.FriendInfo = p1;
                MyKcp.Instance.SendMsg(GameScene.Singleton.m_ServerName, "CS_AddFriendResponse", msg);
                list.RemoveChild(teamrequest);
            });
        }

        //处理排序
        Protomsg.FriendInfoMsg[] allplayer = new Protomsg.FriendInfoMsg[p2.Friends.Count];
        int index = 0;

        foreach (var item in p2.Friends)
        {
            allplayer[index++] = item;
        }
        //排序
        System.Array.Sort(allplayer, (s1, s2) => {
            if (s1.State > s2.State)
            {
                return(1);
            }
            else if (s1.State == s2.State)
            {
                return(0);
            }
            return(-1);
        });

        foreach (var p1 in allplayer)
        {
            var teamrequest = UIPackage.CreateObject("GameUI", "FriendOne").asCom;
            list.AddChild(teamrequest);
            AudioManager.Am.Play2DSound(AudioManager.Sound_OpenLittleUI);
            //SrcUnitTypeID
            var clientitem = ExcelManager.Instance.GetUnitInfoManager().GetUnitInfoByID(p1.Typeid);
            if (clientitem != null)
            {
                teamrequest.GetChild("headicon").asLoader.url = clientitem.IconPath;
            }
            teamrequest.GetChild("name").asTextField.text  = p1.Name;
            teamrequest.GetChild("level").asTextField.text = p1.Level + "";
            if (p1.State == 1)
            {
                //在线
                teamrequest.GetChild("discript").asTextField.text   = "在线";
                teamrequest.GetChild("discript").asTextField.color  = new Color(1, 1, 1);
                teamrequest.GetChild("name").asTextField.color      = new Color(1, 1, 1);
                teamrequest.GetChild("level").asTextField.color     = new Color(1, 1, 1);
                teamrequest.GetChild("levelword").asTextField.color = new Color(1, 1, 1);

                teamrequest.onClick.Add(() => {
                    //onlinefriendclick
                    var headselect = UIPackage.CreateObject("GameUI", "onlinefriendclick").asCom;
                    GRoot.inst.ShowPopup(headselect);
                    headselect.GetChild("siliao").asButton.onClick.Add(() =>
                    {
                        ChatUI.SOpenChatBox("zonghe", p1.Name, p1.Uid);
                        GRoot.inst.HidePopup(headselect);
                    });
                    headselect.GetChild("info").asButton.onClick.Add(() =>
                    {
                        new HeroSimpleInfo(p1.Characterid);
                    });
                    //注销组队功能
                    //headselect.GetChild("zudui").asButton.onClick.Add(() =>
                    //{
                    //    Protomsg.CS_OrganizeTeam msg1 = new Protomsg.CS_OrganizeTeam();
                    //    msg1.Player1 = GameScene.Singleton.m_MyMainUnit.ControlID;
                    //    msg1.Player2 = p1.Uid;
                    //    MyKcp.Instance.SendMsg(GameScene.Singleton.m_ServerName, "CS_OrganizeTeam", msg1);
                    //    GRoot.inst.HidePopup(headselect);
                    //});
                });
            }
            else
            {
                //离线
                teamrequest.GetChild("discript").asTextField.text   = "离线";
                teamrequest.GetChild("discript").asTextField.color  = new Color(0.2f, 0.2f, 0.2f);
                teamrequest.GetChild("name").asTextField.color      = new Color(0.2f, 0.2f, 0.2f);
                teamrequest.GetChild("level").asTextField.color     = new Color(0.2f, 0.2f, 0.2f);
                teamrequest.GetChild("levelword").asTextField.color = new Color(0.2f, 0.2f, 0.2f);

                teamrequest.onClick.Add(() => {
                    new HeroSimpleInfo(p1.Characterid);
                });
            }
        }

        return(true);
    }
Пример #24
0
 private void Start()
 {
     ChatUI.singleton = this;
     this.textInput.Hide();
 }
Пример #25
0
    //初始化
    public void Init()
    {
        if (unitinfo == null)
        {
            return;
        }
        //关闭按钮
        unitinfo.GetChild("close").asButton.onClick.Add(() => { Destroy(); });

        var item = ExcelManager.Instance.GetSceneManager().GetSceneByID(GameScene.Singleton.m_SceneID);

        if (item != null)
        {
            var scenename   = item.Name;
            var postext     = "(" + (int)unit.X + "," + (int)unit.Y + ")";
            var noticewords = ExcelManager.Instance.GetNoticeWordsManager().GetNoticeWordsByID(38);
            Dictionary <string, string> p = new Dictionary <string, string>();
            p["p1"] = item.Name;
            p["p2"] = ("" + (int)unit.X);
            p["p3"] = ("" + (int)unit.Y);
            p["p4"] = (unit.Name);
            if (noticewords != null)
            {
                //定位信息
                unitinfo.GetChild("localpos").asButton.onClick.Add(() => {
                    ChatUI.SOpenChatBoxWithMsg("quanfu", "", 0, Tool.ParseTemplate(noticewords.Words, p));
                });
            }
        }



        InitItemDrag();
        InitDropItem();
        InitSkillInfo();


        //模型
        var modeeffect = (GameObject)(GameObject.Instantiate(Resources.Load(unit.ModeType)));

        modeeffect.transform.localPosition = new Vector3(0, 0, 100);
        var box = modeeffect.GetComponent <BoxCollider>();

        modeeffect.transform.localScale = new Vector3(100, 100, 100);
        if (box != null)
        {
            var scale = box.size.y / 1.2f;
            modeeffect.transform.localScale = new Vector3(100 / scale, 100 / scale, 100 / scale);
        }


        Vector3 rotation = modeeffect.transform.localEulerAngles;

        rotation.x = 10; // 在这里修改坐标轴的值
        rotation.y = 180;
        rotation.z = 0;
        //将旋转的角度赋值给预制出来需要打出去的麻将
        modeeffect.transform.localEulerAngles = rotation;
        GGraph    holder  = unitinfo.GetChild("heromode").asGraph;
        GoWrapper wrapper = new GoWrapper(modeeffect);

        holder.SetNativeObject(wrapper);
        holder.z = 10;
    }
Пример #26
0
        // ADMIN ONLY STUFF BELOW

        private void OnGUI()
        {
            if (AdminPlus.IsAllowed)
            {
                if (IsAlive)
                {
                    if (GUI.Button(new Rect(5, 5, 80, 20), "Admin"))
                    {
                        AdminPlus.Enabled = !AdminPlus.Enabled;
                        if (!ChatUI.IsVisible() && !ConsoleWindow.IsVisible() && !MainMenu.IsVisible())
                        {
                            Screen.lockCursor = !AdminPlus.Enabled;
                        }
                    }

                    if (AdminPlus.Enabled)
                    {
                        GUILayout.Window(0, menuwindow, Menu, "AdminPlus V" + AdminPlus.Instance.Version);
                        if (PlayerSelector)
                        {
                            GUILayout.Window(1, editorwindow, PlayerEditorWindow, "Select a player from the list to lookup");
                        }

                        if (ESPoptions)
                        {
                            GUILayout.Window(2, espwindow, ESP, "ESP Options");
                        }

                        if (NoClip)
                        {
                            GUILayout.Window(3, noclipwindow, NoClipMenu, "NoClip Options");
                        }

                        if (SelectedPlayer)
                        {
                            GUILayout.Window(34, playerwindow, PlayerMenu, "Looking up: " + LookupName);
                        }

                        if (GiveItemMenu)
                        {
                            GUILayout.Window(5, givewindow, GiveScreen, "Give " + LookupName + " an item, Maybe some C4?");
                        }
                    }

                    if (ESPPlayers || ESPAnimals)
                    {
                        foreach (UnityEngine.Object GameObject in FindObjectsOfType(typeof(Character)))
                        {
                            if (GameObject != null)
                            {
                                var Character = GameObject as Character;

                                if (ESPPlayers)
                                {
                                    PlayerClient playerClient = Character?.playerClient ?? null;
                                    if (playerClient != null && playerClient.gameObject != this)
                                    {
                                        DrawLabel(Character.origin, playerClient.userName, Color.blue);
                                    }
                                }

                                if (ESPAnimals)
                                {
                                    string distance = String.Format("{0:0}", Vector3.Distance(Character.transform.position,
                                                                                              character.transform.position));
                                    switch (Character.name.Replace("(Clone)", ""))
                                    {
                                    case "MutantBear":
                                        DrawLabel(Character.origin,
                                                  String.Format("Mutant Bear [{0}]", distance, Color.yellow));
                                        break;

                                    case "MutantWolf":
                                        DrawLabel(Character.origin,
                                                  String.Format("Mutant Wolf [{0}]", distance, Color.yellow));
                                        break;

                                    case "Chicken_A":
                                        DrawLabel(Character.origin,
                                                  String.Format("Chicken [{0}]", distance, Color.yellow));
                                        break;

                                    case "Rabbit_A":
                                        DrawLabel(Character.origin,
                                                  String.Format("Rabbit [{0}]", distance, Color.yellow));
                                        break;

                                    case "Stag_A":
                                        DrawLabel(Character.origin,
                                                  String.Format("Deer [{0}]", distance, Color.yellow));
                                        break;

                                    case "Bear":
                                        DrawLabel(Character.origin,
                                                  String.Format("Bear [{0}]", distance, Color.yellow));
                                        break;

                                    case "Wolf":
                                        DrawLabel(Character.origin,
                                                  String.Format("Wolf [{0}]", distance, Color.yellow));
                                        break;

                                    case "Boar_A":
                                        DrawLabel(Character.origin,
                                                  String.Format("Boar [{0}]", distance, Color.yellow));
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    if (ESPBases)
                    {
                        foreach (StructureMaster structureMaster in Resources.FindObjectsOfTypeAll(typeof(StructureMaster)))
                        {
                            if (structureMaster != null)
                            {
                                Vector3 pos = structureMaster.transform.position;
                                pos.y = pos.y + 5;
                                string distance = String.Format("{0:0}", Vector3.Distance(pos, character.transform.position));

                                if (structureMaster.gameObject != this)
                                {
                                    DrawLabel(structureMaster.transform.position, String.Format("{0} [{1}]", structureMaster.ownerID.ToString(), distance));
                                }
                            }
                        }
                    }

                    if (ESPLootables)
                    {
                        foreach (UnityEngine.Object GameObject in FindObjectsOfType(typeof(LootableObject)))
                        {
                            if (GameObject != null)
                            {
                                var lootableObject = GameObject as LootableObject;

                                string distance = String.Format("{0:0}", Vector3.Distance(lootableObject.transform.position, character.transform.position));
                                if (lootableObject.gameObject != this)
                                {
                                    DrawLabel(lootableObject.transform.position, String.Format("{0} [{1}]", lootableObject.name.Replace("(Clone)", ""), distance));
                                }
                            }
                        }
                    }

                    if (ESPSleepers)
                    {
                        foreach (UnityEngine.Object GameObject in FindObjectsOfType(typeof(SleepingAvatar)))
                        {
                            if (GameObject != null)
                            {
                                var sleepingAvatar = GameObject as SleepingAvatar;

                                string distance = String.Format("{0:0}", Vector3.Distance(sleepingAvatar.transform.position, character.transform.position));
                                if (sleepingAvatar.gameObject != this)
                                {
                                    DrawLabel(sleepingAvatar.transform.position, String.Format("{0} [{1}]", sleepingAvatar.name.Replace("(Clone)", ""), distance));
                                }
                            }
                        }
                    }

                    if (ESPOres)
                    {
                        foreach (UnityEngine.Object GameObject in FindObjectsOfType(typeof(ResourceObject)))
                        {
                            if (GameObject != null)
                            {
                                var   resourceObject = GameObject as ResourceObject;
                                float Vdistance      = Vector3.Distance(resourceObject.transform.position, character.transform.position);
                                if (Vdistance < 1000)
                                {
                                    string distance = String.Format("{0:0}", Vdistance);
                                    if (resourceObject.gameObject != this)
                                    {
                                        DrawLabel(resourceObject.transform.position, String.Format("{0} [{1}m]", resourceObject.name.Replace("(Clone)", ""), distance));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #27
0
        public override void AfterInvoke(InvocationInfo info, ref object returnValue)
        {
            if (info.target is ChatRooms && info.targetMethod.Equals("SetRoomInfo"))
            {
                RoomInfoMessage roomInfo = (RoomInfoMessage)info.arguments[0];
                if (!userNameToUserCache.ContainsKey(roomInfo.roomName))
                {
                    userNameToUserCache.Add(roomInfo.roomName, new Dictionary<string, ChatUser>());
                }
                Dictionary<string, ChatUser> userCache = userNameToUserCache[roomInfo.roomName];
                userCache.Clear();
                RoomInfoProfile[] profiles = roomInfo.updated;
                for (int i = 0; i < profiles.Length; i++)
                {
                    RoomInfoProfile p = profiles[i];
                    ChatUser user = ChatUser.FromRoomInfoProfile(p) ;
                    userCache.Add(user.name, user);
                    if (!globalusers.ContainsKey(user.name)) { globalusers.Add(user.name, user); };
                }

                
                
            }
            /*else if (info.target is ChatUI && info.targetMethod.Equals("Initiate"))
            {
                Console.WriteLine("Initialize#");
                if (target != (ChatUI)info.target)
                {
                    chatRooms = (ChatRooms)chatRoomsinfo.GetValue(info.target);
                    target = (ChatUI)info.target;
                }

            }*/

            else if (info.target is ChatUI && info.targetMethod.Equals("OnGUI"))
            {
                if (target != (ChatUI)info.target)
                {
                    chatRooms = (ChatRooms)chatRoomsinfo.GetValue(info.target);
                    target = (ChatUI)info.target;
                    
                }
                
                RoomLog currentRoomChatLog = chatRooms.GetCurrentRoomChatLog();
                if (currentRoomChatLog != null)
                {

                    if (!(chatRooms.GetCurrentRoom().name == this.currentroom)) { this.currentroom = chatRooms.GetCurrentRoom().name; recalc = true; }

                    Vector2 screenMousePos = GUIUtil.getScreenMousePos();
                    Rect chatlogAreaInner = new Rect((Rect)chatlogAreaInnerinfo.GetValue(info.target));

                    // delete picture on click!
                    if ((Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1)) && this.clicked == false) { this.clearallpics(); }

                    if (chatlogAreaInner.Contains(screenMousePos) && (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1)) && this.clicked == false)
                    { this.clicked=true;}
                    

                    if (!(Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1)) && this.clicked)
                    {
                        this.clicked = false;

                        if (!(Screen.height == screenh) || !(Screen.width == screenw)) // if resolution was changed, recalc positions
                        {
                            recalc = true;
                            screenh = Screen.height;
                            screenw = Screen.width;
                        }

                        timeStampStyle = (GUIStyle)timeStampStyleinfo.GetValue(info.target);
                        chatLogStyle = (GUIStyle)chatLogStyleinfo.GetValue(info.target);

                        bool allowSendingChallenges = (bool)allowSendingChallengesinfo.GetValue(info.target);

                        Gui.ContextMenu<ChatUser> userContextMenu = (Gui.ContextMenu<ChatUser>)userContextMenuinfo.GetValue(info.target);
                        WeeklyWinner[] weeklyWinners = (WeeklyWinner[])weeklyWinnerInfo.GetValue(info.target);
                        float maxScroll = (float)maxScrollinfo.GetValue(info.target);

                        int posy = 0;//

                        float width = (chatlogAreaInner.width - (float)Screen.height * 0.1f - 20f);
                        int globalfromxstart = (int)chatlogAreaInner.xMin + (int)(20f + (float)Screen.height * 0.042f) + 10;
                        int normlhight = (int)chatLogStyle.CalcHeight(new GUIContent("lol"), width);
                        float diff = GUI.skin.label.CalcHeight(new GUIContent("lol"), width) - chatLogStyle.CalcHeight(new GUIContent("lol"), width);
                        if (recalc) // recalc positions
                        {
                            this.roomuserlist.Clear();
                            //this.roomlinklist.Clear();


                            recalc = false;
                            

                            foreach (RoomLog.ChatLine current in currentRoomChatLog.GetLines())
                            {
                                logentry templog = new logentry();
                                //delete html

                                
                                String shorttxt = Regex.Replace(current.text, @"(<color=#[A-Za-z0-9]{0,6}>)|(</color>)", String.Empty);
                                templog.msg = current.text;

                                
                                templog.from = shorttxt.Split(':')[0];
                                templog.admin = false; //for testing true
                                if (current.senderAdminRole == AdminRole.Mojang || current.senderAdminRole == AdminRole.Moderator || current.senderFeatureType == FeatureType.DEMO)
                                {
                                    templog.admin = true;
                                }
                                if (!templog.admin)
                                {
                                    if (weeklyWinners != null && weeklyWinners.Length >= 4)
                                    {
                                        for (int i = 0; i < 4; i++)
                                        {
                                            if (current.from == weeklyWinners[i].userName)
                                            {
                                                templog.admin = true;
                                                break;
                                            }
                                        }
                                    }
                                }

                                chatLogStyle.wordWrap = false;// need to do this, or length of calcsize is wrong.. lol!!!
                                
                                Vector2 v = GUI.skin.label.CalcSize(new GUIContent(templog.from + ":"));//calc length of "username:"******"iiii " has the same length like the symbol
                                    v = GUI.skin.label.CalcSize(new GUIContent("iiii " + templog.from + ":"));//calc length of "username:"******" " + shorttxt + " " + msgheight);
                                int fromxend = (int)v.x + globalfromxstart;
                                templog.usernamelength = (int)v.x;
                                int fromystart = posy;
                                int fromyend = posy + normlhight;//(int)v.y
                                templog.end = posy + (int)msgheight +2;//2 is added after each msg
                                posy += (int)msgheight +2;
                                templog.userrec = new Rect(globalfromxstart, fromystart, fromxend - globalfromxstart, fromyend - fromystart);
                                this.roomuserlist.Add(templog);

                                //Console.WriteLine(current.text+" "+templog.from +" "+shorttxt+" " + v.x + " " + fromxend + " " + msgheight + " " + posy);
                                //Console.WriteLine(msgheight + " old:" + test123);
                                //Console.WriteLine("##");
                            }



                        }
                        else { posy = this.posycopy; }
                        this.posycopy = posy;
                        Vector2 chatScroll = Vector2.zero + (Vector2)chatScrollinfo.GetValue(info.target);
                        int chatlength = Math.Max(posy + (int)chatlogAreaInner.yMin + 1, (int)chatlogAreaInner.yMax);//take the chatlogareainner.y if msg doesnt need scrollbar (cause its to short)
                        //Maxscroll is FALSE! if you have a small window, with scollbar, and resize it maxscroll wont get lower
                        int truemaxscroll = Math.Max(chatlength - (int)chatlogAreaInner.yMax, 1);//minimum 1 else dividing by zero
                        //calculate upper y-value (=0 if chatscroll.y=0 and =chatlength-yMax if chatscroll.y=truemaxscroll)
                        int currentuppery = (int)((chatlength - (int)chatlogAreaInner.yMax) * (chatScroll.y / truemaxscroll));
                        //calculate mouseposy in chatbox (if maus klicks in the left upper edge of chatlogareainner with scrollbar on the top, the value is zero ) 
                        int realmousy = currentuppery + (int)screenMousePos.y - (int)chatlogAreaInner.yMin;
                        //Console.WriteLine("border chatinner: " + chatlogAreaInner.xMin + " " + chatlogAreaInner.yMin + " " + chatlogAreaInner.xMax + " " + chatlogAreaInner.yMax);
                        //Console.WriteLine("fontsize: " + chatLogStyle.fontSize);
                        //Console.WriteLine("maus " + screenMousePos.x + " " + realmousy);
                        Vector2 mousepos = new Vector2(screenMousePos.x, realmousy);

                        // is an username is clicked?
                        foreach (logentry log in roomuserlist)
                        {
                            Rect usrbutton = log.userrec;
                            if (usrbutton.Contains(mousepos))
                            {
                                //Console.WriteLine("userrecx " + log.userrec.xMin+" "+log.userrec.xMax);
                                //Console.WriteLine("klicked: " + log.from);
                                //##################
                                string sender = log.from;
                                ChatUser user;
                                bool foundUser = globalusers.TryGetValue(sender, out user);
                                if (foundUser)
                                {
                                    user.acceptChallenges = false;
                                    user.acceptTrades = true;
                                    this.CreateUserMenu(user, info.target,log.usernamelength);
                                    App.AudioScript.PlaySFX("Sounds/hyperduck/UI/ui_button_click");
                                }
                                //##################
                                break;
                            }
                            if (mousepos.y >= usrbutton.yMin && mousepos.y <= log.end) 
                            {
                                
                                string klickedword = whitchwordclicked(log.msg, chatLogStyle, width, normlhight, globalfromxstart, (int)usrbutton.yMin+2, mousepos, log.admin);
                                //clickable link?

                                if (klickedword.StartsWith("{\"deck\":\"") && klickedword.EndsWith("]}") && klickedword.Contains("\",\"types\":["))
                                {
                                    //is a deck-link! 
                                    this.copyDeckMenu(null, klickedword);
                                    App.AudioScript.PlaySFX("Sounds/hyperduck/UI/ui_button_click");
                                }

                                Match match = linkFinder.Match(klickedword);
                                if (match.Success)
                                {
                                    string link = match.Value;
                                    if (!(link.StartsWith(@"https://")) && !(link.StartsWith(@"http://"))) { link = "http://" + link; }
                                    this.CreateLinkMenu(null, link);
                                    App.AudioScript.PlaySFX("Sounds/hyperduck/UI/ui_button_click");
                                }
                                //clickable card?

                                cardsearcher cmatch = searchcard(klickedword);
                                //Match mutch=cardlinkfinder.Match(klickedword);
                                //if (mutch.Success)
                                if (cmatch.success)
                                {
                                    //string clink = mutch.Value.ToLower();
                                    //clink = clink.Replace("[","");
                                    //clink = clink.Replace("]", "");
                                    //clink = clink.Replace("_", " ");
                                    string clink = cmatch.clickedcardname;
                                    Console.WriteLine("CARDCLICKED: " + clink);
                                    int arrindex = Array.FindIndex(this.cardnames, element => element.Equals(clink));
                                    if (arrindex >= 0)
                                    {

                                        CardType type = CardTypeManager.getInstance().get(this.cardids[arrindex]);
                                        Card card = new Card(cardids[arrindex], type, false);
                                        UnityEngine.Object.Destroy(this.cardRule);
                                        cardRule = PrimitiveFactory.createPlane();
                                        cardRule.name = "CardRule";
                                        CardView cardView = cardRule.AddComponent<CardView>();
                                        cardView.init(this,card,0);
                                        cardView.applyHighResTexture();
                                        cardView.setLayer(8);
                                        Vector3 vccopy = Camera.main.transform.localPosition;
                                        Camera.main.transform.localPosition = new Vector3(0f , 1f , -10f);
                                        cardRule.transform.localPosition = Camera.main.ScreenToWorldPoint(new Vector3((float)Screen.width * 0.87f, (float)Screen.height * 0.6f, 0.9f)); ;
                                        //cardRule.transform.localPosition = Camera.main.ScreenToWorldPoint(new Vector3((float)Screen.width * 0.57f, (float)Screen.height * 0.6f, 0.9f)); ;
                                        
                                        cardRule.transform.localEulerAngles = new Vector3(90f, 180f, 0f);//90 180 0
                                        cardRule.transform.localScale = new Vector3(9.3f, 0.1f, 15.7f);// CardView.CardLocalScale(100f);
                                        cardtext=cardRule.renderer.material.mainTexture;
                                        Vector3 ttvec1 = Camera.main.WorldToScreenPoint(cardRule.renderer.bounds.min);
                                        Vector3 ttvec2 = Camera.main.WorldToScreenPoint(cardRule.renderer.bounds.max);
                                        Rect ttrec = new Rect(ttvec1.x, Screen.height - ttvec2.y, ttvec2.x - ttvec1.x, ttvec2.y - ttvec1.y);
                                        
                                        scalefactor =  (float)(Screen.height/1.9)/ttrec.height;
                                        cardRule.transform.localScale = new Vector3(cardRule.transform.localScale.x * scalefactor, cardRule.transform.localScale.y, cardRule.transform.localScale.z * scalefactor);
                                         ttvec1 = Camera.main.WorldToScreenPoint(cardRule.renderer.bounds.min);
                                         ttvec2 = Camera.main.WorldToScreenPoint(cardRule.renderer.bounds.max);
                                         ttrec = new Rect(ttvec1.x, Screen.height - ttvec2.y, ttvec2.x - ttvec1.x, ttvec2.y - ttvec1.y);
                                        cardrect = ttrec;
                                        gettextures(cardView);
                                        mytext = true;
                                        Camera.main.transform.localPosition=vccopy;


                                    }
                                
                                }

                            }
                            if (mousepos.y < log.end) { break; };

                        }//foreach (logentry log in liste) end 

                        // is link klicked
                        /*Rect lastrec = new Rect();
                        foreach (linkdata log in roomlinklist)
                        {
                            Rect[] usrbutton = log.linkrec;
                            bool contain = false;
                            foreach (Rect rec in usrbutton)
                            {
                                
                                contain = contain || rec.Contains(mousepos);
                                lastrec = rec;
                                //Console.WriteLine(contain + " " + rec.ToString());
                            }
                            if (contain)
                            {
                                string link = log.link;

                                //user.acceptChallenges = false;
                                //user.acceptTrades = true;
                                this.CreateLinkMenu(null, link);
                                App.AudioScript.PlaySFX("Sounds/hyperduck/UI/ui_button_click");



                                //##################
                                break;
                            }
                            if (mousepos.y < lastrec.yMax) { break; };

                        }*/

                        
                    }

                    // draw cardoverlay again!
                    if (mytext)
                    {
                        GUI.depth =1;
                        Rect rect = new Rect(100,100,100,Screen.height-200);
                        foreach (cardtextures cd in this.gameObjects)
                        {
                            GUI.DrawTexture(cd.cardimgrec, cd.cardimgimg); }

                        foreach (renderwords rw in this.textsArr)
                        {
                            
                            float width =rw.style.CalcSize(new GUIContent(rw.text)).x;
                           GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0),
                            Quaternion.identity, new Vector3(rw.rect.width / width, rw.rect.width / width, 1));
                            
                           Rect lol = new Rect(rw.rect.x * width / rw.rect.width, rw.rect.y * width / rw.rect.width, rw.rect.width * width / rw.rect.width, rw.rect.height * width / rw.rect.width);
                           GUI.contentColor = rw.color;
                           GUI.Label(lol, rw.text, rw.style);
                            
                        }

                    }
                    
                    
                }
            }

            /*
            else if (info.target is ChatRooms && info.targetMethod.Equals("ChatMessage"))
            {
                Console.WriteLine("chatmessage inc##");
                RoomChatMessageMessage msg = (RoomChatMessageMessage)info.arguments[0];
                if (msg.roomName == chatRooms.GetCurrentRoom().name)
                //if (((string)info.arguments[0]) == chatRooms.GetCurrentRoom().name)
                {
                    this.recalc = true;
                }
            }
            */

            else if (info.target is ArenaChat && info.targetMethod.Equals("handleMessage"))
            {
                Message msg = (Message)info.arguments[0];
                if (msg is WhisperMessage)
                {
                    WhisperMessage whisperMessage = (WhisperMessage)msg;
                    if (whisperMessage.GetChatroomName() == chatRooms.GetCurrentRoom().name)
                    {
                        this.recalc = true;
                    }
                }
                if (msg is RoomChatMessageMessage)
                {
                    RoomChatMessageMessage mssg = (RoomChatMessageMessage)msg;
                    if (mssg.roomName == chatRooms.GetCurrentRoom().name)
                    {
                        this.recalc = true;
                    }
                }
            
            }



            return;
        }
Пример #28
0
        public void Update()
        {
            try
            {
                character = Hooks.LocalPlayer?.controllable?.GetComponent <Character>() ?? null;
                if (character != null)
                {
                    IsAlive = character.alive;
                }

                if (AdminPlus.IsAllowed)
                {
                    if (!ChatUI.IsVisible() && !ConsoleWindow.IsVisible() && !MainMenu.IsVisible() && Input.GetKeyDown(KeyCode.BackQuote))
                    {
                        AdminPlus.Enabled = !AdminPlus.Enabled;
                        Screen.lockCursor = !AdminPlus.Enabled;
                    }

                    if (IsAlive)
                    {
                        //-- Speed / Jump hack --
                        character.ccmotor.jumping.setup.baseHeight          = 1f + JumpHeight;
                        character.ccmotor.movement.setup.maxForwardSpeed    = 4f + SpeedLevel;
                        character.ccmotor.movement.setup.maxSidewaysSpeed   = 4f + SpeedLevel;
                        character.ccmotor.movement.setup.maxBackwardsSpeed  = 3f + SpeedLevel;
                        character.ccmotor.movement.setup.maxAirAcceleration = 20f + SpeedLevel;
                        //----------------

                        if (Fly)
                        {
                            var LocalController   = PlayerClient.GetLocalPlayer().controllable.GetComponent <HumanController>();
                            var LocalPlayerClient = PlayerClient.GetLocalPlayer().controllable.GetComponent <PlayerClient>();

                            CCMotor ccmotor = LocalController.ccmotor;
                            ccmotor.velocity = Vector3.zero;
                            Angle2  eyesAngles = character.eyesAngles;
                            Vector3 forward    = eyesAngles.forward;
                            Vector3 back       = eyesAngles.back;
                            Vector3 right      = eyesAngles.right;
                            Vector3 left       = eyesAngles.left;
                            Vector3 up         = eyesAngles.up;
                            if (!ChatUI.IsVisible() && !ConsoleWindow.IsVisible() && !MainMenu.IsVisible())
                            {
                                if (Input.GetKey(KeyCode.W))
                                {
                                    if (Input.GetKey(KeyCode.LeftShift))
                                    {
                                        ccmotor.velocity = ccmotor.velocity + forward * (ccmotor.movement.setup.maxForwardSpeed * 20f);
                                    }
                                    else
                                    {
                                        ccmotor.velocity = ccmotor.velocity + forward * (ccmotor.movement.setup.maxForwardSpeed * 5f);
                                    }
                                }
                                if (Input.GetKey(KeyCode.S))
                                {
                                    if (Input.GetKey(KeyCode.LeftShift))
                                    {
                                        ccmotor.velocity = ccmotor.velocity + back * (ccmotor.movement.setup.maxBackwardsSpeed * 20f);
                                    }
                                    else
                                    {
                                        ccmotor.velocity = ccmotor.velocity + back * (ccmotor.movement.setup.maxBackwardsSpeed * 5f);
                                    }
                                }
                                if (Input.GetKey(KeyCode.A))
                                {
                                    if (Input.GetKey(KeyCode.LeftShift))
                                    {
                                        ccmotor.velocity = ccmotor.velocity + left * (ccmotor.movement.setup.maxSidewaysSpeed * 20f);
                                    }
                                    else
                                    {
                                        ccmotor.velocity = ccmotor.velocity + left * (ccmotor.movement.setup.maxSidewaysSpeed * 5f);
                                    }
                                }
                                if (Input.GetKey(KeyCode.D))
                                {
                                    if (Input.GetKey(KeyCode.LeftShift))
                                    {
                                        ccmotor.velocity = ccmotor.velocity + right * (ccmotor.movement.setup.maxSidewaysSpeed * 20f);
                                    }
                                    else
                                    {
                                        ccmotor.velocity = ccmotor.velocity + right * (ccmotor.movement.setup.maxSidewaysSpeed * 5f);
                                    }
                                }
                                if (Input.GetKey(KeyCode.Space))
                                {
                                    if (Input.GetKey(KeyCode.LeftShift))
                                    {
                                        ccmotor.velocity = ccmotor.velocity + up * (ccmotor.movement.setup.maxSidewaysSpeed * 10f);
                                    }
                                    else
                                    {
                                        ccmotor.velocity = ccmotor.velocity + up * (ccmotor.movement.setup.maxSidewaysSpeed * 4f);
                                    }
                                }
                            }
                            if (ccmotor.velocity == Vector3.zero)
                            {
                                ccmotor.velocity = ccmotor.velocity + Vector3.up * (float)((double)ccmotor.settings.gravity * (double)Time.deltaTime * 0.5);
                            }
                        }
                    }
                }
            }
            catch
            {
            }
        }
Пример #29
0
    // === /Network Commands ===


    void OnChatMessage(NetworkMessage msg)
    {
        MyMsg message = msg.ReadMessage <MyMsg>();

        ChatUI.ReceiveChat(message.data);
    }
Пример #30
0
        public void Update()
        {
            if (_fly)
            {
                CCMotor ccmotor         = this.localController.ccmotor;
                var     defaultMovement = new CCMotor.Movement?(ccmotor.movement.setup);

                ccmotor.velocity = Vector3.zero;
                Vector3 forward = this.localCharacter.eyesAngles.forward;
                Vector3 right   = this.localCharacter.eyesAngles.right;
                if (!ChatUI.IsVisible())
                {
                    if (Input.GetKey(KeyCode.W))
                    {
                        ccmotor.velocity += forward * (ccmotor.movement.setup.maxForwardSpeed * flySpeed);
                    }

                    if (Input.GetKey(KeyCode.S))
                    {
                        ccmotor.velocity -= forward * (ccmotor.movement.setup.maxBackwardsSpeed * flySpeed);
                    }

                    if (Input.GetKey(KeyCode.A))
                    {
                        ccmotor.velocity -= right * (ccmotor.movement.setup.maxSidewaysSpeed * flySpeed);
                    }

                    if (Input.GetKey(KeyCode.D))
                    {
                        ccmotor.velocity += right * (ccmotor.movement.setup.maxSidewaysSpeed * flySpeed);
                    }

                    if (Input.GetKey(KeyCode.Space))
                    {
                        ccmotor.velocity += Vector3.up * (defaultMovement.Value.maxAirAcceleration * flySpeed);
                    }
                }

                if (ccmotor.velocity == Vector3.zero)
                {
                    ccmotor.velocity += Vector3.up * (ccmotor.settings.gravity * Time.deltaTime * 0.5f);
                }
            }

            if (Input.GetKeyDown(KeyCode.PageUp))
            {
                flySpeed += 0.5f;
                if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
                {
                    flySpeed += 1.5f;
                }
            }
            else if (Input.GetKeyDown(KeyCode.PageDown))
            {
                flySpeed -= 0.5f;
                if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
                {
                    flySpeed -= 1.5f;
                }
            }

            if (!WorldEditor.Instance.Enabled)
            {
                return;
            }

            if (Input.GetKeyDown(KeyCode.LeftAlt))
            {
                if (ShowList)
                {
                    Screen.lockCursor = true;
                    ShowList          = false;
                }
                else
                {
                    Screen.lockCursor = false;
                    ShowList          = true;
                }
            }

            if (SpawnedObject != null && SpawnedObject.ObjectInstantiate != null)
            {
                if (Input.GetKey(KeyCode.Keypad1))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0.1f, 0, 0); //POSX
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(1f, 0, 0); //POSX
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0.01f, 0, 0); //POSX
                    }
                }

                if (Input.GetKey(KeyCode.Keypad2))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0.1f, 0, 0); //POSX
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(1f, 0, 0); //POSX
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0.01f, 0, 0); //POSX
                    }
                }

                if (Input.GetKey(KeyCode.Keypad4))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 0, 0.1f); //POSZ
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 0, 1f); //POSZ
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 0, 0.01f); //POSZ
                    }
                }

                if (Input.GetKey(KeyCode.Keypad5))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 0, 0.1f); //POSZ
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 0, 1f); //POSZ
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 0, 0.01f); //POSZ
                    }
                }

                if (Input.GetKey(KeyCode.Keypad7))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 0.1f, 0); //POSY
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 1f, 0); //POSY
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position += new Vector3(0, 0.01f, 0); //POSY
                    }
                }

                if (Input.GetKey(KeyCode.Keypad8))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 0.1f, 0); //POSY
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 1f, 0); //POSY
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.position -= new Vector3(0, 0.01f, 0); //POSY
                    }
                }

                if (Input.GetKey(KeyCode.UpArrow))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x + 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x + 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x + 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }

                if (Input.GetKey(KeyCode.DownArrow))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x - 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x - 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.x = rot.x - 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }

                if (Input.GetKey(KeyCode.LeftArrow))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y + 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y + 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y + 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }

                if (Input.GetKey(KeyCode.RightArrow))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y - 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y - 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.y = rot.y - 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }

                if (Input.GetKey(KeyCode.Keypad3))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z + 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z + 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z + 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }

                if (Input.GetKey(KeyCode.KeypadEnter))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z - 0.1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z - 1f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                    else
                    {
                        var rot = SpawnedObject.ObjectInstantiate.transform.rotation;
                        rot.z = rot.z - 0.01f;
                        SpawnedObject.ObjectInstantiate.transform.rotation = rot;
                    }
                }


                if (Input.GetKey(KeyCode.KeypadMultiply))
                {
                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale += new Vector3(0.1f, 0.1f, 0.1f); //SIZE +
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale += new Vector3(1f, 1f, 1f);
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale +=
                            new Vector3(0.01f, 0.01f, 0.01f); //SIZE +
                    }
                }

                if (Input.GetKey(KeyCode.KeypadMinus))
                {
                    if (SpawnedObject.ObjectInstantiate.transform.localScale == Vector3.zero)
                    {
                        return;
                    }

                    if (Input.GetKey(KeyCode.RightControl))
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale -= new Vector3(0.1f, 0.1f, 0.1f); //SIZE -
                    }
                    else if (Input.GetKey(KeyCode.RightShift))
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale -= new Vector3(1f, 1f, 1f);
                    }
                    else
                    {
                        SpawnedObject.ObjectInstantiate.transform.localScale -=
                            new Vector3(0.01f, 0.01f, 0.01f); //SIZE -
                    }
                }
            }
        }
Пример #31
0
        public CoreUI(OpCore core)
        {
            Core = core;

            // load menus for loaded services
            foreach (var service in Core.ServiceMap.Values)
            {
                var id = service.ServiceID;

                if (id == ServiceIDs.Board)
                {
                    Services[id] = new BoardUI(this, service);
                }

                if (id == ServiceIDs.Buddy)
                {
                    Services[id] = new BuddyUI(this, service);
                }

                if (id == ServiceIDs.Chat)
                {
                    Services[id] = new ChatUI(this, service);
                }

                if (id == ServiceIDs.IM)
                {
                    Services[id] = new IMUI(this, service);
                }

                if (id == ServiceIDs.Mail)
                {
                    Services[id] = new MailUI(this, service);
                }

                if (id == ServiceIDs.Plan)
                {
                    Services[id] = new PlanUI(this, service);
                }

                if (id == ServiceIDs.Profile)
                {
                    Services[id] = new ProfileUI(this, service);
                }

                if (id == ServiceIDs.Share)
                {
                    Services[id] = new ShareUI(this, service);
                }

                if (id == ServiceIDs.Storage)
                {
                    Services[id] = new StorageUI(this, service);
                }

                if (id == ServiceIDs.Trust)
                {
                    Services[id] = new TrustUI(this, service);
                }
            }

            Core.RunInGui      += Core_RunInGui;
            Core.UpdateConsole += Core_UpdateConsole;
            Core.ShowConfirm   += Core_ShowConfirm;
            Core.ShowMessage   += Core_ShowMessage;
            Core.VerifyPass    += Core_VerifyPass;

            Core_UpdateConsole("DeOps " + Application.ProductVersion);
        }
Пример #32
0
 private void Start()
 {
     singleton = this;
     this.textInput.Hide();
 }
Пример #33
0
    void PreInitialize()
    {
        InputController.Initialize();

        networkController = GetComponent<NetworkController>();
        networkController.Initialize();
        chunkController = chunks.GetComponent<ChunkController>();

        chatUI = GetComponent<ChatUI>();
        chatUI.Initialize();
    }