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); } }
//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(); } }
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); }
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); }
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); }
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); } } }
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); } } }
//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(); }
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); } } }
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); } }
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); }
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); } }
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(); }
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); } } }
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 }