Skip to content

Commit fbd4a48

Browse files
committed
Compatibility with redscript 1
1 parent ba9ec14 commit fbd4a48

File tree

5 files changed

+35
-44
lines changed

5 files changed

+35
-44
lines changed

scripts/UI/ButtonHints/ButtonHintsEx.reds

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class ButtonHintsEx extends inkCustomController {
9999
}
100100
101101
private func ApplyListStyle() {
102-
let holder: ref<inkCompoundWidget> = inkCompoundRef.Get(this.m_buttonHints.m_horizontalHolder) as inkCompoundWidget;
102+
let holder = inkWidgetRef.Get(this.m_buttonHints.m_horizontalHolder) as inkCompoundWidget;
103103
104104
if Equals(this.m_style, n"popup") {
105105
holder.SetChildMargin(new inkMargin(30.0, 0.0, 0.0, 0.0));
@@ -123,7 +123,7 @@ public class ButtonHintsEx extends inkCustomController {
123123
}
124124
125125
private func ApplyLastItemStyle() {
126-
let holder: ref<inkCompoundWidget> = inkCompoundRef.Get(this.m_buttonHints.m_horizontalHolder) as inkCompoundWidget;
126+
let holder = inkWidgetRef.Get(this.m_buttonHints.m_horizontalHolder) as inkCompoundWidget;
127127
128128
this.ApplyItemStyle(holder.GetWidgetByIndex(holder.GetNumChildren() - 1).GetController() as ButtonHintListItem);
129129
}

scripts/UI/Buttons/CustomButton.reds

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public abstract class CustomButton extends inkCustomController {
5454
5555
protected func CreateWidgets()
5656
57-
protected func CreateAnimations()
57+
protected func CreateAnimations() {}
5858
5959
protected func RegisterListeners() {
6060
this.RegisterToCallback(n"OnEnter", this, n"OnHoverOver");
@@ -63,11 +63,11 @@ public abstract class CustomButton extends inkCustomController {
6363
this.RegisterToCallback(n"OnRelease", this, n"OnRelease");
6464
}
6565
66-
protected func ApplyDisabledState()
66+
protected func ApplyDisabledState() {}
6767
68-
protected func ApplyHoveredState()
68+
protected func ApplyHoveredState() {}
6969
70-
protected func ApplyPressedState()
70+
protected func ApplyPressedState() {}
7171
7272
protected func SetDisabledState(isDisabled: Bool) {
7373
if !Equals(this.m_isDisabled, isDisabled) {

scripts/UI/Core/inkCustomController.reds

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ public abstract class inkCustomController extends inkLogicController {
149149
150150
protected cb func OnCreate()
151151
152-
protected cb func OnInitialize()
152+
protected cb func OnInitialize() {}
153153
154-
protected cb func OnUninitialize() -> Void {
154+
protected cb func OnUninitialize() {
155155
//this.m_isCreated = false;
156156
//this.m_isInitialized = false;
157157
this.m_detachedWidget = null;
158158
}
159159
160-
protected cb func OnReparent(parent: ref<inkCompoundWidget>) -> Void
160+
protected cb func OnReparent(parent: ref<inkCompoundWidget>) {}
161161
162162
public func GetRootWidget() -> wref<inkWidget> {
163163
return this.m_rootWidget;

scripts/UI/TextInput/Parts/TextFlow.reds

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class TextFlow extends inkCustomController {
5454
protected func InitializeOffsets() {
5555
ArrayResize(this.m_charOffsets, this.m_length + 1);
5656
57-
this.m_charOffsets[0] = 0;
57+
this.m_charOffsets[0] = 0.0;
5858
5959
if this.m_length > 0 {
6060
let position: Int32 = 1;
@@ -168,8 +168,8 @@ public class TextFlow extends inkCustomController {
168168
return this.m_text.GetLetterCase();
169169
}
170170
171-
public func SetLetterCase(case: textLetterCase) {
172-
this.m_text.SetLetterCase(case);
171+
public func SetLetterCase(value: textLetterCase) {
172+
this.m_text.SetLetterCase(value);
173173
}
174174
175175
public func GetFontSize() -> Int32 {
@@ -255,16 +255,13 @@ public class TextFlow extends inkCustomController {
255255
position = Max(position, 0);
256256
position = Min(position, this.m_length);
257257
258-
switch position {
259-
case 0:
260-
this.m_value = char + this.m_value;
261-
break;
262-
case this.m_length:
263-
this.m_value += char;
264-
break;
265-
default:
266-
this.m_value = UTF8StrLeft(this.m_value, position)
267-
+ char + UTF8StrRight(this.m_value, this.m_length - position);
258+
if position == 0 {
259+
this.m_value = char + this.m_value;
260+
} else if position == this.m_length {
261+
this.m_value += char;
262+
} else {
263+
this.m_value = UTF8StrLeft(this.m_value, position)
264+
+ char + UTF8StrRight(this.m_value, this.m_length - position);
268265
}
269266
270267
this.m_length += 1;
@@ -284,16 +281,13 @@ public class TextFlow extends inkCustomController {
284281
position = Max(position, 0);
285282
position = Min(position, this.m_length);
286283
287-
switch position {
288-
case 0:
289-
this.m_value = text + this.m_value;
290-
break;
291-
case this.m_length:
292-
this.m_value += text;
293-
break;
294-
default:
295-
this.m_value = UTF8StrLeft(this.m_value, position)
296-
+ text + UTF8StrRight(this.m_value, this.m_length - position);
284+
if position == 0 {
285+
this.m_value = text + this.m_value;
286+
} else if position == this.m_length {
287+
this.m_value += text;
288+
} else {
289+
this.m_value = UTF8StrLeft(this.m_value, position)
290+
+ text + UTF8StrRight(this.m_value, this.m_length - position);
297291
}
298292
299293
this.m_length += length;
@@ -312,16 +306,13 @@ public class TextFlow extends inkCustomController {
312306
position = Max(position, 0);
313307
position = Min(position, this.m_length - 1);
314308
315-
switch position {
316-
case 0:
317-
this.m_value = UTF8StrRight(this.m_value, this.m_length - 1);
318-
break;
319-
case this.m_length - 1:
320-
this.m_value = UTF8StrLeft(this.m_value, this.m_length - 1);
321-
break;
322-
default:
323-
this.m_value = UTF8StrLeft(this.m_value, position)
324-
+ UTF8StrRight(this.m_value, this.m_length - position - 1);
309+
if position == 0 {
310+
this.m_value = UTF8StrRight(this.m_value, this.m_length - 1);
311+
} else if position == this.m_length - 1 {
312+
this.m_value = UTF8StrLeft(this.m_value, this.m_length - 1);
313+
} else {
314+
this.m_value = UTF8StrLeft(this.m_value, position)
315+
+ UTF8StrRight(this.m_value, this.m_length - position - 1);
325316
}
326317
327318
this.m_length -= 1;

scripts/UI/TextInput/TextInput.reds

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ public class TextInput extends inkCustomController {
567567
return this.m_text.GetLetterCase();
568568
}
569569
570-
public func SetLetterCase(case: textLetterCase) {
571-
this.m_text.SetLetterCase(case);
570+
public func SetLetterCase(value: textLetterCase) {
571+
this.m_text.SetLetterCase(value);
572572
}
573573
574574
public func GetWidth() -> Float {

0 commit comments

Comments
 (0)