예제 #1
0
 /// <summary>
 /// Triggers
 /// </summary>
 /// <param name="o"></param>
 /// <param name="sender"></param>
 public static void EndOfDay_RenderCheck(object o, StardewModdingAPI.Events.RenderedEventArgs sender)
 {
     if (EndOfDay_IsShowingEndOfNightMenus() && EndOfDay_HasProcessedModdedItems == false)
     {
         EndOfDay_HackShipping();
         EndOfDay_HasProcessedModdedItems = true;
     }
 }
        private void Display_Rendered(object sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            if (!this.draw || this.texture == null)
            {
                return;
            }

            e.SpriteBatch.Draw(this.texture, new Vector2(50, 50), new Rectangle?(new Rectangle(this.x, this.y, this.w, this.h)), Color.White, 0, Vector2.Zero, 4f, SpriteEffects.None, 0.5f);
            if (this.offsetProvider.GetOffset(this.textureName, new Rectangle(this.x, this.y, this.w, this.h), SpriteEffects.None, out Vector2 offset))
            {
                this.drawer.DrawHats(new [] { new Hat(0), }, this.facingDirection, e.SpriteBatch, new Vector2(50, 50), offset, 0, 0.5f);
            }
        }
        private void Display_Rendered(object?sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            if (!Context.IsWorldReady)
            {
                return;
            }

            //draw X over time indicator
            if (shouldPause() && this.config.ShowPauseX && Game1.displayHUD)
            {
                Game1.spriteBatch.Draw(Game1.mouseCursors, updatePosition(), new Rectangle(269, 471, 15, 15), new Color(0, 0, 0, 64), 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.91f);
            }
        }
예제 #4
0
        private void Display_Rendered(object sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            if (!IsModEnabled())
            {
                return;
            }

            if (Config.BeesEnabled && beeDataList.Count > 0)
            {
                for (int i = beeDataList.Count - 1; i >= 0; i--)
                {
                    var beeDirection = beeDataList[i].dir;
                    var beeAngle     = beeDataList[i].angle;
                    var beePos       = beeDataList[i].pos;

                    int size = 64;
                    if (beeDirection != Vector2.Zero)
                    {
                        int period = 36;
                        if (Game1.random.NextDouble() < 0.01)
                        {
                            beeDirection = Vector2.Zero;
                        }
                        beeDataList[i].ticks++;
                        var which = beeDataList[i].ticks % period;
                        beeDataList[i].currentSprite = which < period / 4 ? 0 : ((which < period * 3 / 4 && which >= period / 2) ? 2 : 1);
                    }
                    else
                    {
                        beeDataList[i].ticks = 0;
                        if (Game1.random.NextDouble() < 0.01)
                        {
                            beeAngle     = Game1.random.NextDouble() * 2 * Math.PI;
                            beeDirection = new Vector2((float)Math.Cos(beeAngle), (float)Math.Sin(beeAngle));
                            beeDirection.Normalize();
                        }
                    }
                    beePos += beeDirection;
                    if (beePos.X < -size || beePos.Y < -size || beePos.X > Game1.viewport.Width + size / 2 || beePos.Y > Game1.viewport.Height + size / 2)
                    {
                        beeDataList.RemoveAt(i);
                        continue;
                    }
                    e.SpriteBatch.Draw(beeTexture, new Rectangle(Utility.Vector2ToPoint(beePos), new Point(size, size)), new Rectangle(beeDataList[i].currentSprite * 512, 0, 512, 512), Color.White, (float)(beeAngle + Math.PI / 2), new Vector2(256, 256), SpriteEffects.None, 1);
                    beeDataList[i].dir   = beeDirection;
                    beeDataList[i].angle = beeAngle;
                    beeDataList[i].pos   = beePos;
                }
            }
        }
예제 #5
0
        private void Display_Rendered(object sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            Color thisColor = Config.QuoteColor;

            thisColor.A = (byte)Math.Round(255 * Game1.fadeToBlackAlpha);

            for (int i = 0; i < dailyQuote.quoteLines.Count; i++)
            {
                e.SpriteBatch.DrawString(Game1.dialogueFont, dailyQuote.quoteLines[i], new Vector2(Game1.viewport.Width / 2 - (Config.QuoteCharPerLine * 10), Game1.viewport.Height / 2 - (dailyQuote.quoteLines.Count / 2) * Game1.dialogueFont.LineSpacing + Game1.dialogueFont.LineSpacing * i), thisColor);
            }
            if (dailyQuote.author != null)
            {
                e.SpriteBatch.DrawString(Game1.dialogueFont, Config.AuthorPrefix + dailyQuote.author, new Vector2(Game1.viewport.Width / 2 + (Config.QuoteCharPerLine * 10) - (dailyQuote.author.Length * 20 + Config.AuthorPrefix.Length * 20), Game1.viewport.Height / 2 - (dailyQuote.quoteLines.Count / 2) * Game1.dialogueFont.LineSpacing + Game1.dialogueFont.LineSpacing * dailyQuote.quoteLines.Count), thisColor);
            }


            //SpriteText.drawString(e.SpriteBatch, dailyQuote.quote, x, y, 999999, Config.QuoteWidth, 999999, Game1.fadeToBlackAlpha, 0.88f, false, -1, "", colorCode, SpriteText.ScrollTextAlignment.Left);
            //SpriteText.drawString(e.SpriteBatch, Config.AuthorPrefix + dailyQuote.author, x, y + (int)Math.Ceiling(dailyQuote.quoteSize.X / Config.QuoteWidth) * Game1.dialogueFont.LineSpacing, 999999, Config.QuoteWidth, 999999, Game1.fadeToBlackAlpha, 0.88f, false, -1, "", colorCode, SpriteText.ScrollTextAlignment.Right);
        }
예제 #6
0
        private void Display_Rendered(object sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            PelicanTTSMod._helper.Events.Display.Rendered -= Display_Rendered;
            shouldRead = false;

            if (capture == null || capture.Length == 0)
            {
                if (capturedTitle.Length > 0)
                {
                    capture = capturedTitle + ": " + capturedContent;
                }
                else
                {
                    capture = capturedContent;
                }
            }

            if (capture != null && capture != "")
            {
                SpeechHandlerPolly.configSay("Default", PelicanTTSMod.config.Voices["Default"]?.Voice ?? "Salli", capture);
            }
        }
예제 #7
0
        private void Display_Rendered(object sender, StardewModdingAPI.Events.RenderedEventArgs e)
        {
            SetScreenPosAndSize();
            if (Config.PhoneApp)
            {
                if (!api.GetPhoneOpened() || api.GetRunningApp() != Helper.ModRegistry.ModID)
                {
                    StopTrack(true);
                    Helper.Events.Display.Rendered -= Display_Rendered;
                    return;
                }
                e.SpriteBatch.Draw(backgroundTexture, new Rectangle((int)screenPos.X, (int)screenPos.Y, (int)screenSize.X, (int)screenSize.Y), Color.White);
            }
            else if (videoPlayer.State == MediaState.Stopped)
            {
                return;
            }

            if (videoPlayer.State == MediaState.Playing)
            {
                lastTexture = videoPlayer.GetTexture();
            }
            if (lastTexture != null && videoPlayer.State != MediaState.Stopped)
            {
                Vector2 size;
                Vector2 pos = screenPos;
                float   rs  = screenSize.X / screenSize.Y;
                float   rv  = lastTexture.Width / (float)lastTexture.Height;
                if (rv > rs)
                {
                    size = new Vector2(screenSize.X, screenSize.X * lastTexture.Height / lastTexture.Width);
                    pos += new Vector2(0, (screenSize.Y - size.Y) / 2);
                }
                else if (rv > rs)
                {
                    size = new Vector2(screenSize.Y * lastTexture.Width / lastTexture.Height, screenSize.Y);
                    pos += new Vector2((screenSize.X - size.X) / 2, 0);
                }
                else
                {
                    size = screenSize;
                }
                Rectangle videoRect = new Rectangle((int)pos.X, (int)pos.Y, (int)size.X, (int)size.Y);

                e.SpriteBatch.Draw(lastTexture, videoRect, Color.White);

                if (new Rectangle((int)screenPos.X, (int)screenPos.Y, (int)screenSize.X, (int)screenSize.Y).Contains(Game1.getMousePosition()))
                {
                    int delay = 30;
                    if (uiTicks < 255 + delay)
                    {
                        uiTicks++;
                    }
                    if (uiTicks < 255 + delay)
                    {
                        uiTicks++;
                    }

                    int c = Math.Max(uiTicks - delay, 0);

                    Color color = new Color(c, c, c, c);
                    e.SpriteBatch.Draw(buttonsTexture, screenPos + new Vector2(screenSize.X / 2 - 96, screenSize.Y - 48), color);

                    if (Config.PhoneApp)
                    {
                        e.SpriteBatch.Draw(xTexture, screenPos + new Vector2(screenSize.X - 48, 16), color);
                    }
                }
                else
                {
                    uiTicks = 0;
                }
            }
            if (videoPlayer.State != MediaState.Playing)
            {
                e.SpriteBatch.Draw(playTexture, screenPos + new Vector2(screenSize.X / 2 - 32, screenSize.Y / 2 - 32), Color.White);
            }
        }