Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a614167
Move common DialoguePage stuff to new TextPage class
PringlesGang Mar 13, 2026
6813b93
Move text parsing to separate class
PringlesGang Mar 24, 2026
020cec5
Use ScrWork page mode instead of a stored member
PringlesGang Mar 28, 2026
4fae377
Separate BacklogEntry text parsing out
PringlesGang Mar 28, 2026
bc22703
Separate TipsPage text parsing out
PringlesGang Mar 30, 2026
4df2b8a
Fix 'pronounciation' typo
PringlesGang Mar 30, 2026
f1d8da2
Only push backlog entry at the end of InstMesMain
PringlesGang Mar 30, 2026
4e6f2ea
Change token parsers to templated functions, and store them in a LUT
PringlesGang Apr 10, 2026
c474613
Fix JP wordwrap
PringlesGang Apr 10, 2026
18f5221
Add std::pair fallback for DialogueColorPair profile parser
PringlesGang Apr 11, 2026
bef21e9
Remove redundant PageMode checks in STT_UnlockTip parser
PringlesGang Apr 11, 2026
14e80b2
Touch up ruby and linebreak logic
PringlesGang Apr 11, 2026
0fec2e7
Fix DialoguePage clear logic
PringlesGang Apr 13, 2026
5cbb7c5
Move InstMSinit DialoguePage initialization further down
PringlesGang Apr 19, 2026
e1131a1
Implement InstSetMesModeFormat
PringlesGang Apr 19, 2026
f885686
Add DialoguePage reference to DialogueBox
PringlesGang Apr 19, 2026
14e974c
Draw Erin textbox in position based on ScrWork
PringlesGang Apr 19, 2026
370babf
Add transformation matrix to text rendering
PringlesGang Apr 27, 2026
732d919
Have text parsing positioning be based on TextModeInfo
PringlesGang Apr 27, 2026
760d0ab
Position name based on TextModeInfo
PringlesGang May 10, 2026
4c0e8b4
Fix chlcc dialoguebox sprite definition
PringlesGang May 11, 2026
7ef177b
Decouple CurrentLineTop from MesWindow top
PringlesGang May 16, 2026
f5f26e1
Use RubyDispMode
PringlesGang May 21, 2026
6ce6faf
Split up different generations of nametag positioning, because of cou…
PringlesGang May 30, 2026
92e3cd4
Remove chlcc backlog main entries being rendered twice
PringlesGang May 31, 2026
5d7dafa
Fix cclcc backlog entry rendering layout
PringlesGang May 31, 2026
d1e747f
Simplify RubyChunk interface
PringlesGang Jun 1, 2026
db1e096
Fix backlog entry center positioning
PringlesGang Jun 9, 2026
fe3bedf
Remove unused profile variables
PringlesGang Jun 1, 2026
fe5d0f4
Add TextModeInfo endpoints to profile
PringlesGang Jun 2, 2026
4f2ddc5
Allow for glyphs to be mapped to multiple indices in the charset (in …
PringlesGang Jun 2, 2026
d9fe446
Calculate TextPage Bounds when adding a string
PringlesGang Jun 9, 2026
14595e5
Add support for double newlines
PringlesGang Jun 10, 2026
1732c80
Fade Erin textbox
PringlesGang Jun 10, 2026
b98592e
Don't request pointer when hovering a scrollable area
PringlesGang Jun 10, 2026
a852de2
fixup! Change token parsers to templated functions, and store them in…
PringlesGang Jun 11, 2026
f63c123
fixup! Only push backlog entry at the end of InstMesMain
PringlesGang Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ set(Impacto_Src
src/voicetable.cpp
src/animation.cpp

src/text/backlogpage.cpp
src/text/text.cpp
src/text/textpage.cpp
src/text/textparser.cpp
src/text/tipspage.cpp
src/text/typewritereffect.cpp
src/text/dialoguepage.cpp

Expand Down Expand Up @@ -398,7 +402,11 @@ set(Impacto_Header
src/rng.h
src/animation.h

src/text/backlogpage.h
src/text/text.h
src/text/textpage.h
src/text/textparser.h
src/text/tipspage.h
src/text/typewritereffect.h
src/text/dialoguepage.h

Expand Down
15 changes: 3 additions & 12 deletions profiles/cc/dialogue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ root.Sprites["WaitIconSprite"] = {
};

root.Dialogue = {
REVBounds = { X = 547, Y = 0, Width = 1043, Height = 400 },
REVNameFontSize = 48,
TipsMessageModeIdx = 7,

REVMessageModeIdx = 9,
REVColor = 0,
REVNameColor = 61, -- Unsure
REVNameOffset = 22,
REVNameLocation = REVNameLocationType.LeftTop,
REVOutlineMode = 1,
REVNameOutlineMode = 1,
NVLBounds = { X = 188, Y = 128, Width = 1536, Height = 600 },
ADVBounds = { X = 330, Y = 795, Width = 1240, Height = 270 },
ADVBoxSprite = "ADVBox",
ADVBoxMask = "ADVBoxMask",
ADVBoxEffectDuration = 10,
Expand All @@ -35,10 +32,6 @@ root.Dialogue = {
DialogueBoxCurrentType = DialogueBoxType.CC,
NVLBoxMaxOpacity = 0.55,

ADVNameAlignment = TextAlignment.Left,
ADVNameFontSize = 33,
ADVNamePos = { X = 173, Y = 773 },

NametagCurrentType = NametagType.CC,

NametagMainSprites = {},
Expand All @@ -61,8 +54,6 @@ root.Dialogue = {
DialogueFont = "Default",
SetFontSizeRatio = 800.0,
DefaultFontSize = 48,
RubyFontSize = 21,
RubyYOffset = -21,
ColorTable = {
{0xFFFFFF, 0x000000}, {0x5080FF, 0x000000},
{0xFF7080, 0x000000}, {0xFFA0F8, 0x000000},
Expand Down
40 changes: 27 additions & 13 deletions profiles/cclcc/dialogue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ root.Sprites["ADVBoxMask"] = {
};

root.Dialogue = {
TipsBounds = { X = 1042, Y = 394, Width = 720, Height = 542 },
TipsMessageModeIdx = 7,
TipsColorIndex = 10,
REVBounds = { X = 547, Y = 0, Width = 1043, Height = 400 },
REVNameFontSize = 42,
REVMessageModeIdx = 9,
REVColor = 10, -- Absolute guess
REVNameColor = 0,
REVNameOffset = 18,
REVNameLocation = REVNameLocationType.LeftTop,
REVOutlineMode = 0,
REVNameOutlineMode = 2,
NVLBounds = { X = 188, Y = 128, Width = 1536, Height = 600 },
ADVBounds = { X = 330, Y = 800, Width = 1250, Height = 270 },
ADVBoxSprite = "ADVBox",
ADVBoxMask = "ADVBoxMask",
ADVBoxEffectDuration = 10,
Expand All @@ -32,10 +27,6 @@ root.Dialogue = {
DialogueBoxCurrentType = DialogueBoxType.CC,
NVLBoxMaxOpacity = 0.55,

ADVNameAlignment = TextAlignment.Left,
ADVNameFontSize = 33,
ADVNamePos = { X = 173, Y = 773 },

NametagCurrentType = NametagType.CC,

NametagMainSprites = {},
Expand All @@ -62,8 +53,6 @@ root.Dialogue = {
DialogueFont = "Default",
SetFontSizeRatio = 800.0,
DefaultFontSize = 42,
RubyFontSize = 21,
RubyYOffset = -21,
ColorTable = {
{0xFFFFFF, 0x000000}, {0x5080FF, 0x000000},
{0xFF7080, 0x000000}, {0xFFA0F8, 0x000000},
Expand Down Expand Up @@ -104,6 +93,31 @@ root.Dialogue = {
MaxPageSize = 2000,
PageCount = 3,
ColorTagIsUint8 = false,

TextModesInfo = root.Language == "English" and {
["0"] = { -- ADV box
WindowPos = { X = 220 * 1.5, Y = (518 + 11 + 5 + 1) * 1.5 }, -- Correct for missing ruby space
TextGlyphSize = { X = 38, Y = 38 },
LineSpacing = (1 + 5 + 1) * 1.5 - 3, -- (RubySpacing + RubyHeight + LineSpacing) * 1.5 - 3
AlwaysAddRubySpacing = false,
},
["1"] = { -- NVL box
TextGlyphSize = { X = 38, Y = 38 },
LineSpacing = (1 + 5 + 1) * 1.5 - 3,
AlwaysAddRubySpacing = false,
},
["7"] = { -- Tips box
TextGlyphSize = { X = 38, Y = 38 },
LineSpacing = (1 + 5 + 1) * 1.5 - 3,
AlwaysAddRubySpacing = false,
},
["9"] = { -- Backlog entry
NameGlyphSize = { X = 38, Y = 38 },
TextGlyphSize = { X = 38, Y = 38 },
LineSpacing = (1 + 5 + 1) * 1.5 - 3,
AlwaysAddRubySpacing = false,
}
} or {},
};

MakeAnimation({
Expand Down
4 changes: 2 additions & 2 deletions profiles/cclcc/hud/backlogmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ root.BacklogMenu = {

EntryHighlightSprite = "EntryHighlight",
EntryHighlightLocation = EntryHighlightLocationType.TopLineLeftOfScreen,
EntryHighlightOffset = { X = 0, Y = -3 },
EntryHighlightOffset = { X = 0, Y = -6 },
EntryHighlightPadding = 4.0,

VoiceIconSprite = "VoiceIcon",
VoiceIconOffset = { X = -16, Y = 0 },
VoiceIconOffset = { X = -16, Y = -7 },

ScrollbarTrackSprite = "ScrollbarTrack",
ScrollbarThumbSprite = "ScrollbarThumb",
Expand Down
5 changes: 3 additions & 2 deletions profiles/cclcc/hud/tipsmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ root.TipsMenu = {
TipsTextTableIndex = 2,
TipsTextEntryLockedIndex = 7,
TipsTextSortStringIndex = 10,
TipsTextPageHeight = 485,

CategoryPos = { X = 1230, Y = 76},
CategoryFontSize = 40,
NamePos = { X = 1020, Y = 170},
NameFontSize = 54,
NumberPos = { X = 1875, Y = 80},
NumberFontSize = 62,
PronounciationPos = { X = 1020, Y = 246},
PronounciationFontSize = 34,
PronunciationPos = { X = 1020, Y = 246},
PronunciationFontSize = 34,

TipsEntryNameUnreadColor = 0x117733,
TipsMenuDarkTextColor = 0x3e3e3c,
Expand Down
56 changes: 34 additions & 22 deletions profiles/chlcc/dialogue.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
root.Sprites["ADVBox"] = {
Sheet = "Data",
Bounds = { X = 768, Y = 815, Width = 1280, Height = 206 },
Bounds = { X = 769, Y = 811, Width = 1278, Height = 212 },
};
root.Sprites["SecondaryADVBox"] = {
Sheet = "Data",
Bounds = { X = 768, Y = 427, Width = 1280, Height = 206 },
Bounds = { X = 769, Y = 423, Width = 1278, Height = 212 },
};
root.Sprites["ErinBox"] = {
Sheet = "Data",
Bounds = { X = 36, Y = 143, Width = 541, Height = 168 },
Bounds = { X = 35, Y = 142, Width = 732, Height = 225 },
};
root.Sprites["AutoSkipArrowsSprite"] = {
Sheet = "Data",
Expand All @@ -24,24 +24,18 @@ root.Sprites["SkipIconSprite"] = {
};

root.Dialogue = {
TipsBounds = { X = 404, Y = 150, Width = 800, Height = 420 },
TipsMessageModeIdx = 7,
TipsColorIndex = 0,
REVBounds = { X = 337, Y = 159, Width = 952, Height = 555 },
SecondaryREVBounds = {X = 338, Y = 159, Width = 480, Height = 106},
ErinBoxSprite = "ErinBox",
ErinBoxPos = { X = 314, Y = 156 },
REVNameFontSize = 32,
ErinBoxPos = { X = -25, Y = -23 },
REVMessageModeIdx = 9,
REVColor = 0,
REVNameColor = 24,
REVNameOffset = 34,
REVNameLocation = REVNameLocationType.TopLeft,
REVOutlineMode = 2,
REVNameOutlineMode = 2,
NVLBounds = { X = 125, Y = 85, Width = 1024, Height = 400 },
ADVBounds = { X = 161, Y = 546, Width = 928, Height = 180 },
ADVBoxSprite = "ADVBox",
SecondaryADVBoxSprite = "SecondaryADVBox",
ADVBoxPos = { X = -1, Y = 512 },
ADVBoxPos = { X = 0, Y = 508 },
FadeOutDuration = 0.33,
FadeInDuration = 0.33,
TextFadeInDuration = 0.33,
Expand All @@ -62,13 +56,8 @@ root.Dialogue = {
REVWaitIconOffset = { X = 4, Y = -4 },
WaitIconOffset = { X = 4, Y = 4 },
DialogueFont = "Default",
REVLineHeight = 24,
REVLineSpacing = root.Language == "Japanese" and 16 or 0,
REVFontSize = 24,
SetFontSizeRatio = 1000.0,
DefaultFontSize = 32,
RubyFontSize = 14,
RubyYOffset = -18,
ColorTable = {
{0xFFFFFF, 0x000000}, {0x5080FF, 0x000000},
{0xFF7080, 0x000000}, {0xFFA0F8, 0x000000},
Expand Down Expand Up @@ -111,13 +100,36 @@ root.Dialogue = {
PageCount = 3,
ColorTagIsUint8 = false,

ADVNameAlignment = TextAlignment.Left,
ADVNameFontSize = 29,
ADVNamePos = { X = 132, Y = 470 },
OldNametagPositioning = true,
NametagCurrentType = NametagType.CHLCC,
NametagPosition = { X = -1, Y = 465 },
NametagSprite = "NametagSprite",
SecondaryNametagSprite = "SecondaryNametagSprite"
SecondaryNametagSprite = "SecondaryNametagSprite",

TextModesInfo = root.Language == "English" and {
["0"] = { -- ADV box
WindowPos = { X = 161, Y = 540 },
NamePos = { X = -440, Y = -68 },
NameGlyphSize = { X = 30, Y = 30 },
LineSpacing = 3,
AlwaysAddRubySpacing = false,
},
["1"] = { -- NVL box
LineSpacing = 3,
AlwaysAddRubySpacing = false,
},
["2"] = { -- Erin box
WindowPos = { X = 334, Y = 206 + 1 + 14 * 24 / 32 }, -- Adjust for ruby spacing
LineSpacing = 3,
AlwaysAddRubySpacing = false,
},
["7"] = { -- Tips box
LineSpacing = 3,
},
["9"] = { -- Backlog entry
LineSpacing = 3,
}
} or {},
};

MakeAnimation({
Expand Down
2 changes: 1 addition & 1 deletion profiles/chlcc/hud/backlogmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ root.BacklogMenu = {
ScrollbarTrackSprite = "ScrollbarTrack",
ScrollbarThumbLength = 59,
ScrollbarPosition = { X = 1183, Y = 92 },
EntriesStart = { X = 123, Y = 105 },
EntriesStart = { X = 0, Y = 105 },
RenderingBounds = { X = 87, Y = 89, Width = 1086, Height = 539 },
EntryYPadding = 20,
HoverBounds = { X = 75, Y = 89, Width = 1086, Height = 535 },
Expand Down
4 changes: 2 additions & 2 deletions profiles/chlcc/hud/tipsmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ root.TipsMenu = {
PageSeparatorPosition = { X = 1181, Y = 611 },
DefaultColorIndex = 0,
UnreadColorIndex = 70,
PronounciationFontSize = 18,
PronunciationFontSize = 18,
NameFontSize = 30,
TipListEntryNameXOffset = 55,
NameInitialBounds = { X = 1210, Y = 80, Width = 0, Height = 0 },
PronounciationInitialBounds = { X = 1210, Y = 110, Width = 0, Height = 0 },
PronunciationInitialBounds = { X = 1210, Y = 110, Width = 0, Height = 0 },
TipsListEntryDotOffset = { X = -17, Y = -4},
TipsListNewDotOffset= { X = -40, Y = -4},
TipScrollbarPos = { X = 359, Y = 127},
Expand Down
5 changes: 5 additions & 0 deletions profiles/chlcc/scriptvars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local sv = root.ScriptVars;

sv.SW_MESNAMEID0 = 0; -- Disable
sv.SW_TOTALPLAYTIME = 990;
sv.SW_MESWINDOW0ALPHA = 1006;
sv.SW_GAMESTATE = 1012;
sv.SW_TITLEDISPCT = 1014;
sv.SW_TITLEMASKALPHA = 1033;
Expand All @@ -17,6 +18,8 @@ sv.SW_MOVIEMODE_CUR = 1101;
sv.SW_ALBUM_ALPHA = 1105;
sv.SW_LINEID = 1145;
sv.SW_SCRIPTID = 1146;
sv.SW_MESWIN0POSX_OFS = 1580;
sv.SW_MESWIN0POSY_OFS = 1581;
sv.SW_MASK1ALPHA_OFS = 1586;
sv.SW_MASK2ALPHA_OFS = 1587;
sv.SW_MASK3ALPHA_OFS = 1588;
Expand Down Expand Up @@ -57,6 +60,8 @@ sv.SW_MASK1SIZEX = 2334;
sv.SW_MASK1SIZEY = 2335;
sv.SW_MOSAIC_PRI = 2350;
sv.SW_MOSAIC = 2353;
sv.SW_MESWIN0POSX = 3170;
sv.SW_MESWIN0POSY = 3171;
sv.SW_MESWIN0TYPE = 3172;
sv.SW_MESMODE0 = 3173;
sv.SW_CHA1POSX = 2600;
Expand Down
15 changes: 3 additions & 12 deletions profiles/chn/dialogue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ root.Sprites["ADVBox"] = {
};

root.Dialogue = {
REVBounds = { X = 0, Y = 0, Width = 960, Height = 400 },
REVNameFontSize = 24,
TipsMessageModeIdx = 7,

REVMessageModeIdx = 9,
REVColor = 0,
REVNameColor = 24,
REVNameOffset = 34,
REVNameLocation = REVNameLocationType.TopLeft,
REVOutlineMode = 2,
REVNameOutlineMode = 2,
NVLBounds = { X = 188, Y = 128, Width = 1536, Height = 600 },
ADVBounds = { X = 295, Y = 828, Width = 1440, Height = 270 },
ADVBoxSprite = "ADVBox",
ADVBoxPos = { X = 0, Y = 781 },
FadeOutDuration = 0.33,
Expand All @@ -23,10 +20,6 @@ root.Dialogue = {
DialogueBoxCurrentType = DialogueBoxType.Plain,
NVLBoxMaxOpacity = 0.55,

ADVNameAlignment = TextAlignment.Left,
ADVNameFontSize = 33,
ADVNamePos = { X = 173, Y = 773 },

NametagCurrentType = NametagType.None,

WaitIconSpriteAnim = "WaitIconSpriteAnimDef",
Expand All @@ -35,8 +28,6 @@ root.Dialogue = {
DialogueFont = "Default",
SetFontSizeRatio = 1000.0,
DefaultFontSize = 48,
RubyFontSize = 21,
RubyYOffset = -21,
ColorTable = {
{0xFFFFFF, 0x000000}, {0x5080FF, 0x000000},
{0xFF7080, 0x000000}, {0xFFA0F8, 0x000000},
Expand Down
8 changes: 6 additions & 2 deletions profiles/common/charset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ function AddCharsetFlag(characterString, flag)
for targetBytePos, targetCodePoint in utf8.codes(root.CharsetInternal.CharsetStr) do
if sourceCodePoint == targetCodePoint then
root.Charset.Flags[charsetIndex] = root.Charset.Flags[charsetIndex] | flag;
break;
end

charsetIndex = charsetIndex + 1;
end
end
Expand All @@ -40,4 +39,9 @@ if root.CharsetInternal ~= nil and root.CharsetInternal.CharsetStr ~= nil then
if root.CharsetInternal.WordStartingPunct ~= nil then
AddCharsetFlag(root.CharsetInternal.WordStartingPuncts, CharacterTypeFlags.WordStartingPunct);
end

if root.CharsetInternal.AlphabetChars == nil then
root.CharsetInternal.AlphabetChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz//..";
end
AddCharsetFlag(root.CharsetInternal.AlphabetChars, CharacterTypeFlags.Alphabet);
end
Loading
Loading