Skip to content

Commit f429663

Browse files
committed
TypedText: update to 3.5.0+ script API
1 parent fd0faf9 commit f429663

5 files changed

Lines changed: 18 additions & 11 deletions

File tree

scripts/gui/TypedText/TypedText.ash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// TERMS OF USE - TypedText MODULE
44
//
5-
// Copyright (c) 2017-present Ivan Mogilko
5+
// Copyright (c) 2017-2024 Ivan Mogilko
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
88
// this software and associated documentation files (the "Software"), to deal in
@@ -41,7 +41,7 @@
4141
#ifndef __TYPEDTEXT_MODULE__
4242
#define __TYPEDTEXT_MODULE__
4343

44-
#define TYPEDTEXT_VERSION_00_00_70_00
44+
#define TYPEDTEXT_VERSION_00_01_00_00
4545

4646
/// Maximal allowed random sounds
4747
/// ( because pre-3.4.0 AGS does not support dynamic arrays in structs... :-( )

scripts/gui/TypedText/TypedTextDrawing.asc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Compatibility macros
2+
#ifndef SCRIPT_API_v350
3+
#define eAlignCenter eAlignCentre
4+
#endif
5+
16
//===========================================================================
27
//
38
// TypedTextDrawing::PrecalcText
@@ -33,7 +38,7 @@ void PrecalcText(this TypedTextDrawing*)
3338
String s = this._full.Substring(line_start, line_end - line_start);
3439
//Display(">>> '%s'",s);
3540
int linewidth = GetTextWidth(s, this._font);
36-
if (this._textAlign == eAlignCentre)
41+
if (this._textAlign == eAlignCenter)
3742
this._lineX[line_count] = (this._width - linewidth) / 2;
3843
else
3944
this._lineX[line_count] = this._width - linewidth;
@@ -81,7 +86,7 @@ void RecalcDisplay(this TypedTextDrawing*)
8186
if (this._maxVisLines > TYPEDTEXTDRAWING_MAXLINES)
8287
this._maxVisLines = TYPEDTEXTDRAWING_MAXLINES;
8388

84-
if (this._textAlign == eAlignCentre)
89+
if (this._textAlign == eAlignCenter)
8590
this._lineXDefault = this._width / 2;
8691
else if (this._textAlign == eAlignRight)
8792
this._lineXDefault = this._width - 1;
@@ -362,7 +367,7 @@ void DrawExplicitCaret(this TypedTextDrawing*, DrawingSurface *ds, int x, int y,
362367
}
363368

364369
caret_y = y;
365-
if (align == eAlignCentre)
370+
if (align == eAlignCenter)
366371
caret_x = x - caret_w / 2;
367372
else if (align == eAlignRight)
368373
caret_x = x - caret_w;

scripts/gui/TypedText/TypedTextDrawing.ash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// TERMS OF USE - TypedTextDrawing MODULE
44
//
5-
// Copyright (c) 2017-present Ivan Mogilko
5+
// Copyright (c) 2017-2024 Ivan Mogilko
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
88
// this software and associated documentation files (the "Software"), to deal in
@@ -42,7 +42,7 @@
4242
#error TypedTextDrawing requires TypedText module
4343
#endif
4444

45-
#define TYPEDTEXTDRAWING_VERSION_00_00_70_00
45+
#define TYPEDTEXTDRAWING_VERSION_00_01_00_00
4646

4747
// Maximal supported text lines
4848
#define TYPEDTEXTDRAWING_MAXLINES 32

scripts/gui/TypedText/TypedTextHelper.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ int Typewriter(this Label*, String text, BlockingStyle bs, int preset)
453453
//===========================================================================
454454
//
455455
// Overlay::Typewriter()
456-
// TypewriteOver()
456+
// TypewriteOnOverlay()
457457
//
458458
//===========================================================================
459459
#ifver 3.4.0

scripts/gui/TypedText/TypedTextHelper.ash

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// TERMS OF USE - TypedTextHelper MODULE
44
//
5-
// Copyright (c) 2017-present Ivan Mogilko
5+
// Copyright (c) 2017-2024 Ivan Mogilko
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
88
// this software and associated documentation files (the "Software"), to deal in
@@ -34,7 +34,7 @@
3434
#error TypedTextHelper requires TypedText module
3535
#endif
3636

37-
#define TYPEDTEXTHELPER_VERSION_00_00_70_00
37+
#define TYPEDTEXTHELPER_VERSION_00_01_00_00
3838

3939
#ifver 3.4.0
4040
#ifdef SCRIPT_COMPAT_v321
@@ -45,6 +45,8 @@
4545
#define TYPEDTEXTHELPER_USEOLDOVERLAY
4646
#endif
4747

48+
/// This defines when to run typedtext updates:
49+
/// may be "repeatedly_execute", "repeatedly_execute_always" or "late_repeatedly_execute_always"
4850
#define TYPEDTEXTHELPER_UPDATEFUNCTION repeatedly_execute_always
4951

5052
/// Maximal supported presets, per each kind
@@ -95,4 +97,4 @@ import int Typewriter(static Overlay, int x, int y, int width, int color, FontTy
9597
import int TypewriteOnOverlay(int x, int y, int width, int color, FontType font, String text, BlockingStyle bs = eBlock, int preset = 0);
9698
#endif // TYPEDTEXTHELPER_USEOLDOVERLAY
9799

98-
#endif // __TYPEDTEXTHELPER_MODULE__ (eof)
100+
#endif // __TYPEDTEXTHELPER_MODULE__

0 commit comments

Comments
 (0)