zz
This commit is contained in:
44
GlobalTorch/Program.cs
Normal file
44
GlobalTorch/Program.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using Sandbox.ModAPI.Ingame;
|
||||
using SpaceEngineers.Game.ModAPI.Ingame;
|
||||
|
||||
namespace IngameScript
|
||||
{
|
||||
public class Program : MyGridProgram
|
||||
{
|
||||
private const string InputMap =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#&^£%!$@[]{};:.,<>/|\\|!~\"'`()=+-*_";
|
||||
|
||||
private const string Password = "password";
|
||||
|
||||
public Program()
|
||||
{
|
||||
Runtime.UpdateFrequency = UpdateFrequency.Update1;
|
||||
}
|
||||
|
||||
public void Main(string argument, UpdateType updateType)
|
||||
{
|
||||
}
|
||||
|
||||
private void Setup()
|
||||
{
|
||||
var keypad = GridTerminalSystem.GetBlockGroupWithName("Keypad");
|
||||
// get list of button panels
|
||||
var buttons = new List<IMyButtonPanel>();
|
||||
keypad.GetBlocksOfType(buttons);
|
||||
|
||||
var maxCharacters = buttons.Count;
|
||||
if (maxCharacters > InputMap.Length)
|
||||
{
|
||||
Echo("Too many buttons");
|
||||
return;
|
||||
}
|
||||
|
||||
for (var index = 0; index < buttons.Count; index++)
|
||||
{
|
||||
var myButtonPanel = buttons[index];
|
||||
myButtonPanel.SetCustomButtonName(0, InputMap[index].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user