Beispiel #1
0
    public virtual ChatMenu GetChatMenu(Character c)
    {
        Debug.Log("ChatMenuComponent default GetChatMenu() executed, you need to override this method!");
        ChatMenu cm = null;

        return(cm);
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        enabled = gameObject.GetComponent <PhotonView>().isMine;
        if (!enabled)
        {
            return;
        }
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
        }
        nc          = GameObject.Find("NetworkHolder").GetComponent <NetworkController>();
        chatMenu    = GameObject.Find("Chat").GetComponent <ChatMenu>();
        chatMenu.ch = this;
        Username    = nc.PlayerLogin;
        ConnectionProtocol connectProtocol = ConnectionProtocol.Udp;

        chatclient            = new ChatClient(this, connectProtocol);
        chatclient.ChatRegion = "EU";
        authValues            = new ExitGames.Client.Photon.Chat.AuthenticationValues();
        authValues.UserId     = Username;
        authValues.AuthType   = ExitGames.Client.Photon.Chat.CustomAuthenticationType.None;
        instance = this;
        DontDestroyOnLoad(gameObject);
        Application.runInBackground = true;
        Connect();
    }
    public override ChatMenu GetChatMenu(Character c)
    {
        ChatMenu chatMenu = new ChatMenu(GetNPCResponseText());

        chatMenu.Add(c.appearance);
        chatMenu.Add(c.profession);
        return(chatMenu);
    }
 public void updateObserver(ChatMenu newChatMenu, int i)
 {
     if (i < newChatMenu.GetChatMenuList().Count)
     {
         buttonText.text = newChatMenu.GetChild(i).GetButtonText();
     }
     this.newChatMenu = newChatMenu;
     this.i           = i;
 }
    public static ChatMenu GetRootChatMenu(Character c, string npcResponseText)
    {
        ChatMenu rootChatMenu = new ChatMenu(npcResponseText);

        rootChatMenu.Add(c.appearance);
        rootChatMenu.Add(c.profession);
        rootChatMenu.Add(c.lifeEvents);
        rootChatMenu.Add(c.parents);
        return(rootChatMenu);
    }
Beispiel #6
0
    public override ChatMenu GetChatMenu(Character c)
    {
        ChatMenu lifeEventsChatMenu = new ChatMenu(GetNPCResponseText());

        lifeEventsChatMenu.Add(c.childhood);
        lifeEventsChatMenu.Add(c.adolescence);
        lifeEventsChatMenu.Add(c.adulthood);
        lifeEventsChatMenu.Add(c.elder);
        return(lifeEventsChatMenu);
    }
Beispiel #7
0
    public override ChatMenu GetChatMenu(Character c)
    {
        ChatMenu appearanceChatMenu = new ChatMenu(GetNPCResponseText());

        appearanceChatMenu.Add(c.race);
        appearanceChatMenu.Add(c.gender);
        appearanceChatMenu.Add(c.age);
        appearanceChatMenu.Add(c.stats);

        return(appearanceChatMenu);
    }
    public override ChatMenu GetChatMenu(Character c)
    {
        ChatMenu parentsChatMenu = new ChatMenu(GetNPCResponseText());

        parentsChatMenu.Add(c.mother);
        parentsChatMenu.Add(c.father);

        /**
         * We need to create a null ChatMenuComponent...
         */
        parentsChatMenu.Add(c.nullChatMenuComponent);
        parentsChatMenu.Add(c.nullChatMenuComponent);
        return(parentsChatMenu);
    }
 public void notifyObservers(ChatMenu chatMenu)
 {
     /**
      * This is pretty tricky conceptually. We'll have to loop back around to this.
      * This is coded a little weird. It'll work for now though.
      */
     for (int i = 0; i < observerList.Count; i++)
     {
         if (i < chatMenu.GetChatMenuList().Count)
         {
             observerList[i].updateObserver(chatMenu, i);
         }
     }
     //This extra statement is separate, It updates the chatbotresponse.
     //It always has to do this... without any conditions.
     observerList[observerList.Count - 1].updateObserver(chatMenu, observerList.Count);
 }
        private void SetupNetworkConnection()
        {
            // Setup Access Endpoint
            var url = "ec2-52-90-46-132.compute-1.amazonaws.com";

            // Debug
            //var url = "localhost:51216/";

            var httpEndPoint = $@"http://{url}";
            //var httpEndPoint = "http://*****:*****@"ws://{url}/Websocket/WsChatHandler.ashx";
            var sessionEventEndpoint = $@"ws://{url}/Websocket/WsSessionEventHandler.ashx";
            var connexionEndpoint    = $@"ws://{url}/Websocket/WsConnexionHandler.ashx";

            // Websocket endpoint
            WebsocketChatAccess.Instance = new WebsocketChatAccess(chatEndpoint);
            SessionEventWebsocketAccess.Initialize(sessionEventEndpoint);
            ConnexionWebsocketAccess.Instance = new ConnexionWebsocketAccess(connexionEndpoint);

            // Http endpoint
            UserAccess.Instance        = new UserAccess(httpEndPoint);
            ProfileAccess.Instance     = new ProfileAccess(httpEndPoint);
            FriendAccess.Instance      = new FriendAccess(httpEndPoint);
            GameAccess.Instance        = new GameAccess(httpEndPoint);
            PingAccess.Instance        = new PingAccess(httpEndPoint);
            LeaderboardAccess.Instance = new LeaderboardAccess(httpEndPoint);
            ZoneAccess.Instance        = new ZoneAccess(httpEndPoint);
            DailyAccess.Instance       = new DailyAccess(httpEndPoint);

            // Setup Chat
            Chatmenu             = new ChatMenu();
            ChatPanel.Content    = Chatmenu;
            ChatPanel.Visibility = Visibility.Hidden;

            // Setup Achievement panel
            Achievement = new AchievementPanel();
            AchievementPanel.Content = Achievement;
            Achievement.HideAchievement();

            // Setup Message Panel
            var defaultMessage = new MessagePresenter();

            SetMessage(defaultMessage);
            defaultMessage.IsVisible = false;
        }
Beispiel #11
0
        private void chatList_ButtonPressEvent(object o, ButtonPressEventArgs args)
        {
            TreePath path;

            if (chatList.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path))
            {
                chatList.Selection.SelectPath(path);
            }
            else
            {
                chatList.Selection.UnselectAll();
            }

            if (args.Event.Button == 3)
            {
                ChatMenu menu = new ChatMenu();
                menu.Popup(GetSelectedChatRoom());
            }
        }
    // Start is called before the first frame update

    /**
     * Don't try changing the Start() below to an Awake().
     * There's a bunch of shit that needs to happen in the classes
     * before the driver can start.
     */
    void Start()
    {
        playerCommand1  = playerCommandButton1.GetComponent <IObserver>();
        playerCommand2  = playerCommandButton2.GetComponent <IObserver>();
        playerCommand3  = playerCommandButton3.GetComponent <IObserver>();
        playerCommand4  = playerCommandButton4.GetComponent <IObserver>();
        chatBotResponse = chatBotResponseCanvas.GetComponent <IObserver>();

        randomCharacter = Character.createRandomCharacter();
        randomCharacter.registerObserver(playerCommand1);
        randomCharacter.registerObserver(playerCommand2);
        randomCharacter.registerObserver(playerCommand3);
        randomCharacter.registerObserver(playerCommand4);
        randomCharacter.registerObserver(chatBotResponse);

        startingChatMenu = ChatMenu.GetRootChatMenu(randomCharacter, randomCharacter.characterName.GetNPCResponseText());
        randomCharacter.notifyObservers(startingChatMenu);

        //PrintCharacter(randomCharacter);
    }
Beispiel #13
0
        public override void draw(SpriteBatch b)
        {
            if (!didModeSelect)
            {
                int x = xPositionOnScreen + width / 4;
                int y = yPositionOnScreen + (int)(height / 5 * 0.5);
                int w = width / 2;
                int h = height / 5;

                buttonX = x;
                buttonH = h;
                buttonW = w;

                buttonY1 = y;
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, "Singleplayer", x + w / 2 - SpriteText.getWidthOfString("Singleplayer") / 2, y + h / 2 - SpriteText.getHeightOfString("Singleplayer") / 2);
                y += (int)(h * 1.25);

                buttonY2 = y;
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, "Host", x + w / 2 - SpriteText.getWidthOfString("Host") / 2, y + h / 2 - SpriteText.getHeightOfString("Host") / 2);
                y += (int)(h * 1.25);

                buttonY3 = y;
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, "Client", x + w / 2 - SpriteText.getWidthOfString("Client") / 2, y + h / 2 - SpriteText.getHeightOfString("Client") / 2);
            }
            else if (modeInit == null)
            {
                int    x = buttonX, y = buttonY3, w = buttonW, h = buttonH;
                String str = (Multiplayer.mode == Mode.Host ? "Listen" : "Connect");

                if (ipBox != null)
                {
                    SpriteText.drawString(b, "IP Address:", ipBox.X - SpriteText.getWidthOfString("IP Address:") - 20, ipBox.Y);
                    ipBox.Draw(b);
                }
                if (portBox != null)
                {
                    SpriteText.drawString(b, "Port:", portBox.X - SpriteText.getWidthOfString("IP Address:") - 20, portBox.Y);
                    portBox.Draw(b);
                }

                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
            }
            else if (Multiplayer.problemStarting)
            {
                int    x = buttonX, y = buttonY1, w = buttonW, h = buttonH;
                String str = "Error";
                SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);

                y = buttonY2;
                //

                y   = buttonY3;
                str = "Back";
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
            }
            else if (Multiplayer.server != null)
            {
                int    x = buttonX, y = buttonY1, w = buttonW, h = buttonH;
                String str = "Start";

                /*Util.drawStr("Other players: ", x, buttonY1, Color.White);
                 * foreach ( Server.Client client in Multiplayer.server.clients )
                 * {
                 *  String str_ = "<Client " + ( int )( client.id ) + ">";
                 *  if ( client.farmer != null )
                 *      str_ = client.farmer.name;
                 *
                 *  y += 30;
                 *  Util.drawStr(str_, x + 25, y, Color.White);
                 * }*/

                y = buttonY3;
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
            }
            else if (Multiplayer.client != null)
            {
                int x = buttonX, y = buttonY1, w = buttonW, h = buttonH;

                /*Util.drawStr("Other players: ", x, buttonY1, Color.White);
                 * foreach (KeyValuePair< byte, SFarmer > other in Multiplayer.client.others)
                 * {
                 *  String str_ = "<Client " + (int)(other.Key) + ">";
                 *  if (other.Value != null)
                 *      str_ = other.Value.name;
                 *
                 *  y += 30;
                 *  Util.drawStr(str_, x + 25, y, Color.White);
                 * }*/
            }

            base.draw(b);

            ChatMenu.drawChat(false);
        }
 public void updateObserver(ChatMenu cm, int i)
 {
     Debug.Log(cm.GetNPCResponseText());
     npcResponseText.text = cm.GetNPCResponseText();
 }
 public ChatWindow(ChatMenu chatMenu)
 {
     InitializeComponent();
     ChatPanel.Content = chatMenu;
     _currentChatMenu  = chatMenu;
 }
Beispiel #16
0
        ////////////////////////////////////////
        public override void draw(SpriteBatch b)
        {
            ////////////////////////////////////////
            if (loading && timerToLoad <= 1)
            {
                if (!didModeSelect)
                {
                    int x = xPositionOnScreen + width / 4;
                    int y = yPositionOnScreen + (int)(height / 5 * 0.5);
                    int w = width / 2;
                    int h = height / 5;

                    buttonX = x;
                    buttonH = h;
                    buttonW = w;

                    buttonY1 = y;
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, "Singleplayer", x + w / 2 - SpriteText.getWidthOfString("Singleplayer") / 2, y + h / 2 - SpriteText.getHeightOfString("Singleplayer") / 2);
                    y += (int)(h * 1.25);

                    buttonY2 = y;
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, "Host", x + w / 2 - SpriteText.getWidthOfString("Host") / 2, y + h / 2 - SpriteText.getHeightOfString("Host") / 2);
                    y += (int)(h * 1.25);

                    buttonY3 = y;
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, "Client", x + w / 2 - SpriteText.getWidthOfString("Client") / 2, y + h / 2 - SpriteText.getHeightOfString("Client") / 2);
                }
                else if (modeInit == null)
                {
                    int    x = buttonX, y = buttonY3, w = buttonW, h = buttonH;
                    String str = (Multiplayer.mode == Mode.Host ? "Listen" : "Connect");

                    if (ipBox != null)
                    {
                        SpriteText.drawString(b, "IP Address:", ipBox.X - SpriteText.getWidthOfString("IP Address:") - 20, ipBox.Y);
                        ipBox.Draw(b);
                    }
                    if (portBox != null)
                    {
                        SpriteText.drawString(b, "Port:", portBox.X - SpriteText.getWidthOfString("IP Address:") - 20, portBox.Y);
                        portBox.Draw(b);
                    }

                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
                }
                else if (Multiplayer.problemStarting)
                {
                    int    x = buttonX, y = buttonY1, w = buttonW, h = buttonH;
                    String str = "Error";
                    SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);

                    y = buttonY2;
                    //

                    y   = buttonY3;
                    str = "Back";
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
                }
                else if (Multiplayer.server != null)
                {
                    int    x = buttonX, y = buttonY1, w = buttonW, h = buttonH;
                    String str = "Start";

                    /*Util.drawStr("Other players: ", x, buttonY1, Color.White);
                     * foreach ( Server.Client client in Multiplayer.server.clients )
                     * {
                     *  String str_ = "<Client " + ( int )( client.id ) + ">";
                     *  if ( client.farmer != null )
                     *      str_ = client.farmer.name;
                     *
                     *  y += 30;
                     *  Util.drawStr(str_, x + 25, y, Color.White);
                     * }*/

                    y = buttonY3;
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                    SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
                }
                else if (Multiplayer.client != null)
                {
                    int x = buttonX, y = buttonY1, w = buttonW, h = buttonH;

                    /*Util.drawStr("Other players: ", x, buttonY1, Color.White);
                     * foreach (KeyValuePair< byte, Farmer > other in Multiplayer.client.others)
                     * {
                     *  String str_ = "<Client " + (int)(other.Key) + ">";
                     *  if (other.Value != null)
                     *      str_ = other.Value.name;
                     *
                     *  y += 30;
                     *  Util.drawStr(str_, x + 25, y, Color.White);
                     * }*/
                }

                base.draw(b);

                ChatMenu.drawChat(false);
                return;
            }
            ////////////////////////////////////////

            IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height + Game1.tileSize / 2, Color.White, (float)Game1.pixelZoom, true);
            for (int i = 0; i < this.gamesToLoadButton.Count <ClickableComponent>(); i++)
            {
                if (this.currentItemIndex + i < this.saveGames.Count <Farmer>())
                {
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 396, 15, 15), this.gamesToLoadButton[i].bounds.X, this.gamesToLoadButton[i].bounds.Y, this.gamesToLoadButton[i].bounds.Width, this.gamesToLoadButton[i].bounds.Height, ((this.currentItemIndex + i == this.selected && this.timerToLoad % 150 > 75 && this.timerToLoad > 1000) || (this.selected == -1 && this.gamesToLoadButton[i].containsPoint(Game1.getOldMouseX(), Game1.getOldMouseY()) && !this.scrolling && !this.deleteConfirmationScreen)) ? (this.deleteButtons[i].containsPoint(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.White : Color.Wheat) : Color.White, (float)Game1.pixelZoom, false);
                    SpriteText.drawString(b, this.currentItemIndex + i + 1 + ".", this.gamesToLoadButton[i].bounds.X + Game1.pixelZoom * 7 + Game1.tileSize / 2 - SpriteText.getWidthOfString(this.currentItemIndex + i + 1 + ".") / 2, this.gamesToLoadButton[i].bounds.Y + Game1.pixelZoom * 9, 999999, -1, 999999, 1f, 0.88f, false, -1, "", -1);
                    SpriteText.drawString(b, this.saveGames[this.currentItemIndex + i].Name, this.gamesToLoadButton[i].bounds.X + Game1.tileSize * 2 + Game1.pixelZoom * 9, this.gamesToLoadButton[i].bounds.Y + Game1.pixelZoom * 9, 999999, -1, 999999, 1f, 0.88f, false, -1, "", -1);
                    b.Draw(Game1.shadowTexture, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + Game1.tileSize + Game1.tileSize - Game1.pixelZoom), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize * 2 + Game1.pixelZoom * 4)), new Rectangle?(Game1.shadowTexture.Bounds), Color.White, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, 0.8f);
                    this.saveGames[this.currentItemIndex + i].FarmerRenderer.draw(b, new FarmerSprite.AnimationFrame(0, 0, false, false, null, false), 0, new Rectangle(0, 0, 16, 32), new Vector2((float)(this.gamesToLoadButton[i].bounds.X + Game1.tileSize / 4 + Game1.tileSize + Game1.pixelZoom * 3), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.pixelZoom * 5)), Vector2.Zero, 0.8f, 2, Color.White, 0f, 1f, this.saveGames[this.currentItemIndex + i]);
                    Utility.drawTextWithShadow(b, this.saveGames[this.currentItemIndex + i].dateStringForSaveGame, Game1.dialogueFont, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + Game1.tileSize * 2 + Game1.pixelZoom * 8), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize + Game1.pixelZoom * 10)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
                    Utility.drawTextWithShadow(b, this.saveGames[this.currentItemIndex + i].farmName + " Farm", Game1.dialogueFont, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + this.width - Game1.tileSize * 2) - Game1.dialogueFont.MeasureString(this.saveGames[this.currentItemIndex + i].farmName + " Farm").X, (float)(this.gamesToLoadButton[i].bounds.Y + Game1.pixelZoom * 11)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
                    int num = (int)Game1.dialogueFont.MeasureString(Utility.getNumberWithCommas(this.saveGames[this.currentItemIndex + i].Money) + "g").X;
                    Utility.drawWithShadow(b, Game1.mouseCursors, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + this.width - Game1.tileSize * 3 - Game1.pixelZoom * 25 - num), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize + Game1.pixelZoom * 11)), new Rectangle(193, 373, 9, 9), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, false, 1f, -1, -1, 0.35f);
                    Utility.drawTextWithShadow(b, Utility.getNumberWithCommas(this.saveGames[this.currentItemIndex + i].Money) + "g", Game1.dialogueFont, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + this.width - Game1.tileSize * 3 - Game1.pixelZoom * 15 - num), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize + Game1.pixelZoom * 11)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
                    Utility.drawWithShadow(b, Game1.mouseCursors, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + this.width - Game1.tileSize * 3 - Game1.pixelZoom * 11), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize + Game1.pixelZoom * 9)), new Rectangle(595, 1748, 9, 11), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, false, 1f, -1, -1, 0.35f);
                    Utility.drawTextWithShadow(b, Utility.getHoursMinutesStringFromMilliseconds(this.saveGames[this.currentItemIndex + i].millisecondsPlayed), Game1.dialogueFont, new Vector2((float)(this.gamesToLoadButton[i].bounds.X + this.width - Game1.tileSize * 3 - Game1.pixelZoom), (float)(this.gamesToLoadButton[i].bounds.Y + Game1.tileSize + Game1.pixelZoom * 11)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
                    if (this.deleteButtons.Count <ClickableTextureComponent>() > i)
                    {
                        this.deleteButtons[i].draw(b, Color.White * 0.75f, 1f);
                    }
                }
            }
            if (this.saveGames.Count <Farmer>() == 0)
            {
                SpriteText.drawStringHorizontallyCenteredAt(b, "No Saved Games Found", Game1.graphics.GraphicsDevice.Viewport.Bounds.Center.X, Game1.graphics.GraphicsDevice.Viewport.Bounds.Center.Y, 999999, -1, 999999, 1f, 0.88f, false, -1);
            }
            this.upArrow.draw(b);
            this.downArrow.draw(b);
            if (this.saveGames.Count <Farmer>() > 4)
            {
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), this.scrollBarRunner.X, this.scrollBarRunner.Y, this.scrollBarRunner.Width, this.scrollBarRunner.Height, Color.White, (float)Game1.pixelZoom, false);
                this.scrollBar.draw(b);
            }
            if (this.deleteConfirmationScreen)
            {
                b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), Color.Black * 0.75f);
                SpriteText.drawString(b, "Really delete file: " + this.saveGames[this.selectedForDelete].name + "?", (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize * 8, Game1.tileSize, 0, 0).X, (int)Utility.getTopLeftPositionForCenteringOnScreen(Game1.tileSize * 3, Game1.tileSize, 0, 0).Y, 9999, -1, 9999, 1f, 1f, false, -1, "", 4);
                this.okDeleteButton.draw(b);
                this.cancelDeleteButton.draw(b);
            }
            base.draw(b);
            if (this.hoverText.Count <char>() > 0)
            {
                IClickableMenu.drawHoverText(b, this.hoverText, Game1.dialogueFont, 0, 0, -1, null, -1, null, null, 0, -1, -1, -1, -1, 1f, null);
            }
            if (this.selected != -1 && this.timerToLoad < 1000)
            {
                b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), Color.Black * (1f - (float)this.timerToLoad / 1000f));
            }

            ChatMenu.drawChat(true);
        }
Beispiel #17
0
    void Awake()
    {
        if (instance != null){
            Debug.LogWarning("There are 2 gui managers");
        }
        instance = this;
        activeControls = new List<GUIControl>();
        controlsToRemove = new List<GUIControl>();
        controlsToAdd = new List<GUIControl>();

        chatMenu = GetComponent<ChatMenu>();
        inGameMenu = GetComponent<InGameMenu>();
        interactionMenu = GetComponent<InteractionMenu>();
        pauseMenu = GetComponent<PauseMenu>();
        loadingScreen = GetComponent<LoadingScreen>();
    }
    public override ChatMenu GetChatMenu(Character c)
    {
        ChatMenu chatMenu = ChatMenu.GetRootChatMenu(c, GetNPCResponseText());

        return(chatMenu);
    }
Beispiel #19
0
        public ArenaControl(ScriptClient client, ChatMenu chatMenu, InGameMenu inGameMenu)
        {
            _Client     = client ?? throw new ArgumentNullException(nameof(client));
            _ChatMenu   = chatMenu ?? throw new ArgumentNullException(nameof(chatMenu));
            _InGameMenu = inGameMenu ?? throw new ArgumentNullException(nameof(inGameMenu));

            _PlayerControls = new KeyDictionary()
            {
                { KeyBind.Jump, Jump },
                {
                    KeyBind.DrawFists, d =>
                    {
                        if (d)
                        {
                            NPCInst.Requests.DrawFists(ScriptClient.Client.Character);
                        }
                    }
                },
                { KeyBind.MoveForward, d => CheckFightMove(d, FightMoves.Fwd) },
                { KeyBind.TurnLeft, d => CheckFightMove(d, FightMoves.Left) },
                { KeyBind.TurnRight, d => CheckFightMove(d, FightMoves.Right) },
                { KeyBind.MoveBack, d => CheckFightMove(d, FightMoves.Parry) },
                { KeyBind.MoveLeft, d => CheckFightMove(d, FightMoves.Left) },
                { KeyBind.MoveRight, d => CheckFightMove(d, FightMoves.Right) },
                { KeyBind.Action, PlayerActionButton },
                { KeyBind.DrawWeapon, DrawWeapon },
                { KeyBind.ScoreBoard, ToggleScoreBoard },
                {
                    KeyBind.ChatAll, d =>
                    {
                        if (d)
                        {
                            _ChatMenu.OpenAllChat();
                        }
                    }
                },
                {
                    KeyBind.ChatTeam, d =>
                    {
                        if (d)
                        {
                            _ChatMenu.OpenTeamChat();
                        }
                    }
                },
                {
                    KeyBind.Inventory, d =>
                    {
                        if (d)
                        {
                            Sumpfkraut.Menus.PlayerInventory.Menu.Open();
                        }
                    }
                },
                { VirtualKeys.P, PrintPosition },
                { VirtualKeys.F2, d => Menus.PlayerList.TogglePlayerList() },
                { VirtualKeys.F3, ToggleG1Camera },
                { VirtualKeys.F5, ToggleScreenInfo },
                { VirtualKeys.N1, DrawMeleeWeapon },
                { VirtualKeys.N2, DrawRangedWeapon },
                { VirtualKeys.RightButton, FreeAim },
                { KeyBind.StatusMenu, OpenStatusMenu }
            };

            _SpectatorControls = new KeyDictionary()
            {
                { VirtualKeys.Shift, down => speedMultiplier = !down ? defaultSpeed : fastSpeed },
                { KeyBind.ChatAll, d => { if (d)
                                          {
                                              _ChatMenu.OpenAllChat();
                                          }
                  } },
                { KeyBind.ChatTeam, d => { if (d)
                                           {
                                               _ChatMenu.OpenTeamChat();
                                           }
                  } },
                { KeyBind.ScoreBoard, ToggleScoreBoard },
                { VirtualKeys.F2, d => Menus.PlayerList.TogglePlayerList() },
                { VirtualKeys.F3, ToggleG1Camera },
                { VirtualKeys.F5, ToggleScreenInfo },
            };
        }