forked from vipoo/iRacingReplayOverlay.net
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into azure-pipelines
- Loading branch information
Showing
21 changed files
with
761 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule iRacingSDK.Net
updated
8 files
Submodule NoOverlay
deleted from
1ca876
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*.suo | ||
*.userprefs | ||
**/bin/* | ||
**/obj/* | ||
**/SampleRaceStream.bin | ||
packages/ | ||
TestResult.xml | ||
iRacingReplayOverlay.net.Tests.VisualState.xml | ||
publish/ | ||
publish-beta/ | ||
**/*.csproj.user | ||
**/*.log | ||
deploy/* | ||
!deploy/.keep | ||
!deploy/test/.keep | ||
Application Files | ||
setup.exe | ||
iRacingReplayOverlay.test.application | ||
.vs/* | ||
tools/encrypt.cmd | ||
Aws/AwsKeyActual.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using iRacingDirector.Plugin; | ||
using System.Drawing; | ||
using System.Drawing.Drawing2D; | ||
|
||
namespace NoOverlay | ||
{ | ||
public partial class MyPlugin | ||
{ | ||
public Driver CamDriver; | ||
|
||
void DrawCurrentDriverRow() | ||
{ | ||
var position = CamDriver.Position != null ? CamDriver.Position.Value.ToString() : ""; | ||
var indicator = CamDriver.Position != null ? CamDriver.Position.Value.Ordinal() : ""; | ||
|
||
var offset = 5; | ||
|
||
Graphics.InRectangle(1920 / 2 - 440 / 2, 980, 70, 40) | ||
.WithBrush(Styles.YellowBrush) | ||
.WithPen(Styles.BlackPen) | ||
.DrawRectangleWithBorder() | ||
.WithFontSizeOf(24) | ||
.WithBrush(Styles.BlackBrush) | ||
.WithStringFormat(StringAlignment.Near) | ||
.Center(cg => cg | ||
.DrawText(position, topOffset: offset) | ||
.AfterText(position) | ||
.MoveRight(3) | ||
.WithFont(Settings.FontName, 18, FontStyle.Bold) | ||
.DrawText(indicator, topOffset: offset) | ||
) | ||
|
||
.ToRight(width: 70) | ||
.WithLinearGradientBrush(Styles.White, Styles.WhiteSmoke, LinearGradientMode.BackwardDiagonal) | ||
.DrawRectangleWithBorder() | ||
.WithStringFormat(StringAlignment.Center) | ||
.WithBrush(Styles.BlackBrush) | ||
.DrawText(CamDriver.CarNumber, topOffset: offset) | ||
|
||
.ToRight(width: 300) | ||
.WithLinearGradientBrush(Styles.White, Styles.WhiteSmoke, LinearGradientMode.BackwardDiagonal) | ||
.DrawRectangleWithBorder() | ||
.WithStringFormat(StringAlignment.Center) | ||
.WithBrush(Styles.BlackBrush) | ||
.DrawText(CamDriver.UserName, topOffset: offset); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using iRacingDirector.Plugin; | ||
using System; | ||
using System.Drawing; | ||
using System.Drawing.Drawing2D; | ||
|
||
namespace NoOverlay | ||
{ | ||
public static class MyPluginExtensions | ||
{ | ||
public static string FormattedForLeaderboard(this string shortName) | ||
{ | ||
var length = Math.Min(4, shortName.Length); | ||
return shortName.Substring(0, length).ToUpper(); | ||
} | ||
|
||
public static GraphicRect DrawBlackBackground(this GraphicRect rr) | ||
{ | ||
return rr | ||
.WithBrush(Styles.TransparentLightBlack) | ||
.WithPen(Styles.WhitePen) | ||
.DrawRectangleWithoutBorder(); | ||
} | ||
|
||
public static GraphicRect DrawGrayBackground(this GraphicRect rr) | ||
{ | ||
return rr | ||
.WithBrush(Styles.TransparentLightGray) | ||
.WithPen(Styles.WhitePen) | ||
.DrawRectangleWithoutBorder(); | ||
} | ||
|
||
public static GraphicRect DrawWhiteText(this GraphicRect rr, string text, StringAlignment alignment) | ||
{ | ||
rr.WithBrush(Styles.WhiteBrush) | ||
.WithStringFormat(alignment) | ||
.DrawText(text); | ||
|
||
return rr; | ||
} | ||
|
||
public static GraphicRect WithFontSizeOf(this GraphicRect rr, int fontSize) | ||
{ | ||
return rr | ||
.WithFont(Settings.FontName, fontSize, FontStyle.Regular); | ||
} | ||
|
||
public static GraphicRect DrawWhiteGradiantBox(this GraphicRect rr) | ||
{ | ||
return rr | ||
.WithLinearGradientBrush(Color.DarkGray, Color.White, LinearGradientMode.Vertical) | ||
.WithPen(Styles.BlackPen) | ||
.DrawRectangleWithBorder() | ||
.WithBrush(Styles.BlackBrush); | ||
} | ||
|
||
public static GraphicRect DrawRedGradiantBox(this GraphicRect rr) | ||
{ | ||
return rr | ||
.WithHeight(rr.Rectangle.Height + 3) | ||
.MoveUp(3) | ||
.WithLinearGradientBrush(Styles.RedBannerDark, Styles.RedBannerLight, LinearGradientMode.Vertical) | ||
.DrawRoundRectangle(5) | ||
.WithBrush(Styles.WhiteBrush); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using iRacingDirector.Plugin; | ||
using System; | ||
using System.Drawing; | ||
|
||
namespace NoOverlay | ||
{ | ||
public partial class MyPlugin | ||
{ | ||
public FastLap FastLap; | ||
|
||
void DrawFastestLap() | ||
{ | ||
if (FastLap == null) | ||
return; | ||
|
||
const int left = 1920 - 80 - 450; | ||
const int top = 900; | ||
|
||
Graphics.InRectangle(left, top + 34, 400, 34) | ||
.DrawRedGradiantBox(); | ||
|
||
Graphics.InRectangle(left, top + 34, 250, 34) | ||
.WithBrush(Styles.WhiteBrush) | ||
.WithFontSizeOf(19) | ||
.WithStringFormat(StringAlignment.Center) | ||
.DrawText(FastLap.Driver.UserName, topOffset: 5) | ||
.ToRight(width: 150) | ||
.DrawText(TimeSpan.FromSeconds(FastLap.Time).ToString(@"mm\:ss\.fff"), topOffset: 5); | ||
|
||
Graphics.InRectangle(left, top, 400, 34) | ||
.DrawWhiteGradiantBox() | ||
.WithBrush(Styles.BlackBrush) | ||
.WithFontSizeOf(18) | ||
.WithStringFormat(StringAlignment.Center) | ||
.DrawText("New Fast Lap", topOffset: 5); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using iRacingDirector.Plugin; | ||
using System.Drawing; | ||
|
||
namespace NoOverlay | ||
{ | ||
public partial class MyPlugin | ||
{ | ||
GraphicRect DrawFlashCardHeading(string title) | ||
{ | ||
var displayName = EventData.WeekendInfo.TrackDisplayName.ToUpper(); | ||
|
||
Graphics.InRectangle(FlashCardLeft, 250, FlashCardWidth, 575) | ||
.DrawGrayBackground(); | ||
|
||
Graphics.InRectangle(FlashCardLeft - 10, 311 - 2, FlashCardWidth - 100, 48) | ||
.DrawRedGradiantBox() | ||
.MoveDown(7) | ||
.MoveRight(20) | ||
.WithFontSizeOf(23) | ||
.WithStringFormat(StringAlignment.Near) | ||
.DrawText(title, topOffset: 4); | ||
|
||
Graphics.InRectangle(FlashCardLeft - 10, 240, FlashCardWidth - 100, 72) | ||
.DrawWhiteGradiantBox() | ||
.MoveDown(7) | ||
.MoveRight(20) | ||
.WithFontSizeOf(23) | ||
.WithStringFormat(StringAlignment.Near) | ||
.DrawText(displayName) | ||
.MoveDown(32) | ||
.WithFontSizeOf(17) | ||
.WithStringFormat(StringAlignment.Near) | ||
.DrawText(EventData.WeekendInfo.TrackCity.ToUpper() + ", " + EventData.WeekendInfo.TrackCountry.ToUpper()); | ||
|
||
return Graphics.InRectangle(FlashCardLeft + 30, 400, 60, 40) | ||
.WithPen(Styles.BlackPen) | ||
.WithBrush(Styles.BlackBrush) | ||
.WithFontSizeOf(20) | ||
.WithStringFormat(StringAlignment.Near); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using iRacingDirector.Plugin; | ||
using System; | ||
using System.Drawing; | ||
using System.Linq; | ||
|
||
namespace NoOverlay | ||
{ | ||
public partial class MyPlugin | ||
{ | ||
void DrawIntroFlashCard(int page) | ||
{ | ||
var r = DrawFlashCardHeading("Qualifying Results"); | ||
|
||
DrawFlashCardIntro(r, page); | ||
} | ||
|
||
void DrawFlashCardIntro(GraphicRect r, int page) | ||
{ | ||
var totalWidth = FlashCardWidth; | ||
var left = FlashCardLeft; | ||
|
||
var thisPageOfQualifyingResults = EventData.QualifyingResults.Skip(page * DriversPerPage).Take(DriversPerPage); | ||
|
||
var offset = 5; | ||
Graphics.InRectangle(left, r.Rectangle.Top, totalWidth, 10) | ||
.WithPen(Styles.ThickBlackPen) | ||
.DrawLine(left + 8, r.Rectangle.Top - offset, left + totalWidth - 16, r.Rectangle.Top - offset); | ||
|
||
foreach (var qualifier in thisPageOfQualifyingResults) | ||
{ | ||
var driver = EventData.GetCompetingDriverByIndex(qualifier.CarIdx); | ||
|
||
r.Center(cg => cg | ||
.DrawText(qualifier.Position.ToString()) | ||
.AfterText(qualifier.Position.ToString()) | ||
.MoveRight(1) | ||
.WithFont(Settings.FontName, 16, FontStyle.Bold) | ||
.DrawText(qualifier.Position.Ordinal())) | ||
.ToRight(width: 120, left: 30) | ||
.DrawText(TimeSpan.FromSeconds(qualifier.FastestTime).ToString("mm\\:ss\\.ff")) | ||
.ToRight(width: 60) | ||
.DrawText(driver.CarNumber) | ||
.ToRight(width: 300) | ||
.DrawText(driver.UserName); | ||
|
||
r = r.ToBelow(); | ||
|
||
Graphics.InRectangle(left, r.Rectangle.Top, totalWidth, 10) | ||
.WithPen(Styles.ThickBlackPen) | ||
.DrawLine(left + 8, r.Rectangle.Top - offset, left + totalWidth - 16, r.Rectangle.Top - offset); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using iRacingDirector.Plugin; | ||
using System; | ||
using System.Drawing; | ||
using System.Linq; | ||
|
||
namespace NoOverlay | ||
{ | ||
public partial class MyPlugin | ||
{ | ||
public Driver[] PreferredDriverNames; | ||
|
||
void DrawOutroFlashCard(int page) | ||
{ | ||
var r = DrawFlashCardHeading("Race Results"); | ||
|
||
DrawFlashCardOutro(r, page); | ||
} | ||
|
||
void DrawFlashCardOutro(GraphicRect r, int page) | ||
{ | ||
var rsession = EventData.Race; | ||
var results = EventData.Results; | ||
|
||
var offset = 5; | ||
Graphics.InRectangle(FlashCardLeft, r.Rectangle.Top, FlashCardWidth, 10) | ||
.WithPen(Styles.ThickBlackPen) | ||
.DrawLine(FlashCardLeft + 8, r.Rectangle.Top - offset, FlashCardLeft + FlashCardWidth - 16, r.Rectangle.Top - offset); | ||
|
||
var LeaderTime = TimeSpan.FromSeconds(results[0].Time); | ||
|
||
foreach (var racerResult in results.Skip(DriversPerPage * page).Take(DriversPerPage)) | ||
{ | ||
var driver = EventData.GetCompetingDriverByIndex(racerResult.CarIdx); | ||
|
||
var Gap = TimeSpan.FromSeconds(racerResult.Time) - LeaderTime; // Gap calculation | ||
if (Gap == TimeSpan.Zero) //For the leader we want to display the race duration | ||
Gap = LeaderTime; | ||
|
||
r.WithBrush(PreferredDriverNames.Any(d => d.UserName == driver.UserName) ? Styles.RedBrush : Styles.BlackBrush); | ||
|
||
r.Center(cg => cg | ||
.DrawText(racerResult.Position.ToString()) | ||
.AfterText(racerResult.Position.ToString()) | ||
.MoveRight(1) | ||
.WithFont(Settings.FontName, 16, FontStyle.Bold) | ||
.DrawText(racerResult.Position.Ordinal())) | ||
.ToRight(width: 190, left: 30) | ||
.DrawText(Gap.ToString("hh\\:mm\\:ss\\.fff")) | ||
.ToRight(width: 80, left: 20) | ||
.DrawText(driver.CarNumber) | ||
.ToRight(width: 350) | ||
.DrawText(driver.UserName); | ||
|
||
r = r.ToBelow(); | ||
|
||
Graphics.InRectangle(FlashCardLeft, r.Rectangle.Top, FlashCardWidth, 10) | ||
.WithPen(Styles.ThickBlackPen) | ||
.DrawLine(FlashCardLeft + 8, r.Rectangle.Top - offset, FlashCardLeft + FlashCardWidth - 16, r.Rectangle.Top - offset); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.