Example #1
0
        public void Draw(IB2Panel parentPanel)
        {
            if (!gv.mod.currentArea.isOverviewMap)
            {
                if (gv.mod.currentArea.overviewOwnZoneMapExists && gv.mod.currentArea.showOverviewButtonOwnZoneMap && this.tag == "btnOwnZoneMap")
                {
                    this.show = true;
                }
                else if (this.tag == "btnOwnZoneMap")
                {
                    this.show = false;
                }

                if (gv.mod.currentArea.overviewMotherZoneMapExists && gv.mod.currentArea.showOverviewButtonMotherZoneMap && this.tag == "btnMotherZoneMap")
                {
                    this.show = true;
                }
                else if (this.tag == "btnMotherZoneMap")
                {
                    this.show = false;
                }

                if (gv.mod.currentArea.overviewGrandMotherZoneMapExists && gv.mod.currentArea.showOverviewButtonGrandMotherZoneMap && this.tag == "btnGrandMotherZoneMap")
                {
                    this.show = true;
                }
                else if (this.tag == "btnGrandMotherZoneMap")
                {
                    this.show = false;
                }
            }
            else
            {
                foreach (Area a in gv.mod.moduleAreasObjects)
                {
                    if (a.filenameOfGrandMotherZoneMap == gv.mod.overviewReturnAreaName)
                    {
                        if (a.overviewOwnZoneMapExists && a.showOverviewButtonOwnZoneMap && this.tag == "btnOwnZoneMap")
                        {
                            this.show = true;
                        }
                        else if (this.tag == "btnOwnZoneMap")
                        {
                            this.show = false;
                        }

                        if (a.overviewMotherZoneMapExists && a.showOverviewButtonMotherZoneMap && this.tag == "btnMotherZoneMap")
                        {
                            this.show = true;
                        }
                        else if (this.tag == "btnMotherZoneMap")
                        {
                            this.show = false;
                        }

                        if (a.overviewGrandMotherZoneMapExists && a.showOverviewButtonGrandMotherZoneMap && this.tag == "btnGrandMotherZoneMap")
                        {
                            this.show = true;
                        }
                        else if (this.tag == "btnGrandMotherZoneMap")
                        {
                            this.show = false;
                        }
                    }
                }
            }

            if (gv.mod.currentArea.isOverviewMap && (this.tag == "btnRation" || this.tag == "btnTorch" || this.tag == "btnZoom"))
            {
                this.show = false;
            }
            else if (this.tag == "btnRation" || this.tag == "btnTorch" || this.tag == "btnZoom")
            {
                this.show = true;
            }

            if (!gv.mod.useComplexCoordinateSystem && (this.tag == "btnZoom" || this.tag == "btnTorch" || this.tag == "btnRation"))
            {
                this.show = false;
            }

            if (!gv.mod.useRationSystem && this.tag == "btnRation")
            {
                this.show = false;
            }

            if (!gv.mod.useLightSystem && this.tag == "btnTorch")
            {
                this.show = false;
            }

            /*
             * if (gv.mod.currentArea.isOverviewMap && (this.tag == "btnRation" || this.tag == "btnTorch"|| this.tag == "btnZoom"))
             * {
             *  this.show = false;
             * }
             * else if (this.tag == "btnRation" || this.tag == "btnTorch" || this.tag == "btnZoom")
             * {
             *  this.show = true;
             * }
             */
            string timeOfDay = "none";

            //iddo
            if (this.tag == "btnZoom")
            {
                //int timeofday = gv.mod.WorldTime % (24 * 60);
                //int hour = timeofday / 60;
                //int minute = timeofday % 60;
                //string sMinute = minute + "";
                //if (minute < 10)
                //{
                //sMinute = "0" + minute;
                //}

                int dawn    = 5 * 60;
                int sunrise = 6 * 60;
                int day     = 7 * 60;
                int sunset  = 17 * 60;
                int dusk    = 18 * 60;
                int night   = 20 * 60;
                int time    = gv.mod.WorldTime % 1440;

                //bool consumeLightEnergy = false;
                if ((time >= dawn) && (time < sunrise))
                {
                    timeOfDay = "dawnButton";
                    //gv.DrawBitmap(gv.cc.tint_dawn, src, dst, 0, false, 1.0f / flickerReduction * flicker / 100f);
                    //gv.DrawBitmap(gv.cc.tint_dawn, src, dst, 0, false, 1.0f);
                }
                else if ((time >= sunrise) && (time < day))
                {
                    timeOfDay = "sunriseButton";
                    //gv.DrawBitmap(gv.cc.tint_sunrise, src, dst, 0, false, 1.0f);
                }
                else if ((time >= day) && (time < sunset))
                {
                    timeOfDay = "dayButton";
                    //no tint for day
                }
                else if ((time >= sunset) && (time < dusk))
                {
                    timeOfDay = "sunsetButton";
                    //gv.DrawBitmap(gv.cc.tint_sunset, src, dst, 0, false, 1.0f);
                }
                else if ((time >= dusk) && (time < night))
                {
                    timeOfDay = "duskButton";
                    //gv.DrawBitmap(gv.cc.tint_dusk, src, dst, 0, false, 1.0f);
                }
                else if ((time >= night) || (time < dawn))
                {
                    timeOfDay = "nightButton";
                    //berlin
                    //consumeLightEnergy = true;
                }
                this.ImgFilename = timeOfDay;
                ImgFilename      = timeOfDay;
                ImgOnFilename    = timeOfDay;
                Img2Filename     = timeOfDay;
                Img2OffFilename  = timeOfDay;
                Img3Filename     = timeOfDay;
                ImgOffFilename   = timeOfDay;
            }


            if (show)
            {
                float xMod            = (gv.screenWidth / 1920f);
                float yMod            = (gv.screenHeight / 1080f);
                float adustXForArrows = 0f;

                if (this.tag != "btnToggleArrows")
                {
                    xMod            = gv.screenDensity;
                    yMod            = gv.screenDensity;
                    adustXForArrows = 0;
                }

                if (this.tag == "ctrlUpArrow" || this.tag == "ctrlDownArrow" || this.tag == "ctrlLeftArrow" || this.tag == "ctrlRightArrow" || this.tag == "btnWait")
                {
                    xMod = (gv.screenWidth / 1920f);
                }

                int   pH    = (int)((float)gv.screenHeight / 200.0f);
                int   pW    = (int)((float)gv.screenHeight / 200.0f);
                float fSize = (float)(gv.squareSize / 4) * scaler;
                //int Width = gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Width;
                //int Height = gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Height;

                IbRect src = new IbRect(0, 0, Width, Height);
                //IbRect dst = new IbRect((int)((parentPanel.currentLocX + this.X) * gv.screenDensity), (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                IbRect dst = new IbRect((int)((parentPanel.currentLocX + this.X + adustXForArrows) * xMod), (int)((parentPanel.currentLocY + this.Y) * yMod), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                if (this.tag == "ctrlUpArrow" || this.tag == "ctrlDownArrow" || this.tag == "ctrlLeftArrow" || this.tag == "ctrlRightArrow" || this.tag == "btnWait")
                {
                    dst = new IbRect((int)((this.X + adustXForArrows) * gv.screenDensity + (parentPanel.currentLocX * xMod)), (int)((parentPanel.currentLocY + this.Y) * yMod), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                }

                IbRect srcGlow = new IbRect(0, 0, Width, Height);
                IbRect dstGlow = new IbRect((int)((parentPanel.currentLocX + this.X + adustXForArrows) * xMod) - (int)(7 * xMod),
                                            (int)((parentPanel.currentLocY + this.Y) * yMod) - (int)(7 * yMod),
                                            (int)((float)Width * gv.screenDensity) + (int)(15 * gv.screenDensity),
                                            (int)((float)Height * gv.screenDensity) + (int)(15 * gv.screenDensity));
                if (this.tag == "ctrlUpArrow" || this.tag == "ctrlDownArrow" || this.tag == "ctrlLeftArrow" || this.tag == "ctrlRightArrow" || this.tag == "btnWait")
                {
                    dstGlow = new IbRect((int)((this.X + adustXForArrows) * gv.screenDensity + parentPanel.currentLocX * xMod) - (int)(7 * xMod),
                                         (int)((parentPanel.currentLocY + this.Y) * yMod) - (int)(7 * yMod),
                                         (int)((float)Width * gv.screenDensity) + (int)(15 * gv.screenDensity),
                                         (int)((float)Height * gv.screenDensity) + (int)(15 * gv.screenDensity));
                }

                //draw glow first if on
                if (glowOn)
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(GlowFilename), srcGlow, dstGlow, -0.01f, false, 1.0f, true);
                    //   gv.DrawBitmap(gv.cc.GetFromBitmapList("tgl_bg"), src2, dst2, -0.01f, false, 0.75f, true);
                }

                //draw the proper button State
                if (btnState == buttonState.On)
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgOnFilename), src, dst, -0.01f, false, 1.0f, true);
                }
                else if (btnState == buttonState.Off)
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgOffFilename), src, dst, -0.01f, false, 1.0f, true);
                }
                else
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgFilename), src, dst, -0.01f, false, 1.0f, true);
                }
                //draw the standard overlay image if has one
                if ((btnState == buttonState.Off) && (!Img2OffFilename.Equals("")))
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(Img2OffFilename), src, dst, -0.01f, false, 1.0f, true);
                }
                else if (!Img2Filename.Equals(""))
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(Img2Filename), src, dst, -0.01f, false, 1.0f, true);
                }
                //draw the notification image if turned on (like a level up or additional convo nodes image)
                if ((btnNotificationOn) && (!Img3Filename.Equals("")))
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(Img3Filename), src, dst, -0.01f, false, 1.0f, true);
                }

                float thisFontHeight = gv.drawFontRegHeight;
                if (scaler > 1.05f)
                {
                    thisFontHeight = gv.drawFontLargeHeight;
                }
                else if (scaler < 0.95f)
                {
                    thisFontHeight = gv.drawFontSmallHeight;
                }

                // DRAW TEXT



                float stringSize = gv.cc.MeasureString(Text, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                //place in the center
                float ulX = ((Width * xMod) - stringSize) / 2;
                if (this.tag == "btnWait")
                {
                    ulX = ((Width * gv.screenDensity) - stringSize) / 2;
                }
                float ulY = ((Height * yMod) - thisFontHeight) / 2;

                if (scaler == 0.4f)
                {
                    ulY = ((Height * gv.screenDensity));
                }

                if (this.tag == "btnZoom")
                {
                    int    timeofday = gv.mod.WorldTime % (24 * 60);
                    int    hour      = timeofday / 60;
                    int    minute    = timeofday % 60;
                    string sMinute   = minute + "";
                    if (minute < 10)
                    {
                        sMinute = "0" + minute;
                    }

                    int txtH = (int)gv.drawFontRegHeight;
                    //Text = hour + ":" + sMinute;
                    Text = "";
                }

                if (this.tag == "btnTorch")
                {
                    int numberOfLightSources = 0;
                    foreach (ItemRefs ir in gv.mod.partyInventoryRefsList)
                    {
                        if (ir.isLightSource)
                        {
                            numberOfLightSources += ir.quantity;
                        }
                    }

                    Text = numberOfLightSources.ToString();
                }


                int xLoc1 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                if (this.tag == "btnWait")
                {
                    xLoc1 = (int)((this.X) * gv.screenDensity + parentPanel.currentLocX * xMod + ulX);
                }
                int yLoc1 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY);
                if (Text.Contains("green") && Text.Contains("Ld"))
                {
                    int    length = Text.Length;
                    string text2  = "";
                    //Ld 13green:10
                    //ld 7green:9
                    if (length == 10)
                    {
                        text2 = Text.Remove(5);
                    }
                    if (length == 9)
                    {
                        text2 = Text.Remove(4);
                    }
                    // DRAW TEXT
                    stringSize = gv.cc.MeasureString(text2, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                    //place in the center
                    ulX = ((Width * xMod) - stringSize) / 2;
                    ulY = ((Height * yMod) - thisFontHeight) / 2;

                    if (scaler == 0.4f)
                    {
                        ulY = ((Height * gv.screenDensity));
                    }
                    xLoc1 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                    yLoc1 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY);
                    gv.DrawTextOutlined(text2, xLoc1, yLoc1, scaler, Color.Lime);
                }
                else
                {
                    gv.DrawTextOutlined(Text, xLoc1, yLoc1, scaler, Color.White);
                }

                // DRAW QUANTITY
                stringSize = gv.cc.MeasureString(Quantity, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                //place in the bottom right quadrant
                ulX = (((Width * xMod) - stringSize) / 8) * 7;
                ulY = (((Height * yMod) - thisFontHeight) / 8) * 7;
                if (this.tag == "btnZoom")
                {
                    //Quantity = gv.mod.timePerStepAfterSpeedCalc + " min";
                    int    timeofday = gv.mod.WorldTime % (24 * 60);
                    int    hour      = timeofday / 60;
                    int    minute    = timeofday % 60;
                    string sMinute   = minute + "";
                    if (minute < 10)
                    {
                        sMinute = "0" + minute;
                    }

                    int txtH = (int)gv.drawFontRegHeight;
                    //Text = hour + ":" + sMinute;
                    Quantity = hour + ":" + sMinute + "  ";
                }
                if (this.tag == "btnTorch")
                {
                    Quantity = gv.mod.currentLightUnitsLeft.ToString();
                }
                if (this.tag == "btnRation")
                {
                    Quantity = gv.mod.numberOfRationsRemaining.ToString();
                }

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      if (x != 0 || y != 0)
                 *      {
                 *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX + x);
                 *          int yLoc = 0;
                 *          if (this.tag == "btnZoom")
                 *          {
                 *              xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX + x - 3 * pW);
                 *              yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY + y) - pW;
                 *          }
                 *          else
                 *          {
                 *              yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY + y);
                 *          }
                 *          //int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY + y);
                 *          gv.DrawText(Quantity, xLoc, yLoc, scaler, Color.Black);
                 *      }
                 *      }
                 * }
                 */
                int xLoc2 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                int yLoc2 = 0;
                if (this.tag == "btnZoom")
                {
                    xLoc2 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX - 3 * pW);
                    yLoc2 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY) - pW;
                }
                else
                {
                    yLoc2 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY);
                }
                //int yLoc2 = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY);
                if (this.tag == "btnTorch" && gv.mod.partyLightOn)
                {
                    int dawn    = 5 * 60;
                    int sunrise = 6 * 60;
                    int day     = 7 * 60;
                    int sunset  = 17 * 60;
                    int dusk    = 18 * 60;
                    int night   = 20 * 60;
                    int time    = gv.mod.WorldTime % 1440;

                    bool consumeLightEnergy = false;
                    if ((time >= dawn) && (time < sunrise))
                    {
                        //gv.DrawBitmap(gv.cc.tint_dawn, src, dst, 0, false, 1.0f / flickerReduction * flicker / 100f);
                        //gv.DrawBitmap(gv.cc.tint_dawn, src, dst, 0, false, 1.0f);
                    }
                    else if ((time >= sunrise) && (time < day))
                    {
                        //gv.DrawBitmap(gv.cc.tint_sunrise, src, dst, 0, false, 1.0f);
                    }
                    else if ((time >= day) && (time < sunset))
                    {
                        //no tint for day
                    }
                    else if ((time >= sunset) && (time < dusk))
                    {
                        //gv.DrawBitmap(gv.cc.tint_sunset, src, dst, 0, false, 1.0f);
                    }
                    else if ((time >= dusk) && (time < night))
                    {
                        //gv.DrawBitmap(gv.cc.tint_dusk, src, dst, 0, false, 1.0f);
                    }
                    else if ((time >= night) || (time < dawn))
                    {
                        //berlin
                        consumeLightEnergy = true;
                    }

                    if (!gv.mod.currentArea.UseDayNightCycle)
                    {
                        consumeLightEnergy = true;
                    }

                    if (!gv.mod.currentArea.useLightSystem)
                    {
                        consumeLightEnergy = false;
                    }

                    if (gv.mod.currentArea.useSimpleDarkness)
                    {
                        consumeLightEnergy = true;
                    }
                    if (consumeLightEnergy)
                    {
                        gv.DrawTextOutlined(Quantity, xLoc2, yLoc2, scaler, Color.Yellow);
                    }
                    else
                    {
                        gv.DrawTextOutlined(Quantity, xLoc2, yLoc2, scaler, Color.White);
                    }
                }
                else
                {
                    gv.DrawTextOutlined(Quantity, xLoc2, yLoc2, scaler, Color.White);
                }

                // DRAW HOTKEY
                if (gv.showHotKeys)
                {
                    stringSize = gv.cc.MeasureString(HotKey, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                    //place in the bottom center
                    ulX = ((Width * xMod) - stringSize) / 2;
                    ulY = (((Height * yMod) - thisFontHeight) / 4) * 3;

                    /*
                     * for (int x = -1; x <= 1; x++)
                     * {
                     *  for (int y = -1; y <= 1; y++)
                     *  {
                     *      if (x != 0 || y != 0)
                     *      {
                     *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX + x);
                     *          int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY + y);
                     *          gv.DrawText(HotKey, xLoc, yLoc, scaler, Color.Black);
                     *      }
                     *  }
                     * }
                     */
                    int xLoc3 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                    int yLoc3 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY);
                    gv.DrawTextOutlined(HotKey, xLoc3, yLoc3, scaler, Color.Red);
                }
            }
        }
Example #2
0
        public void Draw()
        {
            int   pH    = (int)((float)gv.screenHeight / 200.0f);
            int   pW    = (int)((float)gv.screenHeight / 200.0f);
            float fSize = (float)(gv.squareSize / 4) * scaler;

            IbRect src     = new IbRect(0, 0, this.ImgBG.PixelSize.Width, this.ImgBG.PixelSize.Height);
            IbRect src2    = new IbRect(0, 0, 0, 0);
            IbRect src3    = new IbRect(0, 0, 0, 0);
            IbRect src4    = new IbRect(0, 0, 0, 0);
            IbRect dstLU   = new IbRect(0, 0, 0, 0);
            IbRect dstChat = new IbRect(0, 0, 0, 0);

            if (this.Img != null)
            {
                src2 = new IbRect(0, 0, this.Img.PixelSize.Width, this.Img.PixelSize.Height);
            }
            if (this.ImgLU != null)
            {
                src3 = new IbRect(0, 0, this.ImgLU.PixelSize.Width, this.ImgLU.PixelSize.Height);
            }
            if (this.ImgChat != null)
            {
                src4 = new IbRect(0, 0, this.ImgChat.PixelSize.Width, this.ImgChat.PixelSize.Height);
            }
            IbRect dstBG = new IbRect(this.X - (int)(3 * gv.screenDensity),
                                      this.Y - (int)(3 * gv.screenDensity),
                                      (int)((float)this.Width) + (int)(6 * gv.screenDensity),
                                      (int)((float)this.Height) + (int)(6 * gv.screenDensity));
            IbRect dst = new IbRect(this.X, this.Y, (int)((float)this.Width), (int)((float)this.Height));

            if (this.ImgLU != null)
            {
                dstLU = new IbRect(this.X, this.Y, this.ImgLU.PixelSize.Width, this.ImgLU.PixelSize.Height);
            }
            if (this.ImgChat != null)
            {
                dstChat = new IbRect(this.X, this.Y, this.ImgChat.PixelSize.Width, this.ImgChat.PixelSize.Height);
            }
            IbRect srcGlow = new IbRect(0, 0, this.Glow.PixelSize.Width, this.Glow.PixelSize.Height);
            IbRect dstGlow = new IbRect(this.X - (int)(7 * gv.screenDensity),
                                        this.Y - (int)(7 * gv.screenDensity),
                                        (int)((float)this.Width) + (int)(15 * gv.screenDensity),
                                        (int)((float)this.Height) + (int)(15 * gv.screenDensity));

            gv.DrawBitmap(this.ImgBG, src, dstBG);

            if ((this.glowOn) && (this.Glow != null))
            {
                gv.DrawBitmap(this.Glow, srcGlow, dstGlow);
            }

            if (this.Img != null)
            {
                gv.DrawBitmap(this.Img, src2, dst);
            }

            if (this.ImgLU != null)
            {
                if (levelUpOn)
                {
                    gv.DrawBitmap(this.ImgLU, src3, dstLU);
                }
            }

            if (this.ImgChat != null)
            {
                if (newChatOptionOn)
                {
                    //kvbkoeln
                    gv.DrawBitmap(this.ImgChat, src4, dstChat);
                }
            }

            if (gv.mod.useUIBackground)
            {
                IbRect srcFrame = new IbRect(0, 0, gv.cc.ui_portrait_frame.PixelSize.Width, gv.cc.ui_portrait_frame.PixelSize.Height);
                IbRect dstFrame = new IbRect(this.X - (int)(5 * gv.screenDensity),
                                             this.Y - (int)(5 * gv.screenDensity),
                                             (int)((float)this.Width) + (int)(10 * gv.screenDensity),
                                             (int)((float)this.Height) + (int)(10 * gv.screenDensity));
                gv.DrawBitmap(gv.cc.ui_portrait_frame, srcFrame, dstFrame);
            }

            float thisFontHeight = gv.drawFontRegHeight;

            if (scaler > 1.05f)
            {
                thisFontHeight = gv.drawFontLargeHeight;
            }
            else if (scaler < 0.95f)
            {
                thisFontHeight = gv.drawFontSmallHeight;
            }

            //DRAW HP/HPmax
            // Measure string.
            //SizeF stringSize = gv.cc.MeasureString(TextHP, thisFont, this.Width);
            //float stringSize = gv.cc.MeasureString(TextHP, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

            //int ulX = ((int)(this.Width) / 2) - ((int)stringSize / 2);
            //int ulY = ((int)(this.Height / 2) / 2) + ((int)thisFontHeight / 2);
            int ulX = pW * 0;
            int ulY = this.Height - ((int)thisFontHeight * 2);

            /*
             * for (int x = -1; x <= 1; x++)
             * {
             *  for (int y = -1; y <= 1; y++)
             *  {
             *      gv.DrawText(TextHP, this.X + ulX + x, this.Y + ulY - pH + y , scaler, Color.Black);
             *  }
             * }
             */
            gv.DrawTextOutlined(TextHP, this.X + ulX, this.Y + ulY - pH, scaler, Color.Lime);

            //DRAW SP/SPmax
            // Measure string.
            //stringSize = gv.cc.MeasureString(TextSP, thisFont, this.Width);
            //stringSize = gv.cc.MeasureString(TextSP, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

            //ulX = ((int)(this.Width / 2)) - ((int)stringSize);
            //ulY = ((int)(this.Height / 2));
            ulX = pW * 1;
            ulY = this.Height - ((int)thisFontHeight * 1);

            /*
             * for (int x = -1; x <= 1; x++)
             * {
             *  for (int y = -1; y <= 1; y++)
             *  {
             *      gv.DrawText(TextSP, this.X + ulX - pW + x, this.Y + ulY - pH + y, scaler, Color.Black);
             *  }
             * }
             */
            gv.DrawTextOutlined(TextSP, this.X + ulX - pW, this.Y + ulY - pH, scaler, Color.Yellow);
        }
Example #3
0
        public void DrawLogBackground()
        {
            //if (gv.screenType.Equals("main") )
            //{
            //IbRect src = new IbRect(0, 0, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Width, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Height);
            //IbRect dst = new IbRect((int)(currentLocX * gv.screenDensity), (int)(currentLocY * gv.screenDensity - 3 * gv.pS), (int)(Width * gv.screenDensity + 2 * gv.pS), (int)(Height * gv.screenDensity - gv.squareSize + 7 * gv.pS));
            //gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.8f * gv.mod.logOpacity);
            //}
            //else
            //{
            if (gv.mod.logOpacity > 0)
            {
                IbRect src = new IbRect(0, 0, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Width, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Height);
                IbRect dst = new IbRect((int)(currentLocX * gv.screenDensity + gv.oXshift - 2.5 * gv.pS), (int)(currentLocY * gv.screenDensity) - 3 * gv.pS, (int)(Width * gv.screenDensity + 6.5 * gv.pS), (int)(Height * gv.screenDensity - 1 * gv.squareSize + 12 * gv.pS - 0 * gv.pS));

                if (gv.mod.useComplexCoordinateSystem && gv.screenType != "combat")
                {
                    dst = new IbRect((int)(currentLocX * gv.screenDensity + gv.oXshift - 2.5 * gv.pS), (int)(currentLocY * gv.screenDensity) + 5 * gv.pS, (int)(Width * gv.screenDensity + 6.5 * gv.pS), (int)(Height * gv.screenDensity - 1 * gv.squareSize + 12 * gv.pS - 2 * gv.pS));
                }
                if (gv.cc.floatyTextActorInfoName != "")
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 1f * gv.mod.logOpacity, true);
                }
                else
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.575f * gv.mod.logOpacity, true);
                }
                //}
                int txtH = (int)gv.drawFontRegHeight;
                gv.cc.floatyTextLocInfo.X = gv.squareSize / 2;
                gv.cc.floatyTextLocInfo.Y = gv.squareSize * 1;
                bool isPlayer = false;
                foreach (Player p in gv.mod.playerList)
                {
                    if (p.name == gv.cc.floatyTextActorInfoName)
                    {
                        isPlayer = true;
                        break;
                    }
                }
                bool isCreature = false;
                foreach (Creature c in gv.mod.currentEncounter.encounterCreatureList)
                {
                    if (c.cr_name == gv.cc.floatyTextActorInfoName)
                    {
                        isCreature = true;
                        break;
                    }
                }
                bool isTrigger = false;
                if (gv.cc.floatyTextActorInfoName == "Trigger Square")
                {
                    isTrigger = true;
                }

                bool isEffect = false;
                if (gv.cc.floatyTextActorInfoName == "Lingering Effect")
                {
                    isEffect = true;
                }

                //isTrigger, Trigger Square

                if (gv.cc.drawInfoText && gv.screenCombat.isPlayerTurn)
                {
                    if (isPlayer)
                    {
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 3 * txtH, 0.9f, Color.Lime);
                        if (!gv.cc.inEffectMode)
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAC, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoMoveOrder, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoInitiative, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoHP, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSP, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoNumberOfAttacks, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoToHit, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAmmo, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAttackType, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 10 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAttackRange, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 10 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamage, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                            if (gv.cc.floatyTextActorInfoDamageType == "Normal")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Poison")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.LimeGreen);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Magic")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.Gold);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Fire")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.OrangeRed);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Cold")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.CornflowerBlue);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Acid")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.Purple);
                            }
                            if (gv.cc.floatyTextActorInfoDamageType == "Electricity")
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.Turquoise);
                            }

                            //gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoWeaponTags, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnScoringHitSpellName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 16 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves2, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 16 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves3, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 16 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances2, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.Gold);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances3, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.LimeGreen);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances4, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 19 * txtH, 0.9f, Color.OrangeRed);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances5, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 19 * txtH, 0.9f, Color.CornflowerBlue);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances6, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 20 * txtH, 0.9f, Color.Purple);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances7, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 20 * txtH, 0.9f, Color.Turquoise);

                            gv.DrawTextOutlined("Press RMB to show current", gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 26 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined("temporary effects", gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 27 * txtH, 0.9f, Color.White);


                            //gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnScoringHitSpellNameSelf, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 1.0f, Color.White);
                        }
                    }
                    //this draw creature info
                    else if (isCreature)
                    {
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 3 * txtH, 0.9f, Color.Red);
                        if (!gv.cc.inEffectMode)
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAC, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 4 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoMoveOrder, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 4 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoInitiative, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 4 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoHP, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSP, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);

                            //cut here if trait != noen and roll failed
                            // unveilStatInfoTraitDC
                            bool   showStats = false;
                            string traitName = "none";
                            int    traitDC   = 0;

                            foreach (Creature c in gv.mod.currentEncounter.encounterCreatureList)
                            {
                                if (c.cr_name == gv.cc.floatyTextActorInfoName)
                                {
                                    if (c.unveilStatInfoTraitTag == "none" || c.unveilStatInfoTraitTag == "None" || c.unveilStatInfoTraitTag == "" || c.unveilStatInfoTraitTag == null)
                                    {
                                        showStats = true;
                                    }
                                    else
                                    {
                                        traitName = c.unveilStatInfoTraitTag;
                                        traitDC   = c.unveilStatInfoTraitDC;
                                        if (gv.sf.CheckPassSkill(-2, c.unveilStatInfoTraitTag, c.unveilStatInfoTraitDC, true, true))
                                        {
                                            showStats = true;
                                        }
                                    }
                                }
                            }
                            if (showStats)
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoNumberOfAttacks, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoToHit, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAmmo, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAttackType, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAttackRange, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamage, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);

                                //todo color coding
                                if (gv.cc.floatyTextActorInfoDamageType == "Normal")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Poison")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.LimeGreen);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Magic")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.Gold);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Fire")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.OrangeRed);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Cold")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.CornflowerBlue);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Acid")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.Purple);
                                }
                                if (gv.cc.floatyTextActorInfoDamageType == "Electricity")
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.Turquoise);
                                }



                                //gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDamageType, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnScoringHitSpellName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 10 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves2, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSaves3, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances2, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.Gold);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances3, gv.cc.floatyTextLocInfo.X + 2.7f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.LimeGreen);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances4, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.OrangeRed);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances5, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.CornflowerBlue);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances6, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 15 * txtH, 0.9f, Color.Purple);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoResistances7, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 15 * txtH, 0.9f, Color.Turquoise);
                                //17

                                /*
                                 * public bool showType = true;
                                 * public bool showHitBy = true;
                                 * public bool showRegen = true;
                                 * public bool showDeathScript = true;
                                 * public bool showAI = true;
                                 * public bool showSpells = true;
                                 */


                                if (gv.mod.showType)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoCreatureTags, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 17 * txtH, 0.9f, Color.White);
                                }
                                if (gv.mod.showHitBy)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoHitBy, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.White);
                                }
                                if (gv.mod.showRegen)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRegenerationHP, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 19 * txtH, 0.9f, Color.White);
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRegenerationSP, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 19 * txtH, 0.9f, Color.White);
                                }
                                if (gv.mod.showDeathScript)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnDeathScriptName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 20 * txtH, 0.9f, Color.White);
                                }
                                if (gv.mod.showAI)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAIType, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 21 * txtH, 0.9f, Color.White);
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAIAffinityForCasting, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 22 * txtH, 0.9f, Color.White);
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoInjuryThreshold, gv.cc.floatyTextLocInfo.X + 1.5f * gv.squareSize, gv.cc.floatyTextLocInfo.Y + 22 * txtH, 0.9f, Color.White);
                                }
                                if (gv.mod.showSpells)
                                {
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellsKnown1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 23 * txtH, 0.9f, Color.White);
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellsKnown2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 24 * txtH, 0.9f, Color.White);
                                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellsKnown3, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 25 * txtH, 0.9f, Color.White);
                                }

                                ///gv.cc.floatyTextActorInfoRegenerationHP = "";
                                ///gv.cc.floatyTextActorInfoRegenerationSP = "";
                                //gv.cc.floatyTextActorInfoSpellsKnown1 = "";
                                //gv.cc.floatyTextActorInfoSpellsKnown2 = "";
                                //gv.cc.floatyTextActorInfoSpellsKnown3 = "";
                                //gv.cc.floatyTextActorInfoAIType = "";
                                //gv.cc.floatyTextActorInfoAIAffinityForCasting = "";//0 to 100
                                ///gv.cc.floatyTextActorInfoCreatureTags = "";//used for immunities, special weaknesses, eg "undead" are affected by turn spells and immunne to paralyze...
                                ///gv.cc.floatyTextActorInfoOnDeathScriptName = "";

                                //25
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRMB1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 26 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRMB2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 27 * txtH, 0.9f, Color.White);
                            }
                            //show stats was false
                            else
                            {
                                //draw info for checked trait and required dc
                                gv.DrawTextOutlined(traitName + " too low (best in party)", gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined("At least skill level " + traitDC + " required", gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRMB1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 26 * txtH, 0.9f, Color.White);
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoRMB2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 27 * txtH, 0.9f, Color.White);
                            }
                        }
                    }

                    else if (isTrigger)
                    {
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 3 * txtH, 0.9f, Color.Yellow);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoText, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);

                        if (gv.cc.floatyTextActorInfoEnabledState.Contains("Enabled"))
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoEnabledState, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.Lime);
                        }
                        else
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoEnabledState, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.Red);
                        }
                        if (gv.cc.floatyTextActorInfoEnableTrait != "none" && gv.cc.floatyTextActorInfoEnableTrait != "None" && gv.cc.floatyTextActorInfoEnableTrait != "" && gv.cc.floatyTextActorInfoEnableTrait != null)
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoEnableTrait, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoEnableDC, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                        }
                        else if (gv.cc.floatyTextActorInfoDisableTrait != "none" && gv.cc.floatyTextActorInfoDisableTrait != "None" && gv.cc.floatyTextActorInfoDisableTrait != "" && gv.cc.floatyTextActorInfoDisableTrait != null)
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDisableTrait, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoDisableDC, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                        }

                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoWorksFor, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 10 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoCharges, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 11 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoEveryStep, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);

                        if (gv.cc.floatyTextActorInfoVanishInXTurns != "" && gv.cc.floatyTextActorInfoVanishInXTurns != "none" && gv.cc.floatyTextActorInfoVanishInXTurns != "None")
                        {
                            if (gv.cc.floatyTextActorInfoVanishInXTurns.Contains("Vanishes in") || gv.cc.floatyTextActorInfoVanishInXTurns.Contains("Vanishes on"))
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoVanishInXTurns, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.Yellow);
                            }
                            else
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoVanishInXTurns, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.White);
                            }
                        }
                        else
                        {
                            if (gv.cc.floatyTextActorInfoAppearInXTurns.Contains("Enabled in") || gv.cc.floatyTextActorInfoAppearInXTurns.Contains("Enabled on"))
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAppearInXTurns, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.Yellow);
                            }
                            else
                            {
                                gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAppearInXTurns, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.White);
                            }
                            //gv.DrawTextOutlined(gv.cc.floatyTextActorInfoAppearInXTurns, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                        }
                        if (gv.cc.floatyTextActorInfoChangeWalkableState.Contains("Affects walkable"))
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoChangeWalkableState, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.Yellow);
                        }
                        else
                        {
                            gv.DrawTextOutlined(gv.cc.floatyTextActorInfoChangeWalkableState, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.White);
                        }


                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 16 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyWhileOnSquare, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 17 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyCasterLevel, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellName2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 20 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyWhileOnSquare2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 21 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyCasterLevel2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 22 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoSpellName3, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 24 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyWhileOnSquare3, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 25 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoOnlyCasterLevel3, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 26 * txtH, 0.9f, Color.White);
                    }
                    else if (isEffect)
                    {
                        //todo
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoName, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 3 * txtH, 0.9f, Color.Yellow);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoText, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);

                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoLingeringEffectRemainingDuration, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoLingeringEffectPower, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                        gv.DrawTextOutlined(gv.cc.floatyTextActorInfoLingeringEffectPersistence, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);

                        //gv.cc.floatyTextActorInfoLingeringEffectRemainingDuration = "Duration: " + ef.durationOnSquareInUnits + "round(s)";
                        //gv.cc.floatyTextActorInfoLingeringEffectPersistence = "Persistence: " + ef.onSquarePersistenceBonus;
                        //gv.cc.floatyTextActorInfoLingeringEffectPower = "Power: " + ef.classLevelOfSender;
                    }

                    /*
                     * public string floatyTextActorInfoText = "";
                     * public string floatyTextActorInfoWorksFor = "";
                     * public string floatyTextActorInfoCharges = "";
                     * public string floatyTextActorInfoEveryStep = "";
                     * public string floatyTextActorInfoSpellName = "";//get via tag
                     * public string floatyTextActorInfoOnlyWhileOnSquare = "";
                     * public string floatyTextActorInfoOnlyCasterLevel = "";
                     * public string floatyTextActorInfoSpellName2 = "";//get via tag
                     * public string floatyTextActorInfoOnlyWhileOnSquare2 = "";
                     * public string floatyTextActorInfoOnlyCasterLevel2 = "";
                     * public string floatyTextActorInfoSpellName3 = "";//get via tag
                     * public string floatyTextActorInfoOnlyWhileOnSquare3 = "";
                     * public string floatyTextActorInfoOnlyCasterLevel3 = "";
                     */


                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects1, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 4 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects2, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 6 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects3, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 8 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects4, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 10 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects5, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 12 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects6, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 14 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects7, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 16 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects8, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 18 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects9, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 20 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects10, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 22 * txtH, 0.9f, Color.White);

                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects1custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 5 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects2custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 7 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects3custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 9 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects4custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 11 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects5custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 13 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects6custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 15 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects7custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 17 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects8custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 19 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects9custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 21 * txtH, 0.9f, Color.White);
                    gv.DrawTextOutlined(gv.cc.floatyTextActorInfoTempEffects10custom, gv.cc.floatyTextLocInfo.X, gv.cc.floatyTextLocInfo.Y + 23 * txtH, 0.9f, Color.White);
                }



                foreach (IB2HtmlLogBox log in logList)
                {
                    if (gv.cc.floatyTextActorInfoName == "")
                    {
                        log.onDrawLogBox(this);
                    }
                }
            }

            //foreach (IB2ToggleButton btn in toggleList)
            //{
            //btn.Draw(this);
            //}

            /*
             * src = new IbRect(0, 0, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Width, gv.cc.GetFromBitmapList(backgroundImageFilename).PixelSize.Height);
             * dst = new IbRect(gv.pS, (int)((gv.playerOffsetY*2+1 -2) * gv.squareSize + 2*gv.pS), (int)(5 * gv.squareSize), (int)(1 * gv.squareSize - 2*gv.pS ));
             * gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);
             */

            /*
             * //iterate over all controls and draw
             * foreach (IB2Button btn in buttonList)
             * {
             *  btn.Draw(this);
             * }
             * foreach (IB2ToggleButton btn in toggleList)
             * {
             *  btn.Draw(this);
             * }
             * foreach (IB2Portrait btn in portraitList)
             * {
             *  btn.Draw(this);
             * }
             */
        }
Example #4
0
        public void Draw()
        {
            int   pH    = (int)((float)gv.screenHeight / 200.0f);
            int   pW    = (int)((float)gv.screenHeight / 200.0f);
            float fSize = (float)(gv.squareSize / 4) * scaler;

            IbRect src  = new IbRect(0, 0, this.Img.PixelSize.Width, this.Img.PixelSize.Height);
            IbRect src2 = new IbRect(0, 0, this.Img.PixelSize.Width, this.Img.PixelSize.Height);
            IbRect src3 = new IbRect(0, 0, this.Img.PixelSize.Width, this.Img.PixelSize.Height);

            if (this.Img2 != null)
            {
                src2 = new IbRect(0, 0, this.Img2.PixelSize.Width, this.Img2.PixelSize.Width);
            }
            if (this.Img3 != null)
            {
                src3 = new IbRect(0, 0, this.Img3.PixelSize.Width, this.Img3.PixelSize.Width);
            }

            IbRect dst     = new IbRect(this.X, this.Y, (int)((float)this.Img.PixelSize.Width * gv.screenDensity), (int)((float)this.Img.PixelSize.Height * gv.screenDensity));
            IbRect srcGlow = new IbRect(0, 0, this.Glow.PixelSize.Width, this.Glow.PixelSize.Height);
            IbRect dstGlow = new IbRect(this.X - (int)(7 * gv.screenDensity),
                                        this.Y - (int)(7 * gv.screenDensity),
                                        (int)((float)this.Width) + (int)(15 * gv.screenDensity),
                                        (int)((float)this.Height) + (int)(15 * gv.screenDensity));

            //draw glow first if on
            if ((this.glowOn) && (this.Glow != null))
            {
                gv.DrawBitmap(this.Glow, srcGlow, dstGlow, true);
            }
            //draw the proper button State
            if ((this.btnState == buttonState.On) && (this.ImgOn != null))
            {
                gv.DrawBitmap(this.ImgOn, src, dst, true);
            }
            else if ((this.btnState == buttonState.Off) && (this.ImgOff != null))
            {
                gv.DrawBitmap(this.ImgOff, src, dst, true);
            }
            else
            {
                gv.DrawBitmap(this.Img, src, dst, true);
            }
            //draw the standard overlay image if has one
            if ((this.btnState == buttonState.Off) && (this.Img2Off != null))
            {
                gv.DrawBitmap(this.Img2Off, src2, dst, true);
            }
            else if (this.Img2 != null)
            {
                gv.DrawBitmap(this.Img2, src2, dst, true);
            }
            //draw the notification image if turned on (like a level up or additional convo nodes image)
            if ((this.btnNotificationOn) && (this.Img3 != null))
            {
                dst.Left += this.Image3XOffSet;
                dst.Top  += this.Image3YOffSet;
                gv.DrawBitmap(this.Img3, src3, dst, true);
            }

            float thisFontHeight = gv.drawFontRegHeight;

            if (scaler > 1.05f)
            {
                thisFontHeight = gv.drawFontLargeHeight;
            }
            else if (scaler < 0.95f)
            {
                thisFontHeight = gv.drawFontSmallHeight;
            }

            // DRAW TEXT
            float stringSize = gv.cc.MeasureString(Text, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

            //place in the center
            float ulX = ((this.Width) - stringSize) / 2;
            float ulY = ((this.Height) - thisFontHeight) / 2;

            /*
             * for (int x = -1; x <= 1; x++)
             * {
             *  for (int y = -1; y <= 1; y++)
             *  {
             *      gv.DrawText(Text, this.X + ulX + x, this.Y + ulY + y , scaler, Color.Black);
             *  }
             * }
             */
            if (!this.btnWithGold)
            {
                if (Text == "NA")
                {
                    gv.DrawTextOutlined(Text, this.X + ulX, this.Y + ulY, scaler, Color.Red);
                }
                else
                {
                    gv.DrawTextOutlined(Text, this.X + ulX, this.Y + ulY, scaler, Color.White);
                }
            }
            else
            {
                gv.DrawTextOutlined(Text, this.X + ulX, this.Y + ulY, scaler, Color.Gold);
            }

            // DRAW QUANTITY
            stringSize = gv.cc.MeasureString(Quantity, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

            //place in the bottom right quadrant
            ulX = (((this.Width) - stringSize) / 8) * 7;
            ulY = (((this.Height) - thisFontHeight) / 8) * 7;

            /*
             * for (int x = -1; x <= 1; x++)
             * {
             *  for (int y = -1; y <= 1; y++)
             *  {
             *      gv.DrawText(Quantity, this.X + ulX + x, this.Y + ulY + y, scaler, Color.Black);
             *  }
             * }
             */
            if (!this.btnOfChargedItem)
            {
                gv.DrawTextOutlined(Quantity, this.X + ulX, this.Y + ulY, scaler, Color.White);
            }
            else
            {
                gv.DrawTextOutlined(Quantity, this.X + ulX, this.Y + ulY, scaler, Color.Green);
            }

            // DRAW HOTKEY
            if (gv.showHotKeys)
            {
                stringSize = gv.cc.MeasureString(HotKey, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                //place in the bottom center
                ulX = ((this.Width) - stringSize) / 2;
                ulY = (((this.Height) - thisFontHeight) / 4) * 3;

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      gv.DrawText(HotKey, this.X + ulX + x, this.Y + ulY + y, scaler, Color.Black);
                 *  }
                 * }
                 */
                gv.DrawTextOutlined(HotKey, this.X + ulX, this.Y + ulY, scaler, Color.Red);
            }
        }
Example #5
0
        public void Draw(IB2Panel parentPanel)
        {
            if (show)
            {
                float thisFontHeight = gv.drawFontRegHeight;
                if (scaler > 1.05f)
                {
                    thisFontHeight = gv.drawFontLargeHeight;
                }
                else if (scaler < 0.95f)
                {
                    thisFontHeight = gv.drawFontSmallHeight;
                }

                int numberOfLinesOnPortrait = (int)((Height * gv.screenDensity) / thisFontHeight);
                int pixPerLine = (int)((Height * gv.screenDensity) / numberOfLinesOnPortrait);

                float xMod = (gv.screenWidth / 1920f);
                float yMod = (gv.screenHeight / 1080f);

                int spacing = 0;
                if (gv.screenType == "main")
                {
                    if (this.tag == "port0")
                    {
                        spacing = (int)(7f * yMod);
                    }
                    if (this.tag == "port1")
                    {
                        spacing = (int)(14f * yMod);
                    }
                    if (this.tag == "port2")
                    {
                        spacing = (int)(21f * yMod);
                    }
                    if (this.tag == "port3")
                    {
                        spacing = (int)(28f * yMod);
                    }
                    if (this.tag == "port4")
                    {
                        spacing = (int)(35f * yMod);
                    }
                    if (this.tag == "port5")
                    {
                        spacing = (int)(42f * yMod);
                    }
                }
                else if (gv.screenType == "combat")
                {
                    if (this.tag == "port0")
                    {
                        spacing = (int)(-28f * yMod);
                    }
                    if (this.tag == "port1")
                    {
                        spacing = (int)(-21f * yMod);
                    }
                    if (this.tag == "port2")
                    {
                        spacing = (int)(-14f * yMod);
                    }
                    if (this.tag == "port3")
                    {
                        spacing = (int)(-7f * yMod);
                    }
                    if (this.tag == "port4")
                    {
                        spacing = (int)(0f * yMod);
                    }
                    if (this.tag == "port5")
                    {
                        spacing = (int)(7f * yMod);
                    }
                }

                if (gv.screenType == "main")
                {
                    if (parentPanel.Height <= (6 * this.Height + 42f * yMod))
                    {
                        spacing = 0;
                    }
                }

                if (gv.screenType == "combat")
                {
                    if (parentPanel.Height <= (6 * this.Height + 7f * yMod))
                    {
                        spacing = 0;
                    }
                }


                //this.tag
                int   pH    = (int)((float)gv.screenHeight / 200.0f);
                int   pW    = (int)((float)gv.screenHeight / 200.0f);
                float fSize = (float)(gv.squareSize / 4) * scaler;
                //int Width = gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Width;
                //int Height = gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Height;

                IbRect src   = new IbRect(0, 0, gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Width, gv.cc.GetFromBitmapList(ImgFilename).PixelSize.Height);
                IbRect srcBG = new IbRect(0, 0, gv.cc.GetFromBitmapList(ImgBGFilename).PixelSize.Width, gv.cc.GetFromBitmapList(ImgBGFilename).PixelSize.Height);
                //IbRect dst = new IbRect((int)((parentPanel.currentLocX + this.X) * gv.screenDensity), (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                IbRect dst = new IbRect((int)((parentPanel.currentLocX + this.X) * xMod), (int)((parentPanel.currentLocY + this.Y) * yMod + spacing), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));

                IbRect dstBG = new IbRect((int)((parentPanel.currentLocX + this.X) * xMod) - (int)(3 * xMod),
                                          (int)((parentPanel.currentLocY + this.Y) * yMod) - (int)(3 * yMod) + spacing,
                                          (int)((float)Width * gv.screenDensity) + (int)(6 * gv.screenDensity),
                                          (int)((float)Height * gv.screenDensity) + (int)(6 * gv.screenDensity));



                IbRect srcGlow = new IbRect(0, 0, gv.cc.GetFromBitmapList(GlowFilename).PixelSize.Width, gv.cc.GetFromBitmapList(GlowFilename).PixelSize.Height);
                IbRect dstGlow = new IbRect((int)((parentPanel.currentLocX + this.X) * xMod) - (int)(7 * xMod),
                                            (int)((parentPanel.currentLocY + this.Y) * yMod) - (int)(7 * yMod) + spacing,
                                            (int)((float)Width * gv.screenDensity) + (int)(15 * gv.screenDensity),
                                            (int)((float)Height * gv.screenDensity) + (int)(15 * gv.screenDensity));

                gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgBGFilename), src, dstBG, -0.01f, false, 1.0f, true);

                if (glowOn)
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(GlowFilename), srcGlow, dstGlow, -0.01f, false, 1.0f, true);
                }

                if (!ImgFilename.Equals(""))
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgFilename), src, dst, -0.01f, false, 1.0f, true);
                }

                if (!ImgLUFilename.Equals(""))
                {
                    if (levelUpOn)
                    {
                        gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgLUFilename), src, dst, -0.01f, false, 1.0f, true);
                    }
                }

                if (gv.mod.useUIBackground)
                {
                    IbRect srcFrame = new IbRect(0, 0, gv.cc.ui_portrait_frame.PixelSize.Width, gv.cc.ui_portrait_frame.PixelSize.Height);
                    IbRect dstFrame = new IbRect((int)((parentPanel.currentLocX + this.X) * xMod) - (int)(5 * xMod),
                                                 (int)((parentPanel.currentLocY + this.Y) * yMod) - (int)(5 * yMod) + spacing,
                                                 (int)((float)Width * gv.screenDensity) + (int)(10 * gv.screenDensity),
                                                 (int)((float)Height * gv.screenDensity) + (int)(10 * gv.screenDensity));
                    gv.DrawBitmap(gv.cc.ui_portrait_frame, srcFrame, dstFrame, -0.01f, false, 1.0f, true);
                }



                //DRAW HP/HPmax
                // Measure string.
                //SizeF stringSize = gv.cc.MeasureString(TextHP, thisFont, this.Width);
                //float stringSize = gv.cc.MeasureString(TextHP, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                //int ulX = ((int)(this.Width) / 2) - ((int)stringSize / 2);
                //int ulY = ((int)(this.Height / 2) / 2) + ((int)thisFontHeight / 2);
                int ulX = pW * 0;
                int ulY = (int)(Height * yMod) - ((int)thisFontHeight * 2);

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      if (x != 0 || y != 0)
                 *      {
                 *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX + x);
                 *          int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY - pH + y);
                 *          gv.DrawText(TextHP, xLoc, yLoc, scaler, Color.Black);
                 *      }
                 *  }
                 * }
                 */
                //(int)((parentPanel.currentLocY + this.Y) * yMod + spacing)
                int xLoc1 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                int yLoc1 = (int)((parentPanel.currentLocY + this.Y) * yMod + spacing + (Height * gv.screenDensity) - pixPerLine * 2);
                gv.DrawTextOutlined(TextHP, xLoc1, yLoc1, scaler, Color.Lime);

                //DRAW SP/SPmax
                // Measure string.
                //stringSize = gv.cc.MeasureString(TextSP, thisFont, this.Width);
                //stringSize = gv.cc.MeasureString(TextSP, SharpDX.DirectWrite.FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, thisFontHeight);

                //ulX = ((int)(this.Width / 2)) - ((int)stringSize);
                //ulY = ((int)(this.Height / 2));
                ulX = pW * 1;
                ulY = (int)(Height * yMod) - ((int)thisFontHeight * 1);

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      if (x != 0 || y != 0)
                 *      {
                 *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX - pW + x);
                 *          int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY - pH + y);
                 *          gv.DrawText(TextSP, xLoc, yLoc, scaler, Color.Black);
                 *      }
                 *  }
                 * }
                 */
                int xLoc2 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX - pW);
                int yLoc2 = (int)((parentPanel.currentLocY + this.Y) * yMod + spacing + (Height * gv.screenDensity) - pixPerLine);
                gv.DrawTextOutlined(TextSP, xLoc2, yLoc2, scaler, Color.Yellow);
                //gv.DrawTextOutlined(TextSP, xLoc2, yLoc2, gv.FontWeight.Normal, scaler, Color.Yellow);
                //DrawText(text, xLoc, yLoc, FontWeight.Normal, SharpDX.DirectWrite.FontStyle.Normal, scaler, fontColor, false);
                //better reoute all to drawtext and from the to draw outlined

                //draw level up symbol
                //ulX = (int)(110 * gv.screenDensity) - pW * 9;
                //ulX = (int)(110 * xMod) - pW * 24;
                ulX = (int)(110 * 0.05f);
                ulY = (int)(Height * yMod) - ((int)thisFontHeight * 7) + pH;

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      if (x != 0 || y != 0)
                 *      {
                 *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX - pW + x);
                 *          int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY - pH + y);
                 *          gv.DrawText(levelUpSymbol, xLoc, yLoc, scaler * 1.2f, Color.Black);
                 *      }
                 *  }
                 * }
                 */
                int xLoc3 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX);
                int yLoc3 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY - pH + spacing);
                gv.DrawTextOutlined(levelUpSymbol, xLoc3, yLoc3, scaler * 1.2f, Color.CornflowerBlue);


                //draw chat symbol
                //int ulX5 = (int)(110 * xMod) - pW * 24;
                //int ulY5 = (int)(Height * gv.screenDensity) - ((int)thisFontHeight * 7) + 2*pH;
                int ulX5 = (int)(110 * 0.05f);
                int ulY5 = (int)(Height * yMod) - ((int)thisFontHeight * 6) + 3 * pH;

                /*
                 * for (int x = -1; x <= 1; x++)
                 * {
                 *  for (int y = -1; y <= 1; y++)
                 *  {
                 *      if (x != 0 || y != 0)
                 *      {
                 *          int xLoc = (int)((parentPanel.currentLocX + this.X) * gv.screenDensity + ulX5 - pW + x);
                 *          int yLoc = (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + ulY5 - pH + y);
                 *          gv.DrawText(chatSymbol, xLoc, yLoc, scaler * 0.5f, Color.Black);
                 *      }
                 *  }
                 * }
                 */
                int xLoc4 = (int)((parentPanel.currentLocX + this.X) * xMod + ulX5 - pW);
                int yLoc4 = (int)((parentPanel.currentLocY + this.Y) * yMod + ulY5 - pH + spacing);
                gv.DrawTextOutlined(chatSymbol, xLoc4, yLoc4, scaler * 0.25f, Color.Azure);

                //effects on portrait

                int effectCounter = 0;
                foreach (Effect ef in gv.mod.playerList[playerNumber].effectsList)
                {
                    if ((!ef.isPermanent) && (ef.spriteFilename != "none") && (ef.spriteFilename != "") && (ef.spriteFilename != "None"))
                    {
                        //float ggh = Width * gv.screenDensity;
                        Bitmap fx = gv.cc.LoadBitmap(ef.spriteFilename);
                        src = new IbRect(0, 0, fx.PixelSize.Width, fx.PixelSize.Width);
                        IbRect dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 2f), dst.Top, (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        effectCounter++;
                        if (effectCounter == 2)
                        {
                            dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 2f), dst.Top + (int)((Width * gv.screenDensity) / 3f * 1f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 3)
                        {
                            dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 2f), dst.Top + (int)((Width * gv.screenDensity) / 3f * 2f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 4)
                        {
                            dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 1f), dst.Top, (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 5)
                        {
                            dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 1f), dst.Top + (int)((Width * gv.screenDensity) / 3f * 1f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 6)
                        {
                            dst2 = new IbRect(dst.Left + (int)((Width * gv.screenDensity) / 3f * 1f), dst.Top + (int)((Width * gv.screenDensity) / 3f * 2f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 7)
                        {
                            dst2 = new IbRect(dst.Left, dst.Top, (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 8)
                        {
                            dst2 = new IbRect(dst.Left, dst.Top + (int)((Width * gv.screenDensity) / 3f * 1f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        if (effectCounter == 9)
                        {
                            dst2 = new IbRect(dst.Left, dst.Top + (int)((Width * gv.screenDensity) / 3f * 2f), (int)((Width * gv.screenDensity) / 3f), (int)((Width * gv.screenDensity) / 3f));
                        }
                        gv.DrawBitmap(fx, src, dst2, -0.01f, false, 1.0f, true);
                        gv.cc.DisposeOfBitmap(ref fx);
                    }
                }
            }

            //draw level up symbol
        }