Skip to content

Commit b2a7004

Browse files
committed
added two VNSettings properties
1 parent 01a0016 commit b2a7004

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

BenMakesGames.PlayPlayMini.VN/BenMakesGames.PlayPlayMini.VN.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Company>Ben Hendel-Doying</Company>
66
<Description>Add-on for PlayPlayMini to facilitate adding visual novel segments to your games.</Description>
77
<Copyright>2026 Ben Hendel-Doying</Copyright>
8-
<Version>1.0.0-rc1</Version>
8+
<Version>1.0.0-rc2</Version>
99

1010
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1111
<PackageTags>visual novel engine monogame</PackageTags>

BenMakesGames.PlayPlayMini.VN/Model/SceneController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public void Click()
186186
if (WrappedText.Count == 0)
187187
return;
188188

189-
if(TimeAlive * 40 < WrappedText[0].Length)
190-
TimeAlive = WrappedText[0].Length / 40.0;
189+
if(TimeAlive * VNSettings.DialogSpeed < WrappedText[0].Length)
190+
TimeAlive = WrappedText[0].Length / VNSettings.DialogSpeed;
191191
else
192192
{
193193
WrappedText.RemoveAt(0);
@@ -207,8 +207,8 @@ public void Draw(GraphicsManager graphics, int xOffset)
207207

208208
var text = WrappedText[0].AsSpan();
209209

210-
if (TimeAlive * 40 < WrappedText[0].Length)
211-
text = text[..(int)(TimeAlive * 40)];
210+
if (TimeAlive * VNSettings.DialogSpeed < WrappedText[0].Length)
211+
text = text[..(int)(TimeAlive * VNSettings.DialogSpeed)];
212212

213213
if (DialogStyle == DialogStyle.Speaking)
214214
{

BenMakesGames.PlayPlayMini.VN/Model/StoryStep.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ public StoryStep SetMiniGame<TGameState, TGameStateConfig>(TGameStateConfig conf
3030
return this;
3131
}
3232

33-
public StoryStep SetCharacterDialog(Character speaker, string text, int lines = 2)
33+
public StoryStep SetCharacterDialog(Character speaker, string text, int? rows = null)
3434
{
35-
Dialog = new CharacterDialog(text, speaker, lines);
35+
Dialog = new CharacterDialog(text, speaker, rows ?? VNSettings.DialogDefaultRows);
3636
return this;
3737
}
3838

39-
public StoryStep SetTransparentDialog(string text, bool invertedText = false, int lines = 2)
39+
public StoryStep SetTransparentDialog(string text, bool invertedText = false, int? rows = null)
4040
{
41-
Dialog = new TransparentDialog(text, invertedText, lines);
41+
Dialog = new TransparentDialog(text, invertedText, rows ?? VNSettings.DialogDefaultRows);
4242
return this;
4343
}
4444

45-
public StoryStep SetThinkingDialog(string text, int lines = 2)
45+
public StoryStep SetThinkingDialog(string text, int? rows = null)
4646
{
47-
Dialog = new ThinkingDialog(text, lines);
47+
Dialog = new ThinkingDialog(text, rows ?? VNSettings.DialogDefaultRows);
4848
return this;
4949
}
5050
}

BenMakesGames.PlayPlayMini.VN/VNSettings.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.Xna.Framework;
1+
using BenMakesGames.PlayPlayMini.VN.Model;
2+
using Microsoft.Xna.Framework;
23

34
namespace BenMakesGames.PlayPlayMini.VN;
45

@@ -21,6 +22,16 @@ public static class VNSettings
2122
/// </summary>
2223
public static string DialogFont { get; set; } = "Font";
2324

25+
/// <summary>
26+
/// Default number of rows of text to give dialog boxes when using <see cref="StoryStep.SetCharacterDialog"/> and similar.
27+
/// </summary>
28+
public static int DialogDefaultRows { get; set; } = 2;
29+
30+
/// <summary>
31+
/// The speed at which dialog text is displayed.
32+
/// </summary>
33+
public static float DialogSpeed { get; set; } = 40;
34+
2435
/// <summary>
2536
/// If this is set, characters will be drawn with a 1px outline in this color.
2637
/// </summary>

0 commit comments

Comments
 (0)