-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpeechBlock.cs
52 lines (42 loc) · 1.64 KB
/
SpeechBlock.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using VRage.ModAPI;
using VRage.Game.Components;
using VRage.ObjectBuilders;
using Sandbox.ModAPI.Interfaces.Terminal;
using Sandbox.ModAPI;
using System.Collections.Generic;
namespace SETextToSpeechMod
{
//[MyEntityComponentDescriptor (typeof (MyObjectBuilder_), new string[] {"Speech Block (Small)", "Speech Block (Large)"})]
public class SpeechBlock : MyGameLogicComponent
{
private MyObjectBuilder_EntityBase objectbuilder;
private SoundPlayer soundPlayer;
private OutputManager outputManager;
private IMyTerminalControlCombobox voiceList;
private IMyTerminalControlTextbox inputField;
public override void Init (MyObjectBuilder_EntityBase inputObjectBuilder)
{
this.objectbuilder = inputObjectBuilder;
base.Init (inputObjectBuilder);
Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_100TH_FRAME;
soundPlayer = new SoundPlayer (false, false);
outputManager = new OutputManager (soundPlayer, false);
}
//Saves the state of the block's entity to disk.
public override MyObjectBuilder_EntityBase GetObjectBuilder (bool copy = false)
{
return (copy) ? (MyObjectBuilder_EntityBase) objectbuilder.Clone() : objectbuilder;
}
public override void UpdateBeforeSimulation()
{
//outputManager.RunAsync();
}
public void OnCustomTerminalControlGet (IMyTerminalBlock block, List <IMyTerminalControl> controls)
{
}
public override void Close()
{
base.Close();
}
}
}