コード例 #1
0
        public void Draw()
        {
            IbRect src = new IbRect(0, 0, this.ImgBG.PixelSize.Width, this.ImgBG.PixelSize.Height);
            IbRect dst = new IbRect(this.LocX, this.LocY, Width, Height);

            gv.DrawBitmap(this.ImgBG, src, dst);
        }
コード例 #2
0
ファイル: IbbHtmlLogBox.cs プロジェクト: grannypron/IB2Engine
        public void DrawBitmap(Bitmap bmp, int x, int y)
        {
            IbRect src = new IbRect(0, 0, bmp.PixelSize.Width, bmp.PixelSize.Height);
            IbRect dst = new IbRect(x + tbXloc, y + tbYloc - gv.oYshift, bmp.PixelSize.Width, bmp.PixelSize.Height);

            gv.DrawBitmap(bmp, src, dst);
        }
コード例 #3
0
        //TITLE SCREEN
        public void redrawLauncher()
        {
            //DRAW TITLE SCREEN
            if ((titleList.Count > 0) && (moduleIndex < titleList.Count))
            {
                IbRect src = new IbRect(0, 0, titleList[moduleIndex].PixelSize.Width, titleList[moduleIndex].PixelSize.Height);
                IbRect dst = new IbRect((gv.screenWidth / 2) - (gv.squareSize * 4), 0, gv.squareSize * 8, gv.squareSize * 4);
                gv.DrawBitmap(titleList[moduleIndex], src, dst);
            }

            //DRAW DESCRIPTION BOX
            if ((moduleList.Count > 0) && (moduleIndex < moduleList.Count))
            {
                string textToSpan = "<u>Module Description</u>" + "<br>";
                //textToSpan += "<b><i><big>" + moduleList[moduleIndex].moduleLabelName + "</big></i></b><br>";
                textToSpan += moduleList[moduleIndex].moduleDescription;
                description.logLinesList.Clear();
                description.AddHtmlTextToLog(textToSpan);
                description.tbXloc   = 4 * gv.squareSize + gv.oXshift;
                description.tbYloc   = 6 * gv.squareSize + gv.oYshift;
                description.tbWidth  = 12 * gv.squareSize;
                description.tbHeight = 6 * gv.squareSize;
                description.onDrawLogBox();

                btnModuleName.Text = moduleList[moduleIndex].moduleLabelName;
                drawLauncherControls();
            }
        }
コード例 #4
0
        public void DrawBitmap(SharpDX.Direct2D1.Bitmap bmp, int x, int y)
        {
            //Rectangle src = new Rectangle(0, 0, bmp.Width, bmp.Height);
            //Rectangle dst = new Rectangle(x + tbXloc, y + tbYloc + gv.oYshift, bmp.Width, bmp.Height);
            //g.DrawImage(bmp, dst, src, GraphicsUnit.Pixel);
            IbRect src = new IbRect(0, 0, bmp.PixelSize.Width, bmp.PixelSize.Height);
            IbRect dst = new IbRect(x + tbXloc, y + tbYloc, bmp.PixelSize.Width, bmp.PixelSize.Height);

            gv.DrawBitmap(bmp, src, dst);
        }
コード例 #5
0
ファイル: Sprite.cs プロジェクト: grannypron/IB2Engine
        public void DrawCombat(GameView gv)
        {
            IbRect src = new IbRect(currentFrameIndex * frameHeight, 0, frameHeight, frameHeight);
            IbRect dst = new IbRect(0, 0, 0, 0);

            //assumes frames of equal proportions
            if (numberOFFramesForAnimationsMadeFromSeveralBitmaps != 0)
            {
                src = new IbRect(0, 0, 150, 150);
            }

            /*
             * if (gv.screenType.Equals("combat"))
             * {
             *  int randXInt = gv.sf.RandInt(500);
             *  float randX = randXInt / 10000f;
             *  int decider = gv.sf.RandInt(2);
             *  if (decider == 1)
             *  {
             *      randX = -1 * randX;
             *  }
             *
             *  int randYInt = gv.sf.RandInt(500);
             *  float randY = randXInt / 10000f;
             *  decider = gv.sf.RandInt(2);
             *  if (decider == 1)
             *  {
             *      randY = -1 * randY;
             *  }
             *
             *  dst = new IbRect((int)this.position.X, (int)(this.position.Y + randY), (int)((gv.squareSize * this.scaleX) + randX), (int)(gv.squareSize * this.scaleY));
             * }
             * else
             * {
             */
            dst = new IbRect((int)this.position.X, (int)this.position.Y, (int)(gv.squareSize * this.scaleX), (int)(gv.squareSize * this.scaleY));
            //}
            float opacityMulti = 1;

            if (this.movementMethod.Contains("fog") || this.movementMethod.Contains("clouds"))
            {
                opacityMulti = 0.64f;
            }

            if (numberOFFramesForAnimationsMadeFromSeveralBitmaps == 0)
            {
                gv.DrawBitmap(gv.cc.GetFromBitmapList(bitmap), src, dst, angle, false, this.opacity * opacityMulti);
            }
            else
            {
                //gv.cc.addLogText("red", currentFrameIndex.ToString());

                gv.DrawBitmap(gv.cc.GetFromBitmapList(bitmap + currentFrameIndex.ToString()), src, dst, angle, false, this.opacity * opacityMulti);
            }
        }
コード例 #6
0
ファイル: ScreenTitle.cs プロジェクト: grannypron/IB2Engine
        //TITLE SCREEN
        public void redrawTitle()
        {
            //DRAW TITLE SCREEN
            float dstHeight = ((float)gv.screenWidth / (float)gv.cc.title.PixelSize.Width) * (float)gv.cc.title.PixelSize.Height;
            //do narration with image setup
            IbRect src = new IbRect(0, 0, gv.cc.title.PixelSize.Width, gv.cc.title.PixelSize.Height);
            IbRect dst = new IbRect(0, 0, gv.screenWidth, (int)dstHeight);

            gv.DrawBitmap(gv.cc.title, src, dst);

            //Draw This gv.module's Version Number
            int xLoc = (gv.screenWidth / 2) - 4;
            int pH   = (int)((float)gv.screenHeight / 100.0f);

            gv.DrawText("v" + gv.mod.moduleVersion, xLoc, (8 * gv.squareSize) + (pH * 4));

            drawTitleControls();
        }
コード例 #7
0
        public void Draw()
        {
            IbRect src = new IbRect(0, 0, this.ImgOn.Width, this.ImgOn.Height);
            IbRect dst = new IbRect(this.X, this.Y, gv.squareSize/2, gv.squareSize/2);

            if (this.toggleOn)
            {
                if (this.ImgOn != null)
                {
                    gv.DrawBitmap(this.ImgOn, src, dst);
                    //canvas.drawBitmap(this.ImgOn, src, dst, null);
                }
            }
            else
            {
                if (this.ImgOff != null)
                {
                    gv.DrawBitmap(this.ImgOff, src, dst);
                    //canvas.drawBitmap(this.ImgOff, src, dst, null);
                }
            }
        }
コード例 #8
0
        public void Draw()
        {
            IbRect src = new IbRect(0, 0, this.ImgOn.PixelSize.Width, this.ImgOn.PixelSize.Height);
            IbRect dst = new IbRect(this.X, this.Y, gv.squareSize / 2, gv.squareSize / 2);

            if (this.toggleOn)
            {
                if (this.ImgOn != null)
                {
                    gv.DrawBitmap(this.ImgOn, src, dst);
                    //canvas.drawBitmap(this.ImgOn, src, dst, null);
                }
            }
            else
            {
                if (this.ImgOff != null)
                {
                    gv.DrawBitmap(this.ImgOff, src, dst);
                    //canvas.drawBitmap(this.ImgOff, src, dst, null);
                }
            }
        }
コード例 #9
0
        public void Draw(IB2Panel parentPanel)
        {
            if (show)
            {
                IbRect src = new IbRect(0, 0, gv.cc.GetFromBitmapList(ImgOnFilename).PixelSize.Width, gv.cc.GetFromBitmapList(ImgOnFilename).PixelSize.Height);
                IbRect dst = new IbRect(0, 0, 0, 0);
                if (gv.mod.useMinimalisticUI)
                {
                    dst = new IbRect((int)((parentPanel.currentLocX + this.X - 2 * gv.pS) * gv.screenDensity + gv.pS), (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity + gv.pS), (int)((float)Width * gv.screenDensity) - 2 * gv.pS, (int)((float)Height * gv.screenDensity) - 2 * gv.pS);
                }
                else
                {
                    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));
                }

                if (toggleOn)
                {
                    if (gv.mod.useMinimalisticUI)
                    {
                        IbRect src2 = new IbRect(0, 0, 100, 100);
                        IbRect dst2 = new IbRect((int)((parentPanel.currentLocX + this.X - 2 * gv.pS) * gv.screenDensity), (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                        gv.DrawBitmap(gv.cc.GetFromBitmapList("tgl_bg"), src2, dst2, -0.01f, false, 0.75f, true);
                    }
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgOnFilename), src, dst, -0.01f, false, 1f, true);
                }
                else
                {
                    if (gv.mod.useMinimalisticUI)
                    {
                        IbRect src2 = new IbRect(0, 0, 100, 100);
                        IbRect dst2 = new IbRect((int)((parentPanel.currentLocX + this.X - 2 * gv.pS) * gv.screenDensity), (int)((parentPanel.currentLocY + this.Y) * gv.screenDensity), (int)((float)Width * gv.screenDensity), (int)((float)Height * gv.screenDensity));
                        gv.DrawBitmap(gv.cc.GetFromBitmapList("tgl_bg"), src2, dst2, -0.01f, false, 0.75f, true);
                    }
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(ImgOffFilename), src, dst, -0.01f, false, 1f, true);
                }
            }
        }
コード例 #10
0
ファイル: Sprite.cs プロジェクト: grannypron/IB2Engine
        public void Draw(GameView gv)
        {
            IbRect src = new IbRect(currentFrameIndex * frameHeight, 0, frameHeight, frameHeight);
            IbRect dst = new IbRect(0, 0, 0, 0);

            //assumes frames of equal proportions
            if (numberOFFramesForAnimationsMadeFromSeveralBitmaps != 0)
            {
                src = new IbRect(0, 0, 150, 150);
            }

            /*
             * if (gv.screenType.Equals("combat"))
             * {
             *  int randXInt = gv.sf.RandInt(500);
             *  float randX = randXInt / 10000f;
             *  int decider = gv.sf.RandInt(2);
             *  if (decider == 1)
             *  {
             *      randX = -1 * randX;
             *  }
             *
             *  int randYInt = gv.sf.RandInt(500);
             *  float randY = randXInt / 10000f;
             *  decider = gv.sf.RandInt(2);
             *  if (decider == 1)
             *  {
             *      randY = -1 * randY;
             *  }
             *
             *  dst = new IbRect((int)this.position.X, (int)(this.position.Y + randY), (int)((gv.squareSize * this.scaleX) + randX), (int)(gv.squareSize * this.scaleY));
             * }
             * else
             * {
             */
            //snowshift
            dst = new IbRect((int)this.position.X, (int)this.position.Y, (int)(gv.squareSize * this.scaleX), (int)(gv.squareSize * this.scaleY));
            //}

            //panikanfälle
            if (gv.screenType == "combat")
            {
                if (!gv.screenCombat.isPlayerTurn)
                {
                    Creature cr = new Creature();
                    int      highestLivingCrtMoveOrderfound = 0;
                    foreach (Creature c in gv.mod.currentEncounter.encounterCreatureList)
                    {
                        if (gv.screenCombat.currentMoveOrderIndex == 0)
                        {
                            if (c.moveOrder >= highestLivingCrtMoveOrderfound)
                            {
                                highestLivingCrtMoveOrderfound = c.moveOrder;
                                cr = c;
                            }
                        }
                        else
                        {
                            if (c.moveOrder == gv.screenCombat.currentMoveOrderIndex - 1)
                            {
                                cr = c;
                                break;
                            }
                        }
                    }

                    dst = new IbRect((int)this.position.X - (int)cr.glideAdderX, (int)this.position.Y - (int)cr.glideAdderY, (int)(gv.squareSize * this.scaleX), (int)(gv.squareSize * this.scaleY));
                }
            }
            float opacityMulti = 1;

            if (this.movementMethod.Contains("fog") || this.movementMethod.Contains("clouds"))
            {
                opacityMulti = 0.64f;
            }

            if (numberOFFramesForAnimationsMadeFromSeveralBitmaps == 0)
            {
                //if (this.movementMethod == "fog")
                //{
                //gv.DrawBitmapParallelToPlayer(gv.cc.GetFromBitmapList(bitmap), src, dst, angle, false, this.opacity * opacityMulti);
                //}

                if (this.movementMethod == "clouds")
                {
                    bool mirror = false;
                    if (this.mass == 1)
                    {
                        mirror = true;
                    }
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(bitmap), src, dst, angle, mirror, this.opacity * opacityMulti);
                }
                else
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(bitmap), src, dst, angle, false, this.opacity * opacityMulti);
                }
            }
            else
            {
                //gv.cc.addLogText("red", currentFrameIndex.ToString());

                gv.DrawBitmap(gv.cc.GetFromBitmapList(bitmap + currentFrameIndex.ToString()), src, dst, angle, false, this.opacity * opacityMulti);
            }
        }
コード例 #11
0
ファイル: GameView.cs プロジェクト: youngneil1/IB2Engine
        public void DrawText(string text, IbRect rect, float scaler, Color fontColor)
        {
            //ANDROID
            //canvas.drawText(text, xLoc + gv.oXshift, yLoc + txtH, gv.floatyTextPaint);
            //floatyTextPaint = new Paint();
            //floatyTextPaint.setStyle(Paint.Style.FILL);
            //floatyTextPaint.setColor(Color.YELLOW);
            //floatyTextPaint.setAntiAlias(true);
            //Typeface uiTypeface = Typeface.createFromAsset(gameContext.getAssets(), "fonts/Metamorphous-Regular.ttf");
            //floatyTextPaint.setTypeface(uiTypeface);
            //floatyTextPaint.setTextSize(squareSize/4);

            //PC
            //device.DrawString(crtRef.creatureTag, drawFont, drawBrush, new Point(cspx, cspy+25));
            //Font drawFont = new Font("Arial", 6);
            //SolidBrush drawBrush = new SolidBrush(Color.Yellow);

            Font thisFont = drawFontReg;
            if (scaler > 1.05f)
            {
                thisFont = drawFontLarge;
            }
            else if (scaler < 0.95f)
            {
                thisFont = drawFontSmall;
            }
            RectangleF rectF = new RectangleF(rect.Left, rect.Top + oYshift, rect.Width, rect.Height);
            drawBrush.Color = fontColor;
            gCanvas.DrawString(text, thisFont, drawBrush, rectF);
        }
コード例 #12
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void drawCombatPlayers()
 {
     Player p = mod.playerList[currentPlayerIndex];
     if (IsInVisibleCombatWindow(p.combatLocX, p.combatLocY))
     {
         IbRect src = new IbRect(0, 0, gv.cc.turn_marker.Width, gv.cc.turn_marker.Width);
         IbRect dst = new IbRect(getPixelLocX(p.combatLocX), getPixelLocY(p.combatLocY), gv.squareSize, gv.squareSize);
         if (isPlayerTurn)
         {
             gv.DrawBitmap(gv.cc.turn_marker, src, dst);
         }
     }
     foreach (Player pc in mod.playerList)
     {
         if (IsInVisibleCombatWindow(pc.combatLocX, pc.combatLocY))
         {
             //int x = (pc.combatLocX - UpperLeftSquare.X) * gv.squareSize;
             //int y = (pc.combatLocY - UpperLeftSquare.Y) * gv.squareSize;
             IbRect src = new IbRect(0, 0, pc.token.Width, pc.token.Width);
             //check if drawing animation of player
             if ((playerToAnimate != null) && (playerToAnimate == pc))
             {
                 src = new IbRect(0, pc.token.Width, pc.token.Width, pc.token.Width);
             }
             IbRect dst = new IbRect(getPixelLocX(pc.combatLocX), getPixelLocY(pc.combatLocY), gv.squareSize, gv.squareSize);
             //dst = new IbRect(x + gv.oXshift + mapStartLocXinPixels, y, gv.squareSize, gv.squareSize);
             gv.DrawBitmap(pc.token, src, dst);
             //canvas.drawBitmap(pc.token, x, y, null);
             src = new IbRect(0, 0, pc.token.Width, pc.token.Width);
             foreach (Effect ef in pc.effectsList)
             {
                 Bitmap fx = gv.cc.LoadBitmap(ef.spriteFilename);
                 src = new IbRect(0, 0, fx.Width, fx.Width);
                 gv.DrawBitmap(fx, src, dst);
             }
             if ((pc.charStatus.Equals("Dead")) || (pc.hp < 0))
             {
                 src = new IbRect(0, 0, gv.cc.pc_dead.Width, gv.cc.pc_dead.Width);
                 gv.DrawBitmap(gv.cc.pc_dead, src, dst);
             }
             if (pc.steathModeOn)
             {
                 src = new IbRect(0, 0, gv.cc.pc_stealth.Width, gv.cc.pc_stealth.Width);
                 gv.DrawBitmap(gv.cc.pc_stealth, src, dst);
             }
         }
     }
 }
コード例 #13
0
ファイル: IB2Button.cs プロジェクト: grannypron/IB2Engine
        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);
                }
            }
        }
コード例 #14
0
ファイル: IbbButton.cs プロジェクト: youngneil1/IB2Engine
        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.Width, this.Img.Height);
            IbRect src2 = new IbRect(0, 0, this.Img.Width, this.Img.Height);
            IbRect src3 = new IbRect(0, 0, this.Img.Width, this.Img.Height);

            if (this.Img2 != null)
            {
                src2 = new IbRect(0, 0, this.Img2.Width, this.Img2.Width);
            }
            if (this.Img3 != null)
            {
                src3 = new IbRect(0, 0, this.Img3.Width, this.Img3.Width);
            }
            IbRect dst = new IbRect(this.X, this.Y, (int)((float)this.Width * gv.screenDensity), (int)((float)this.Height * gv.screenDensity));

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

            if ((this.glowOn) && (this.Glow != null))
            {
                gv.DrawBitmap(this.Glow, srcGlow, dstGlow);
                //canvas.drawBitmap(this.Glow, srcGlow, dstGlow, null);
            }
            gv.DrawBitmap(this.Img, src, dst);
            //canvas.drawBitmap(this.Img, src, dst, null);
            if (this.Img2 != null)
            {
                gv.DrawBitmap(this.Img2, src2, dst);
                //canvas.drawBitmap(this.Img2, src2, dst, null);
            }
            if (this.Img3 != null)
            {
                gv.DrawBitmap(this.Img3, src3, dst);
                //canvas.drawBitmap(this.Img3, src3, dst, null);
            }

            Font thisFont = gv.drawFontReg;
            if (scaler > 1.05f)
            {
                thisFont = gv.drawFontLarge;
            }
            else if (scaler < 0.95f)
            {
                thisFont = gv.drawFontSmall;
            }

            // Measure string.
            SizeF stringSize = gv.cc.MeasureString(Text, thisFont, this.Width);

            int ulX = ((int)(this.Width * gv.screenDensity) / 2) - ((int)stringSize.Width / 2);
            int ulY = ((int)(this.Height * gv.screenDensity / 2) / 2) + ((int)stringSize.Height / 2);

            for (int x = -2; x <= 2; x++)
            {
                for (int y = -2; y <= 2; y++)
                {
                    gv.DrawText(Text, this.X + ulX + x, this.Y + ulY - pH + y , scaler, Color.Black);
                }
            }
            gv.DrawText(Text, this.X + ulX, this.Y + ulY - pH, scaler, Color.White);

            // Measure string.
            stringSize = gv.cc.MeasureString(Quantity, thisFont, this.Width);

            ulX = ((int)(this.Width * gv.screenDensity / 2)) - ((int)stringSize.Width);
            ulY = ((int)(this.Height * gv.screenDensity / 2));

            for (int x = -2; x <= 2; x++)
            {
                for (int y = -2; y <= 2; y++)
                {
                    gv.DrawText(Quantity, this.X + ulX - pW + x, this.Y + ulY - pH + y, scaler, Color.Black);
                }
            }
            gv.DrawText(Quantity, this.X + ulX - pW, this.Y + ulY - pH, scaler, Color.White);
        }
コード例 #15
0
ファイル: IbbButton.cs プロジェクト: grannypron/IB2Engine
        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);
            }
        }
コード例 #16
0
ファイル: ScreenTitle.cs プロジェクト: youngneil1/IB2Engine
        //TITLE SCREEN
        public void redrawTitle()
        {
            //canvas.drawColor(Color.BLACK);

            //DRAW TITLE SCREEN
            IbRect src = new IbRect(0, 0, gv.cc.title.Width, gv.cc.title.Height);
            IbRect dst = new IbRect((gv.screenWidth / 2) - (gv.squareSize * 4), 0, gv.squareSize * 8, gv.squareSize * 4);

            gv.DrawBitmap(gv.cc.title, src, dst);
            /*TODO
            //Draw This Module's Version Number
            int xLoc = (gv.screenWidth / 2) - (int)(gv.mSheetTextPaint.getTextSize());
            int pH = (int)((float)gv.screenHeight / 100.0f);
            gv.mSheetTextPaint.setColor(Color.LTGRAY);
            canvas.drawText("v" + mod.moduleVersion, xLoc, (11 * gv.squareSize) + (pH * 4), gv.mSheetTextPaint);
            */
            drawTitleControls();
        }
コード例 #17
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void DrawProjectileAnimation()
 {
     if (drawProjectileAnimation)
     {
         IbRect src = new IbRect(animationFrameIndex * gv.squareSize, 0, gv.squareSize, gv.squareSize);
         IbRect dst = new IbRect(projectileAnimationLocation.X + gv.oXshift + mapStartLocXinPixels, projectileAnimationLocation.Y, gv.squareSize, gv.squareSize);
         gv.DrawBitmap(projectile, src, dst);
     }
 }
コード例 #18
0
ファイル: ScreenJournal.cs プロジェクト: grannypron/IB2Engine
        public void redrawJournal()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);

            int locY       = pH * 5;
            int locX       = 4 * gv.squareSize;
            int spacing    = (int)gv.drawFontRegHeight + pH;
            int leftStartY = pH * 4;
            int tabStartY  = pH * 40;

            //IF BACKGROUND IS NULL, LOAD IMAGE
            if (journalBack == null)
            {
                gv.cc.DisposeOfBitmap(ref journalBack);
                journalBack = gv.cc.LoadBitmap("journalback");
            }
            //IF BUTTONS ARE NULL, LOAD BUTTONS
            if (btnReturnJournal == null)
            {
                setControlsStart();
            }

            //DRAW BACKGROUND IMAGE
            IbRect src = new IbRect(0, 0, journalBack.PixelSize.Width, journalBack.PixelSize.Height);
            IbRect dst = new IbRect(2 * gv.squareSize, 0, (gv.squaresInWidth - 4) * gv.squareSize, (gv.squaresInHeight - 1) * gv.squareSize);

            gv.DrawBitmap(journalBack, src, dst);

            //MAKE SURE NO OUT OF INDEX ERRORS
            if (gv.mod.partyJournalQuests.Count > 0)
            {
                if (journalScreenQuestIndex >= gv.mod.partyJournalQuests.Count)
                {
                    journalScreenQuestIndex = 0;
                }
                if (journalScreenEntryIndex >= gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries.Count)
                {
                    journalScreenEntryIndex = 0;
                }
            }

            //DRAW QUESTS
            Color color = Color.Black;

            gv.DrawText("Active Quests:", locX, locY += leftStartY, 1.0f, color);
            gv.DrawText("--------------", locX, locY += spacing, 1.0f, color);

            //draw Faction info first
            bool drawFactionQuest = false;

            if (gv.mod.moduleFactionsList != null)
            {
                foreach (Faction f in gv.mod.moduleFactionsList)
                {
                    if (f.showThisFactionInJournal)
                    {
                        drawFactionQuest = true;
                        break;
                    }
                }
            }

            if (drawFactionQuest)
            {
                //now add the faction quest and an entry for each drawn faction

                //1. No need to add the quest if it already exists
                bool factionQuestExistsAlready = false;
                foreach (JournalQuest jQ in gv.mod.partyJournalQuests)
                {
                    if (jQ.Tag == "factionQuest001")
                    {
                        factionQuestExistsAlready = true;
                        jQ.Entries.Clear();
                        break;
                    }
                }

                if (!factionQuestExistsAlready)
                {
                    JournalQuest factionQuest = new JournalQuest();
                    factionQuest.Tag  = "factionQuest001";
                    factionQuest.Name = "Factions";
                    factionQuest.Entries.Clear();
                    gv.mod.partyJournalQuests.Add(factionQuest);
                }

                //2. update entries of faction quest
                foreach (JournalQuest jQ in gv.mod.partyJournalQuests)
                {
                    if (jQ.Tag == "factionQuest001")
                    {
                        int idCounter = 0;
                        foreach (Faction f in gv.mod.moduleFactionsList)
                        {
                            if (f.showThisFactionInJournal)
                            {
                                JournalEntry factionEntry = new JournalEntry();
                                factionEntry.EntryId    = idCounter;
                                factionEntry.EntryTitle = f.name;
                                factionEntry.EntryText  = "";
                                //Rank 1 (27 of 99, +1 every 24h), +4 buff to AC/toHit/Saves
                                if (f.showRankInJournal)
                                {
                                    if (f.displayRankInWords)
                                    {
                                        if (f.rank == 1)
                                        {
                                            factionEntry.EntryText += f.nameRank1 + " ";
                                        }
                                        else if (f.rank == 2)
                                        {
                                            factionEntry.EntryText += f.nameRank2 + " ";
                                        }
                                        else if (f.rank == 3)
                                        {
                                            factionEntry.EntryText += f.nameRank3 + " ";
                                        }
                                        else if (f.rank == 4)
                                        {
                                            factionEntry.EntryText += f.nameRank4 + " ";
                                        }
                                        else if (f.rank == 5)
                                        {
                                            factionEntry.EntryText += f.nameRank5 + " ";
                                        }
                                        else if (f.rank == 6)
                                        {
                                            factionEntry.EntryText += f.nameRank6 + " ";
                                        }
                                        else if (f.rank == 7)
                                        {
                                            factionEntry.EntryText += f.nameRank7 + " ";
                                        }
                                        else if (f.rank == 8)
                                        {
                                            factionEntry.EntryText += f.nameRank8 + " ";
                                        }
                                        else if (f.rank == 9)
                                        {
                                            factionEntry.EntryText += f.nameRank9 + " ";
                                        }
                                        else if (f.rank == 10)
                                        {
                                            factionEntry.EntryText += f.nameRank10 + " ";
                                        }
                                    }
                                    else
                                    {
                                        if (f.rank == 1)
                                        {
                                            factionEntry.EntryText += "Rank 1 ";
                                        }
                                        else if (f.rank == 2)
                                        {
                                            factionEntry.EntryText += "Rank 2 ";
                                        }
                                        else if (f.rank == 3)
                                        {
                                            factionEntry.EntryText += "Rank 3 ";
                                        }
                                        else if (f.rank == 4)
                                        {
                                            factionEntry.EntryText += "Rank 4 ";
                                        }
                                        else if (f.rank == 5)
                                        {
                                            factionEntry.EntryText += "Rank 5 ";
                                        }
                                        else if (f.rank == 6)
                                        {
                                            factionEntry.EntryText += "Rank 6 ";
                                        }
                                        else if (f.rank == 7)
                                        {
                                            factionEntry.EntryText += "Rank 7 ";
                                        }
                                        else if (f.rank == 8)
                                        {
                                            factionEntry.EntryText += "Rank 8 ";
                                        }
                                        else if (f.rank == 9)
                                        {
                                            factionEntry.EntryText += "Rank 9 ";
                                        }
                                        else if (f.rank == 9)
                                        {
                                            factionEntry.EntryText += "Rank 9 ";
                                        }
                                        else if (f.rank == 10)
                                        {
                                            factionEntry.EntryText += "Rank 10 ";
                                        }
                                    }
                                }

                                if ((f.showStrengthInJournal || f.showChangeRateInJournal) && (f.showRankInJournal))
                                {
                                    factionEntry.EntryText += "(";
                                }
                                if (f.showStrengthInJournal)
                                {
                                    if (f.rank == 1)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank2.ToString();
                                    }
                                    else if (f.rank == 2)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank3.ToString();
                                    }
                                    else if (f.rank == 3)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank4.ToString();
                                    }
                                    else if (f.rank == 4)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank5.ToString();
                                    }
                                    else if (f.rank == 5)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank6.ToString();
                                    }
                                    else if (f.rank == 6)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank7.ToString();
                                    }
                                    else if (f.rank == 7)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank8.ToString();
                                    }
                                    else if (f.rank == 8)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank9.ToString();
                                    }
                                    else if (f.rank == 9)
                                    {
                                        factionEntry.EntryText += f.strength.ToString() + " of " + f.factionStrengthRequiredForRank10.ToString();
                                    }
                                    else if (f.rank == 10)
                                    {
                                        factionEntry.EntryText += f.strength.ToString();
                                    }
                                }

                                if ((f.showStrengthInJournal && !f.showChangeRateInJournal) && f.showRankInJournal)
                                {
                                    factionEntry.EntryText += ") ";
                                }

                                if ((f.showChangeRateInJournal) && (f.showRankInJournal || f.showStrengthInJournal))
                                {
                                    if (f.showRankInJournal && f.showStrengthInJournal)
                                    {
                                        factionEntry.EntryText += ", " + f.amountOfFactionStrengthChangePerInterval.ToString() + " every " + f.intervalOfFactionStrengthChangeInHours.ToString() + "h)";
                                    }
                                    else if (f.showRankInJournal && !f.showStrengthInJournal)
                                    {
                                        factionEntry.EntryText += f.amountOfFactionStrengthChangePerInterval.ToString() + " every " + f.intervalOfFactionStrengthChangeInHours.ToString() + "h)";
                                    }
                                    else if (!f.showRankInJournal && f.showStrengthInJournal)
                                    {
                                        factionEntry.EntryText += ", " + f.amountOfFactionStrengthChangePerInterval.ToString() + " every " + f.intervalOfFactionStrengthChangeInHours.ToString() + "h";
                                    }
                                    else if (f.showRankInJournal && !f.showStrengthInJournal)
                                    {
                                        factionEntry.EntryText += f.amountOfFactionStrengthChangePerInterval.ToString() + " every " + f.intervalOfFactionStrengthChangeInHours.ToString() + "h)";
                                    }
                                }
                                else if (f.showChangeRateInJournal)
                                {
                                    factionEntry.EntryText += f.amountOfFactionStrengthChangePerInterval.ToString() + " every " + f.intervalOfFactionStrengthChangeInHours.ToString() + "h";
                                }

                                if (f.rank == 1)
                                {
                                    if (f.accumulatedBuffStrengthRank1 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank1.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 2)
                                {
                                    if (f.accumulatedBuffStrengthRank2 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank2.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 3)
                                {
                                    if (f.accumulatedBuffStrengthRank3 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank3.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 4)
                                {
                                    if (f.accumulatedBuffStrengthRank4 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank4.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 5)
                                {
                                    if (f.accumulatedBuffStrengthRank5 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank5.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 6)
                                {
                                    if (f.accumulatedBuffStrengthRank6 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank6.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 7)
                                {
                                    if (f.accumulatedBuffStrengthRank7 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank7.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 8)
                                {
                                    if (f.accumulatedBuffStrengthRank8 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank8.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 9)
                                {
                                    if (f.accumulatedBuffStrengthRank9 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank9.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }
                                else if (f.rank == 10)
                                {
                                    if (f.accumulatedBuffStrengthRank10 != 0)
                                    {
                                        factionEntry.EntryText += ", +" + f.accumulatedBuffStrengthRank10.ToString() + " buff to AC/toHit/Saves";
                                        //factionEntry.EntryText += "<br>";
                                    }
                                }

                                factionEntry.EntryText += "<br>";
                                factionEntry.EntryText += "<br>";
                                factionEntry.EntryText += f.factionDescriptionInJournal;
                                jQ.Entries.Add(factionEntry);
                                idCounter++;
                            }
                        }
                        break;
                    }
                }
            }

            if (gv.mod.partyJournalQuests.Count > 0)
            {
                /*
                 * int cnt = 0;
                 *          foreach (JournalQuest jq in gv.mod.partyJournalQuests)
                 *          {
                 *  if (journalScreenQuestIndex == cnt) { color = Color.Lime; }
                 *                  else { color = Color.Black; }
                 *  gv.DrawText(jq.Name, locX, locY += spacing, 1.0f, color);
                 *                  cnt++;
                 *          }
                 */
                int minQuestNumber = journalScreenQuestIndex - 3;
                int maxQuestNumber = journalScreenQuestIndex + 3;
                if (minQuestNumber < 0)
                {
                    maxQuestNumber -= minQuestNumber;
                    if (maxQuestNumber > gv.mod.partyJournalQuests.Count - 1)
                    {
                        maxQuestNumber = gv.mod.partyJournalQuests.Count - 1;
                    }
                    minQuestNumber = 0;
                }
                if (maxQuestNumber > gv.mod.partyJournalQuests.Count - 1)
                {
                    minQuestNumber -= (maxQuestNumber - (gv.mod.partyJournalQuests.Count - 1));
                    if (minQuestNumber < 0)
                    {
                        minQuestNumber = 0;
                    }
                    maxQuestNumber = gv.mod.partyJournalQuests.Count - 1;
                }


                for (int i = minQuestNumber; i <= maxQuestNumber; i++)
                {
                    if (journalScreenQuestIndex == i)
                    {
                        color = Color.Lime;
                    }
                    else
                    {
                        color = Color.Black;
                    }
                    gv.DrawText(gv.mod.partyJournalQuests[i].Name, locX, locY += spacing, 1.0f, color);
                }
            }

            //DRAW QUEST ENTRIES
            locY = tabStartY;
            gv.DrawText("Quest Entry:", locX, locY, 1.0f, Color.Black);
            gv.DrawText("--------------", locX, locY += spacing, 1.0f, Color.Black);
            if (gv.mod.partyJournalQuests.Count > 0)
            {
                //Description
                string textToSpan = "<font color='black'><i><b>" + gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries[journalScreenEntryIndex].EntryTitle + "</b></i></font><br>";
                textToSpan += gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries[journalScreenEntryIndex].EntryText;

                string textToSpanReplaced = replaceText(textToSpan);

                int yLoc = pH * 18;

                description.tbXloc   = locX;
                description.tbYloc   = locY + spacing;
                description.tbWidth  = pW * 60;
                description.tbHeight = pH * 45;
                description.logLinesList.Clear();
                description.AddHtmlTextToLog(textToSpanReplaced);
                description.onDrawLogBox();
            }

            //DRAW ALL CONTROLS
            ctrlUpArrow.Draw();
            ctrlDownArrow.Draw();
            ctrlLeftArrow.Draw();
            ctrlRightArrow.Draw();
            btnReturnJournal.Draw();
        }
コード例 #19
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void drawOverlayTints()
 {
     IbRect src = new IbRect(0, 0, gv.cc.tint_sunset.Width, gv.cc.tint_sunset.Height);
     IbRect dst = new IbRect(gv.oXshift + mapStartLocXinPixels, 0, gv.squareSize * (gv.playerOffset + gv.playerOffset + 1), gv.squareSize * (gv.playerOffset + gv.playerOffset + 1));
     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;
     if ((time >= dawn) && (time < sunrise))
     {
         gv.DrawBitmap(gv.cc.tint_dawn, src, dst);
     }
     else if ((time >= sunrise) && (time < day))
     {
         gv.DrawBitmap(gv.cc.tint_sunrise, src, dst);
     }
     else if ((time >= day) && (time < sunset))
     {
         //no tint for day
     }
     else if ((time >= sunset) && (time < dusk))
     {
         gv.DrawBitmap(gv.cc.tint_sunset, src, dst);
     }
     else if ((time >= dusk) && (time < night))
     {
         gv.DrawBitmap(gv.cc.tint_dusk, src, dst);
     }
     else if ((time >= night) || (time < dawn))
     {
         gv.DrawBitmap(gv.cc.tint_night, src, dst);
     }
 }
コード例 #20
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void DrawMissAnimation()
 {
     if (drawMissAnimation)
     {
         IbRect src = new IbRect(0, 0, gv.cc.missSymbol.Width, gv.cc.missSymbol.Height);
         IbRect dst = new IbRect(hitAnimationLocation.X, hitAnimationLocation.Y, gv.squareSize, gv.squareSize);
         gv.DrawBitmap(gv.cc.missSymbol, src, dst);
     }
 }
コード例 #21
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void DrawEndingAnimation()
 {
     if ((drawEndingAnimation) && (ending_fx != null))
     {
         int height = ending_fx.Height;
         IbRect src = new IbRect(animationFrameIndex * height, 0, height, height);
         IbRect dst = new IbRect(endingAnimationLocation.X + gv.oXshift + mapStartLocXinPixels, endingAnimationLocation.Y, gv.squareSize, gv.squareSize);
         if (height > 50)
         {
             dst = new IbRect(endingAnimationLocation.X + gv.oXshift - gv.squareSize + mapStartLocXinPixels, endingAnimationLocation.Y - gv.squareSize, gv.squareSize * 3, gv.squareSize * 3);
         }
         gv.DrawBitmap(ending_fx, src, dst);
     }
 }
コード例 #22
0
ファイル: IB2Panel.cs プロジェクト: grannypron/IB2Engine
        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);
             * }
             */
        }
コード例 #23
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
 public void drawCombatCreatures()
 {
     if (mod.currentEncounter.encounterCreatureList.Count > 0)
     {
         Creature cr = mod.currentEncounter.encounterCreatureList[creatureIndex];
         if (IsInVisibleCombatWindow(cr.combatLocX, cr.combatLocY))
         {
             //int x = cr.combatLocX * gv.squareSize;
             //int y = cr.combatLocY * gv.squareSize;
             IbRect src = new IbRect(0, 0, gv.cc.turn_marker.Width, gv.cc.turn_marker.Height);
             //IbRect dst = new IbRect(x + gv.oXshift + mapStartLocXinPixels, y, gv.squareSize, gv.squareSize);
             IbRect dst = new IbRect(getPixelLocX(cr.combatLocX), getPixelLocY(cr.combatLocY), gv.squareSize, gv.squareSize);
             if (!isPlayerTurn)
             {
                 gv.DrawBitmap(gv.cc.turn_marker, src, dst);
             }
         }
     }
     foreach (Creature crt in mod.currentEncounter.encounterCreatureList)
     {
         if (!IsInVisibleCombatWindow(crt.combatLocX, crt.combatLocY))
         {
             continue;
         }
         //int x = crt.combatLocX * gv.squareSize;
         //int y = crt.combatLocY * gv.squareSize;
         IbRect src = new IbRect(0, 0, crt.token.Width, crt.token.Width);
         if ((creatureToAnimate != null) && (creatureToAnimate == crt))
         {
             src = new IbRect(0, crt.token.Width, crt.token.Width, crt.token.Width);
         }
         IbRect dst = new IbRect(getPixelLocX(crt.combatLocX), getPixelLocY(crt.combatLocY), gv.squareSize, gv.squareSize);
         //IbRect dst = new IbRect(x + gv.oXshift + mapStartLocXinPixels, y, gv.squareSize, gv.squareSize);
         if (crt.token.Width > 100)
         {
             dst = new IbRect(getPixelLocX(crt.combatLocX) - (gv.squareSize / 2), getPixelLocY(crt.combatLocY) - (gv.squareSize / 2), gv.squareSize * 2, gv.squareSize * 2);
             //dst = new IbRect(x - (gv.squareSize / 2) + gv.oXshift + mapStartLocXinPixels, y - (gv.squareSize / 2), gv.squareSize * 2, gv.squareSize * 2);
         }
         gv.DrawBitmap(crt.token, src, dst);
         foreach (Effect ef in crt.cr_effectsList)
         {
             Bitmap fx = gv.cc.LoadBitmap(ef.spriteFilename);
             src = new IbRect(0, 0, fx.Width, fx.Width);
             gv.DrawBitmap(fx, src, dst);
         }
     }
 }
コード例 #24
0
        public void redrawPcCreation()
        {
            //gv.BackColor = Color.DimGray;
            //Player pc = mod.playerList.get(0);
            gv.sf.UpdateStats(pc);

            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);

            int locX = 6 * gv.squareSize;
            //int textH = (int)gv.mSheetTextPaint.getTextSize();
            //int spacing = (int)gv.mSheetTextPaint.getTextSize() + pH;
            int textH = (int)gv.cc.MeasureString("GetHeight", gv.drawFontReg, gv.Width).Height;
            int spacing = textH;
            int locY = 0;
            int tabX = pW * 50;
            int tabX2 = pW * 50;
            int leftStartY = pH * 20;
            int tokenStartX = locX + (textH * 5);
            int tokenStartY = pH * 5 + (spacing/2);
            int tokenRectPad = pW * 1;

            //canvas.drawColor(Color.DKGRAY);

            //Page Title
            //gv.mSheetTextPaint.setColor(Color.WHITE);
            //canvas.drawText("CREATE CHARACTER", pW * 31, pH * 3, gv.mSheetTextPaint);
            gv.DrawText("CREATE CHARACTER", pW * 40, pH * 3);

            //select token
            //gv.mSheetTextPaint.setColor(Color.YELLOW);
            //canvas.drawText("Left/Right to Change", tabX2, tokenStartY + (gv.squareSize / 2), gv.mSheetTextPaint);
            gv.DrawText("Left/Right to Change", tabX2, tokenStartY + (gv.squareSize / 2), 1.0f, Color.Yellow);

            Color color = Color.White;
            if (pcCreationIndex == 0) { color = Color.Lime; }
            else { color = Color.White; }
            gv.DrawText("Image:", locX, tokenStartY + (gv.squareSize / 2), 1.0f, color);
            //canvas.drawText("Image:", locX, tokenStartY + (gv.squareSize / 2), gv.mSheetTextPaint);

            IbRect src = new IbRect(0, 0, pc.token.Width, pc.token.Width);
            IbRect dst = new IbRect(tokenStartX, tokenStartY, gv.squareSize, gv.squareSize);
            gv.DrawBitmap(blankItemSlot, src, dst);
            gv.DrawBitmap(pc.token, src, dst);
            if (pcCreationIndex == 0)
            {
                IbRect dst2 = new IbRect(tokenStartX - tokenRectPad/2, tokenStartY - tokenRectPad/2, tokenRectPad + gv.squareSize, tokenRectPad + gv.squareSize);
                gv.DrawRoundRectangle(dst2, 10, Color.Lime, 3);
            }

            //name
            if (pcCreationIndex == 1) { color = Color.Lime; }
            else { color = Color.White; }
            gv.DrawText("Name: " + pc.name, locX, locY += leftStartY, 1.0f, color);

            //if (pcCreationIndex == 1) { gv.mSheetTextPaint.setColor(Color.GREEN); }
            //else { gv.mSheetTextPaint.setColor(Color.WHITE); }
            //canvas.drawText("Name: " + pc.name, locX, locY += leftStartY, gv.mSheetTextPaint);

            //race
            if (pcCreationIndex == 2) { color = Color.Lime; }
            else { color = Color.White; }
            gv.DrawText("Race: " + pc.race.name, locX, locY += spacing, 1.0f, color);

            //if (pcCreationIndex == 2) { gv.mSheetTextPaint.setColor(Color.GREEN); }
            //else { gv.mSheetTextPaint.setColor(Color.WHITE); }
            //canvas.drawText("Race: " + pc.race.name, locX, locY += spacing, gv.mSheetTextPaint);

            //gender
            if (pcCreationIndex == 3) { color = Color.Lime; }
            else { color = Color.White; }

            //if (pcCreationIndex == 3) { gv.mSheetTextPaint.setColor(Color.GREEN); }
            //else { gv.mSheetTextPaint.setColor(Color.WHITE); }
            if (pc.isMale)
            {
                gv.DrawText("Gender: Male", locX, locY += spacing, 1.0f, color);
                //canvas.drawText("Gender: Male", locX, locY += spacing, gv.mSheetTextPaint);
            }
            else
            {
                gv.DrawText("Gender: Female", locX, locY += spacing, 1.0f, color);
                //canvas.drawText("Gender: Female", locX, locY += spacing, gv.mSheetTextPaint);
            }

            //class
            if (pcCreationIndex == 4) { color = Color.Lime; }
            else { color = Color.White; }
            gv.DrawText("Class: " + pc.playerClass.name, locX, locY += spacing, 1.0f, color);

            gv.DrawText("STR: " + pc.baseStr + " + " + (pc.strength - pc.baseStr) + " = " + pc.strength, locX, locY += spacing);
            gv.DrawText("AC: " + pc.AC, tabX2, locY);
            gv.DrawText("DEX: " + pc.baseDex + " + " + (pc.dexterity - pc.baseDex) + " = " + pc.dexterity, locX, locY += spacing);
            gv.DrawText("HP: " + pc.hp + "/" + pc.hpMax, tabX2, locY);
            gv.DrawText("INT:  " + pc.baseInt + " + " + (pc.intelligence - pc.baseInt) + " = " + pc.intelligence, locX, locY += spacing);
            gv.DrawText("SP: " + pc.sp + "/" + pc.spMax, tabX2, locY);
            gv.DrawText("CHA: " + pc.baseCha + " + " + (pc.charisma - pc.baseCha) + " = " + pc.charisma, locX, locY += spacing);
            gv.DrawText("BAB: " + pc.baseAttBonus, tabX2, locY);

            //Description
            string textToSpan = "";
            if (pcCreationIndex == 2)
            {
                textToSpan = "Description:" + Environment.NewLine;
                //textToSpan = "<u>Description</u>" + "<BR>";
                textToSpan += pc.race.description;
            }
            else if (pcCreationIndex == 4)
            {
                textToSpan = "Description:" + Environment.NewLine;
                textToSpan += pc.playerClass.description;
            }
            int yLoc = pH * 18;
            IbRect rect = new IbRect(tabX, yLoc, pW * 35, pH * 50);
            gv.DrawText(textToSpan, rect, 1.0f, Color.White);

            ctrlUpArrow.Draw();
            ctrlDownArrow.Draw();
            ctrlLeftArrow.Draw();
            ctrlRightArrow.Draw();
            btnRollStats.Draw();
            btnFinished.Draw();
            gv.cc.btnHelp.Draw();
            btnAbort.Draw();
            btnPlayerGuideOnPcCreation.Draw();
            btnBeginnerGuideOnPcCreation.Draw();
        }
コード例 #25
0
ファイル: ScreenConvo.cs プロジェクト: youngneil1/IB2Engine
        public void drawPortrait()
        {
            int sX = gv.squareSize * 2;
            int sY = (int)((float)gv.screenHeight / 100.0f) * 4;
            IbRect src = new IbRect(0, 0, convoBitmap.Width, convoBitmap.Height);
            IbRect dst = new IbRect(sX, sY, convoBitmap.Width * 2, convoBitmap.Height * 2);

            if (convoBitmap.Width == convoBitmap.Height)
            {
                dst = new IbRect(sX, sY, (int)(gv.squareSize * 2), (int)(gv.squareSize * 2));
            }
            if (currentConvo.Narration)
            {
                if (!currentConvo.NpcPortraitBitmap.Equals("")) //Narration with image
                {
                    dst = new IbRect((gv.screenWidth / 2) - (gv.squareSize * 4), gv.squareSize / 2, gv.squareSize * 8, gv.squareSize * 4);
                }
                else //Narration without image
                {
                    //do narration without image setup
                }
            }
            if (convoBitmap != null)
            {
                gv.DrawBitmap(convoBitmap, src, dst);
            }
        }
コード例 #26
0
ファイル: IB2Panel.cs プロジェクト: grannypron/IB2Engine
        public void Draw()
        {
            if (!gv.mod.useMinimalisticUI)
            {
                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), (int)(Width * gv.screenDensity), (int)(Height * gv.screenDensity));

                if ((this.tag != "InitiativePanel") && (this.tag != "logPanel"))
                {
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);
                }

                if ((this.tag.Contains("logPanel")) && (gv.screenCombat.showIniBar) && (gv.screenType.Equals("combat")))
                {
                    dst = new IbRect((int)(currentLocX * gv.screenDensity) + gv.pS, (int)(currentLocY * gv.screenDensity) + gv.squareSize + 4 * gv.pS, (int)(Width * gv.screenDensity), (int)(Height * gv.screenDensity - gv.squareSize - 4 * gv.pS));
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);
                }
                else if (this.tag.Contains("logPanel") && (gv.screenType.Equals("combat")))
                {
                    dst = new IbRect((int)(currentLocX * gv.screenDensity) + gv.pS, (int)(currentLocY * gv.screenDensity), (int)(Width * gv.screenDensity), (int)(Height * gv.screenDensity));
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);
                }
                else if (this.tag.Contains("logPanel"))
                {
                    dst = new IbRect((int)(currentLocX * gv.screenDensity), (int)(currentLocY * gv.screenDensity), (int)(Width * gv.screenDensity), (int)(Height * gv.screenDensity));
                    gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);
                }
            }
            //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), (int)(Width * gv.screenDensity), (int)(Height * gv.screenDensity));
            //gv.DrawBitmap(gv.cc.GetFromBitmapList(backgroundImageFilename), src, dst, 0, false, 0.75f);

            //iterate over all controls and draw
            //backwerk
            //currentLocX = hiddenLocX;
            bool stopDrawing = false;

            if (this.hidingXIncrement != 0 && this.currentLocX == this.hiddenLocX)
            {
                stopDrawing = true;
            }

            if (this.hidingYIncrement != 0 && this.currentLocY == this.hiddenLocY)
            {
                stopDrawing = true;
            }

            if (!stopDrawing)
            {
                /*
                 * if (this.tag == "arrowPanel")
                 * {
                 *  float xMod = (gv.screenWidth / 1920f);
                 *
                 * }
                 */
                foreach (IB2Button btn in buttonList)
                {
                    //if ((btn.X > -gv.squareSize && btn.Y > -gv.squareSize) || (btn.X < gv.screenWidth + gv.squareSize && btn.Y < gv.screenHeight + gv.squareSize))
                    //{
                    if (!gv.mod.currentArea.isOverviewMap)
                    {
                        btn.Draw(this);
                    }
                    else
                    {
                        if (btn.tag == "btnOwnZoneMap" || btn.tag == "btnMotherZoneMap" || btn.tag == "btnGrandMotherZoneMap")
                        {
                            btn.Draw(this);
                        }
                    }
                    //}
                }
                foreach (IB2ToggleButton btn in toggleList)
                {
                    //if ((btn.X > -gv.squareSize && btn.Y > -gv.squareSize) || (btn.X < gv.screenWidth + gv.squareSize && btn.Y < gv.screenHeight + gv.squareSize))
                    //{
                    if (!gv.mod.currentArea.isOverviewMap)
                    {
                        btn.Draw(this);
                    }
                    //}
                }
                foreach (IB2Portrait btn in portraitList)
                {
                    //if ((btn.X > -gv.squareSize && btn.Y > -gv.squareSize) || (btn.X < gv.screenWidth + gv.squareSize && btn.Y < gv.screenHeight + gv.squareSize))
                    //{
                    if (!gv.mod.currentArea.isOverviewMap)
                    {
                        btn.Draw(this);
                    }
                    //}
                }
            }

            if (!gv.mod.useMinimalisticUI)
            {
                foreach (IB2HtmlLogBox log in logList)
                {
                    log.onDrawLogBox(this);
                }
            }
        }
コード例 #27
0
ファイル: IbbPortrait.cs プロジェクト: grannypron/IB2Engine
        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);
        }
コード例 #28
0
ファイル: ScreenJournal.cs プロジェクト: youngneil1/IB2Engine
        public void redrawJournal()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);

            int locY = pH * 5;
            int locX = 4 * gv.squareSize + pW * 14;
            int textH = (int)gv.cc.MeasureString("GetHeight", gv.drawFontReg, gv.Width).Height;
            int spacing = textH;
            //int spacing = (int)gv.mSheetTextPaint.getTextSize() + pH;
            int leftStartY = pH * 4;
            int tabStartY = pH * 40;

            //DRAW BACKGROUND COLOR
            //gv.gCanvas.Clear(Color.DarkGray);
            //canvas.drawColor(Color.DKGRAY);

            //IF BACKGROUND IS NULL, LOAD IMAGE
            if (journalBack == null)
            {
                journalBack = gv.cc.LoadBitmap("journalback");
            }
            //IF BUTTONS ARE NULL, LOAD BUTTONS
            if (btnReturnJournal == null)
            {
                setControlsStart();
            }

            //DRAW BACKGROUND IMAGE
            IbRect src = new IbRect(0, 0, journalBack.Width, journalBack.Height);
            IbRect dst = new IbRect(6 * gv.squareSize, 0, 7 * gv.squareSize, 9 * gv.squareSize);
            gv.DrawBitmap(journalBack, src, dst);

            //MAKE SURE NO OUT OF INDEX ERRORS
            if (mod.partyJournalQuests.Count > 0)
            {
                if (journalScreenQuestIndex >= mod.partyJournalQuests.Count)
                {
                    journalScreenQuestIndex = 0;
                }
                if (journalScreenEntryIndex >= mod.partyJournalQuests[journalScreenQuestIndex].Entries.Count)
                {
                    journalScreenEntryIndex = 0;
                }
            }

            //DRAW QUESTS
            Color color = Color.Black;
            //gv.mSheetTextPaint.setColor(Color.BLACK);
            gv.DrawText("Active Quests:", locX, locY += leftStartY, 1.0f, color);
            gv.DrawText("--------------", locX, locY += spacing, 1.0f, color);
            if (mod.partyJournalQuests.Count > 0)
            {
                int cnt = 0;
                foreach (JournalQuest jq in mod.partyJournalQuests)
                {
                    if (journalScreenQuestIndex == cnt) { color = Color.Lime; }
                    else { color = Color.Black; }
                    gv.DrawText(jq.Name, locX, locY += spacing, 1.0f, color);
                    cnt++;
                }
            }

            //DRAW QUEST ENTRIES
            locY = tabStartY;
            //gv.mSheetTextPaint.setColor(Color.BLACK);
            gv.DrawText("Quest Entry:", locX, locY, 1.0f, Color.Black);
            gv.DrawText("--------------", locX, locY += spacing, 1.0f, Color.Black);
            if (mod.partyJournalQuests.Count > 0)
            {
                //Description
                string textToSpan = "<font color='black'><i><b>" + mod.partyJournalQuests[journalScreenQuestIndex].Entries[journalScreenEntryIndex].EntryTitle + "</b></i></font><br>";
                textToSpan += mod.partyJournalQuests[journalScreenQuestIndex].Entries[journalScreenEntryIndex].EntryText;

                int yLoc = pH * 18;
                //IbRect rect = new IbRect(locX, locY, pW * 79, pH * 50);
                //gv.DrawText(textToSpan, rect, 1.0f, Color.White);

                description.tbXloc = locX;
                description.tbYloc = locY + spacing;
                description.tbWidth = pW * 30;
                description.tbHeight = pH * 50;
                description.logLinesList.Clear();
                description.AddHtmlTextToLog(textToSpan);
                description.brush.Color = Color.Black;
                description.onDrawLogBox(gv.gCanvas);
            }

            //DRAW INSTRUCTIONS
            //string text = "Up-Down: view quests. <BR>"
            //	    + "Left-Right: view different entries of selected quest.";
            //drawJournalInstructions(canvas, text);

            //DRAW ALL CONTROLS
            ctrlUpArrow.Draw();
            ctrlDownArrow.Draw();
            ctrlLeftArrow.Draw();
            ctrlRightArrow.Draw();
            btnReturnJournal.Draw();
        }
コード例 #29
0
ファイル: GameView.cs プロジェクト: youngneil1/IB2Engine
 public void DrawBitmap(Bitmap bitmap, IbRect source, IbRect target)
 {
     //device.DrawImage(g_walkPass, target, src, GraphicsUnit.Pixel);
     //canvas.drawBitmap(gv.cc.turn_marker, src, dst, null);
     Rectangle tar = new Rectangle(target.Left, target.Top + oYshift, target.Width, target.Height);
     Rectangle src = new Rectangle(source.Left, source.Top, source.Width, source.Height);
     gCanvas.DrawImage(bitmap, tar, src, GraphicsUnit.Pixel);
 }
コード例 #30
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
        }
コード例 #31
0
ファイル: GameView.cs プロジェクト: youngneil1/IB2Engine
        public void DrawRoundRectangle(IbRect rect, int rad, Color penColor, int penWidth)
        {
            //ANDROID canvas.drawRoundRect(new RectF(x + gv.oXshift, y, x + gv.squareSize + gv.oXshift + spellAoEinPixels + spellAoEinPixels, y + gv.squareSize + spellAoEinPixels + spellAoEinPixels), cornerRadius, cornerRadius, pnt);
            //PC      device.DrawRectangle(blackPen, target);

            GraphicsPath gp = new GraphicsPath();
            Pen p = new Pen(penColor, penWidth);

            gp.AddArc(rect.Left, rect.Top + oYshift, rad, rad, 180, 90);
            gp.AddArc(rect.Left + rect.Width - rad, rect.Top + oYshift, rad, rad, 270, 90);
            gp.AddArc(rect.Left + rect.Width - rad, rect.Top + oYshift + rect.Height - rad, rad, rad, 0, 90);
            gp.AddArc(rect.Left, rect.Top + oYshift + rect.Height - rad, rad, rad, 90, 90);
            gp.CloseFigure();

            gCanvas.DrawPath(p, gp);

            p.Dispose();
            gp.Dispose();
        }
コード例 #32
0
        //TITLE SCREEN
        public void redrawLauncher()
        {
            //DRAW TITLE SCREEN
            if ((titleList.Count > 0) && (moduleIndex < titleList.Count))
            {
                IbRect src = new IbRect(0, 0, titleList[moduleIndex].Width, titleList[moduleIndex].Height);
                IbRect dst = new IbRect((gv.screenWidth / 2) - (gv.squareSize * 4), 0, gv.squareSize * 8, gv.squareSize * 4);
                gv.DrawBitmap(titleList[moduleIndex], src, dst);
            }

            //DRAW DESCRIPTION BOX
            if ((moduleList.Count > 0) && (moduleIndex < moduleList.Count))
            {
                string textToSpan = "<u>Module Description</u>" + "<br>";
                //textToSpan += "<b><i><big>" + moduleList[moduleIndex].moduleLabelName + "</big></i></b><br>";
                textToSpan += moduleList[moduleIndex].moduleDescription;
                description.logLinesList.Clear();
                description.AddHtmlTextToLog(textToSpan);
                description.tbXloc = 4 * gv.squareSize + gv.oXshift;
                description.tbYloc = 6 * gv.squareSize + gv.oYshift;
                description.tbWidth = 12 * gv.squareSize;
                description.tbHeight = 6 * gv.squareSize;
                description.onDrawLogBox(gv.gCanvas);

                btnModuleName.Text = moduleList[moduleIndex].moduleLabelName;
                drawLauncherControls();
            }
        }
コード例 #33
0
ファイル: ScreenCombat.cs プロジェクト: youngneil1/IB2Engine
        public void drawCombatMap()
        {
            //row = y
            //col = x
            if (mod.currentEncounter.UseMapImage)
            {
                IbRect src = new IbRect(0, 0, mapBitmap.Width, mapBitmap.Height);
                IbRect dst = new IbRect(0 + gv.oXshift + mapStartLocXinPixels, 0, gv.squareSize * mod.currentEncounter.MapSizeX + gv.oXshift, gv.squareSize * mod.currentEncounter.MapSizeY);
                gv.DrawBitmap(mapBitmap, src, dst);
                //draw grid
                if (mod.com_showGrid)
                {
                    src = new IbRect(0, 0, gv.squareSizeInPixels, gv.squareSizeInPixels);
                    dst = new IbRect(0, 0, gv.squareSize, gv.squareSize);
                    for (int x = 0; x < mod.currentEncounter.MapSizeX; x++)
                    {
                        for (int y = 0; y < mod.currentEncounter.MapSizeY; y++)
                        {
                            dst = new IbRect(x * gv.squareSize + gv.oXshift + mapStartLocXinPixels, y * gv.squareSize, x * gv.squareSize + gv.squareSize + gv.oXshift, y * gv.squareSize + gv.squareSize);
                            if (mod.currentEncounter.encounterTiles[y * mod.currentEncounter.MapSizeX + x].LoSBlocked)
                            {
                                gv.DrawBitmap(gv.cc.losBlocked, src, dst);
                            }
                            if (mod.currentEncounter.encounterTiles[y * mod.currentEncounter.MapSizeX + x].Walkable != true)
                            {
                                gv.DrawBitmap(gv.cc.walkBlocked, src, dst);
                            }
                            else
                            {
                                gv.DrawBitmap(gv.cc.walkPass, src, dst);
                            }
                        }
                    }
                }
            }
            else //using tiles
            {
                IbRect src = new IbRect(0, 0, gv.squareSizeInPixels/2, gv.squareSizeInPixels/2);
                IbRect dst = new IbRect(0 + mapStartLocXinPixels, 0, gv.squareSize, gv.squareSize);
                //for (int x = 0; x < mod.currentEncounter.MapSizeX; x++)
                for (int x = UpperLeftSquare.X; x < this.mod.currentEncounter.MapSizeX; x++)
                {
                    //for (int y = 0; y < mod.currentEncounter.MapSizeY; y++)
                    for (int y = UpperLeftSquare.Y; y < this.mod.currentEncounter.MapSizeY; y++)
                    {
                        if (!IsInVisibleCombatWindow(x,y))
                        {
                            continue;
                        }

                        TileEnc tile = mod.currentEncounter.encounterTiles[y * mod.currentEncounter.MapSizeX + x];

                        int tlX = ((x - UpperLeftSquare.X) * gv.squareSize) + gv.oXshift + mapStartLocXinPixels;
                        int tlY = (y - UpperLeftSquare.Y) * gv.squareSize;
                        int brX = gv.squareSize;
                        int brY = gv.squareSize;

                        dst = new IbRect(tlX, tlY, brX, brY);
                        //dst = new IbRect(x * gv.squareSize + gv.oXshift + mapStartLocXinPixels, y * gv.squareSize, gv.squareSize, gv.squareSize);
                        //draw layer 1
                        gv.DrawBitmap(gv.cc.tileBitmapList[tile.Layer1Filename], src, dst);
                        //draw layer 2
                        gv.DrawBitmap(gv.cc.tileBitmapList[tile.Layer2Filename], src, dst);
                        if (mod.com_showGrid)
                        {
                            if (mod.currentEncounter.encounterTiles[y * mod.currentEncounter.MapSizeX + x].LoSBlocked)
                            {
                                gv.DrawBitmap(gv.cc.losBlocked, src, dst);
                            }
                            if (mod.currentEncounter.encounterTiles[y * mod.currentEncounter.MapSizeX + x].Walkable != true)
                            {
                                gv.DrawBitmap(gv.cc.walkBlocked, src, dst);
                            }
                            else
                            {
                                gv.DrawBitmap(gv.cc.walkPass, src, dst);
                            }
                        }
                        if (pf.values != null)
                        {
                            gv.DrawText(pf.values[x, y].ToString(), (x - UpperLeftSquare.X) * gv.squareSize + gv.oXshift + mapStartLocXinPixels, (y - UpperLeftSquare.Y) * gv.squareSize);
                        }
                    }
                }

                //for (int x = 0; x < this.mod.currentArea.MapSizeX; x++)
                /*for (int x = minX; x < maxX; x++)
                {
                    //for (int y = 0; y < this.mod.currentArea.MapSizeY; y++)
                    for (int y = minY; y < maxY; y++)
                    {
                        int tlX = (x - mod.PlayerLocationX + gv.playerOffset) * gv.squareSize;
                        int tlY = (y - mod.PlayerLocationY + gv.playerOffset) * gv.squareSize;
                        int brX = gv.squareSize;
                        int brY = gv.squareSize;

                        Tile tile = mod.currentArea.Tiles[y * mod.currentArea.MapSizeX + x];

                        IbRect src1 = new IbRect(0, 0, gv.cc.tileBitmapList[tile.Layer1Filename].Width, gv.cc.tileBitmapList[tile.Layer1Filename].Height);
                        IbRect src2 = new IbRect(0, 0, gv.cc.tileBitmapList[tile.Layer2Filename].Width, gv.cc.tileBitmapList[tile.Layer2Filename].Height);
                        IbRect dst = new IbRect(tlX + gv.oXshift, tlY, brX, brY);

                        gv.DrawBitmap(gv.cc.tileBitmapList[tile.Layer1Filename], src1, dst);
                        gv.DrawBitmap(gv.cc.tileBitmapList[tile.Layer2Filename], src2, dst);
                    }
                }*/
            }
        }