Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Commit 14a32b0

Browse files
authored
Merge pull request #67 from mixer/issue-63
Small fix for Label
2 parents edbb08d + 7da3c30 commit 14a32b0

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

Source/InteractiveSDK/Assets/MixerInteractive/Source/Editor/InteractiveSettingsWindow.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public class InteractiveSettingsWindow : EditorWindow
4343
private static bool wasPaused;
4444
private static bool initialized;
4545

46-
// Control indexes
47-
private static int CONTROL_DROPDOWN_BUTTON_INDEX = 0;
48-
private static int CONTROL_JOYSTICK_BUTTON_INDEX = 1;
49-
50-
private static string[] controlOptions;
5146
private static string[] logLevelOptions;
5247
private bool existingProjectInformation;
5348

@@ -81,11 +76,6 @@ void Initialize()
8176
titleContent = new GUIContent("Interactive Editor");
8277
EditorStyles.textArea.wordWrap = true;
8378

84-
controlOptions = new string[]
85-
{
86-
"Button", "Joystick"
87-
};
88-
8979
logLevelOptions = new string[]
9080
{
9181
"none", "minimal", "verbose"

Source/InteractiveSDK/Assets/MixerInteractive/Source/Scripts/InteractiveLabelControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void SetText(string text)
5959
text);
6060
}
6161

62-
public InteractiveLabelControl(string controlID, InteractiveEventType type, string text, string sceneID) : base(controlID, InteractivityManager.CONTROL_TYPE_BUTTON, type, false, "", "", sceneID)
62+
public InteractiveLabelControl(string controlID, string text, string sceneID) : base(controlID, InteractivityManager.CONTROL_KIND_LABEL, InteractiveEventType.Unknown, false, "", "", sceneID)
6363
{
6464
Text = text;
6565
}

Source/InteractiveSDK/Assets/MixerInteractive/Source/Scripts/InteractivityManager.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ private InteractiveControl ReadControl(JsonReader jsonReader, string sceneID = "
21222122
string controlID = string.Empty;
21232123
uint cost = 0;
21242124
bool disabled = false;
2125-
string helpText = string.Empty;
2125+
string text = string.Empty;
21262126
string eTag = string.Empty;
21272127
string kind = string.Empty;
21282128
try
@@ -2144,7 +2144,7 @@ private InteractiveControl ReadControl(JsonReader jsonReader, string sceneID = "
21442144
break;
21452145
case WS_MESSAGE_KEY_TEXT:
21462146
jsonReader.Read();
2147-
helpText = jsonReader.Value.ToString();
2147+
text = jsonReader.Value.ToString();
21482148
break;
21492149
case WS_MESSAGE_KEY_ETAG:
21502150
jsonReader.Read();
@@ -2171,19 +2171,23 @@ private InteractiveControl ReadControl(JsonReader jsonReader, string sceneID = "
21712171
}
21722172
if (kind == WS_MESSAGE_VALUE_CONTROL_TYPE_BUTTON)
21732173
{
2174-
newControl = new InteractiveButtonControl(controlID, InteractiveEventType.Button, disabled, helpText, cost, eTag, sceneID);
2174+
newControl = new InteractiveButtonControl(controlID, InteractiveEventType.Button, disabled, text, cost, eTag, sceneID);
21752175
}
21762176
else if (kind == WS_MESSAGE_VALUE_CONTROL_TYPE_JOYSTICK)
21772177
{
2178-
newControl = new InteractiveJoystickControl(controlID, InteractiveEventType.Joystick, disabled, helpText, eTag, sceneID);
2178+
newControl = new InteractiveJoystickControl(controlID, InteractiveEventType.Joystick, disabled, text, eTag, sceneID);
21792179
}
21802180
else if (kind == WS_MESSAGE_VALUE_CONTROL_TYPE_TEXTBOX)
21812181
{
2182-
newControl = new InteractiveTextControl(controlID, InteractiveEventType.TextInput, disabled, helpText, eTag, sceneID);
2182+
newControl = new InteractiveTextControl(controlID, InteractiveEventType.TextInput, disabled, text, eTag, sceneID);
2183+
}
2184+
else if (kind == WS_MESSAGE_VALUE_CONTROL_TYPE_LABEL)
2185+
{
2186+
newControl = new InteractiveLabelControl(controlID, text, sceneID);
21832187
}
21842188
else
21852189
{
2186-
newControl = new InteractiveControl(controlID, kind, InteractiveEventType.Unknown, disabled, helpText, eTag, sceneID);
2190+
newControl = new InteractiveControl(controlID, kind, InteractiveEventType.Unknown, disabled, text, eTag, sceneID);
21872191
}
21882192
return newControl;
21892193
}
@@ -3424,6 +3428,7 @@ private void SendJsonString(string jsonString)
34243428
internal const string WS_MESSAGE_VALUE_DEFAULT_GROUP_ID = "default";
34253429
internal const string WS_MESSAGE_VALUE_DEFAULT_SCENE_ID = "default";
34263430
private const string WS_MESSAGE_VALUE_CONTROL_TYPE_JOYSTICK = "joystick";
3431+
internal const string WS_MESSAGE_VALUE_CONTROL_TYPE_LABEL = "label";
34273432
internal const string WS_MESSAGE_VALUE_CONTROL_TYPE_TEXTBOX = "textbox";
34283433
private const bool WS_MESSAGE_VALUE_TRUE = true;
34293434

@@ -3467,6 +3472,7 @@ private void SendJsonString(string jsonString)
34673472
// Input
34683473
internal const string CONTROL_TYPE_BUTTON = "button";
34693474
internal const string CONTROL_TYPE_JOYSTICK = "joystick";
3475+
internal const string CONTROL_KIND_LABEL = "label";
34703476
internal const string CONTROL_KIND_TEXTBOX = "textbox";
34713477

34723478
// Event names
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)