Topic: Dynamic Special Commands Display & Custom Button names
I've recently enabled a basic dynamic special command display which gets all non-normal attacks of both players and puts them into a string. While making this, I also decided to create options for my own names for the buttons should I need them elsewhere (like a button config). This way, Button1 appears as Light Punch. You can edit the button names in Global Input Options.
My method below only covers charge attacks and quarter circle commands, but it should be simple enough to add support for other command types if you have them.
Something else that might be worth adding is a way to minimise multiple commands for different strengths (so you only have one Flash Kick command instead of one for each button strength). One way I can think of is creating a bool in the Move's General section, where if checked it won't come up in command lists. Then just check for that bool in the GUIScript loops.
You'll need to modify 3 scripts: GlobalInfo.cs, GlobalEditorWindow.cs and GUIScript.cs (or your own GUI script).
In GlobalInfo.cs, find:
[System.Serializable]
public class InputOptions {
at the end of the class, add:
public InputNaming[] inputNaming;
then right below the class, create a new class:
[System.Serializable]
public class InputNaming {
public ButtonPress UFEButton;
public string displayName;
}
In GlobalEditorWindow.cs, find:
private bool player2InputOptions;
below, add:
private bool inputDisplayNames;
then find:
globalInfo.inputOptions.cancelButton = (ButtonPress) EditorGUILayout.EnumPopup("Cancel Button:", globalInfo.inputOptions.cancelButton, enumStyle);
below it, add:
// Button In-game Names
EditorGUILayout.Space();
//EditorGUIUtility.labelWidth = 180;
inputDisplayNames = EditorGUILayout.Foldout(inputDisplayNames, "Input Display Names", foldStyle);
if (inputDisplayNames) {
EditorGUIUtility.labelWidth = 180;
EditorGUILayout.BeginVertical(subGroupStyle);{
for (int i = 0; i < globalInfo.inputOptions.inputNaming.Length; i ++){
EditorGUILayout.BeginVertical(arrayElementStyle);{
EditorGUILayout.Space();
EditorGUILayout.BeginHorizontal();{
globalInfo.inputOptions.inputNaming[i].UFEButton = (ButtonPress) EditorGUILayout.EnumPopup("UFE Input:", globalInfo.inputOptions.inputNaming[i].UFEButton, enumStyle);
globalInfo.inputOptions.inputNaming[i].displayName = EditorGUILayout.TextField("Display Name:", globalInfo.inputOptions.inputNaming[i].displayName);
if (GUILayout.Button("", removeButtonStyle)){
globalInfo.inputOptions.inputNaming = RemoveElement<InputNaming>(globalInfo.inputOptions.inputNaming, globalInfo.inputOptions.inputNaming[i]);
return;
}
}EditorGUILayout.EndHorizontal();
}EditorGUILayout.EndVertical();
EditorGUILayout.Space();
}
if (StyledButton("New Display Name")) {
globalInfo.inputOptions.inputNaming = AddElement<InputNaming>(globalInfo.inputOptions.inputNaming, new InputNaming());
}
}EditorGUILayout.EndVertical();
}
In GUIScript.cs, above the Awake() add:
// Command List stuff
private string commandListP1;
private string commandListP2;
then find:
isRunning = true;
and above it, add:
// Command List GET!
MoveSetData[] p1Moves = UFE.config.player1Character.moves;
MoveSetData[] p2Moves = UFE.config.player2Character.moves;
// P1
for (var h=0;h<p1Moves.Length;h++) {
for (var g=0;g<p1Moves[h].attackMoves.Length;g++) {
if (p1Moves[h].attackMoves[g].attackType != AttackType.Regular) {
string moveCommand = "";
for (var i=0;i<p1Moves[h].attackMoves[g].buttonSequence.Length;i++) {
moveCommand += p1Moves[h].attackMoves[g].buttonSequence[i] + " ";
}
for (var j=0;j<p1Moves[h].attackMoves[g].buttonExecution.Length;j++) {
if (j<p1Moves[h].attackMoves[g].buttonExecution.Length-1) {
moveCommand += p1Moves[h].attackMoves[g].buttonExecution[j] + "+";
} else {
moveCommand += p1Moves[h].attackMoves[g].buttonExecution[j];
}
}
commandListP1 += p1Moves[h].attackMoves[g].moveName + ": " + moveCommand + "\n";
}
}
}
commandListP1 = commandListP1.Replace("Back Foward ", "b (hold), f+");
commandListP1 = commandListP1.Replace("Down Up ", "d (hold), u+");
commandListP1 = commandListP1.Replace("Down Foward ", "qcf+");
commandListP1 = commandListP1.Replace("Down Back ", "qcb+");
foreach (InputNaming inputName in UFE.config.inputOptions.inputNaming) {
commandListP1 = commandListP1.Replace(inputName.UFEButton.ToString(), inputName.displayName);
}
// P2
for (var k=0;k<p2Moves.Length;k++) {
for (var l=0;l<p2Moves[k].attackMoves.Length;l++) {
if (p2Moves[k].attackMoves[l].attackType != AttackType.Regular) {
string moveCommand = "";
for (var m=0;m<p2Moves[k].attackMoves[l].buttonSequence.Length;m++) {
moveCommand += p2Moves[k].attackMoves[l].buttonSequence[m] + " ";
}
for (var n=0;n<p2Moves[k].attackMoves[l].buttonExecution.Length;n++) {
if (n<p2Moves[k].attackMoves[l].buttonExecution.Length-1) {
moveCommand += p2Moves[k].attackMoves[l].buttonExecution[n] + "+";
} else {
moveCommand += p2Moves[k].attackMoves[l].buttonExecution[n];
}
}
commandListP2 += p2Moves[k].attackMoves[l].moveName + ": " + moveCommand + "\n";
}
}
}
commandListP2 = commandListP2.Replace("Back Foward ", "b (hold), f+");
commandListP2 = commandListP2.Replace("Down Up ", "d (hold), u+");
commandListP2 = commandListP2.Replace("Down Foward ", "qcf+");
commandListP2 = commandListP2.Replace("Down Back ", "qcb+");
foreach (InputNaming inputName in UFE.config.inputOptions.inputNaming) {
commandListP2 = commandListP2.Replace(inputName.UFEButton.ToString(), inputName.displayName);
}
// end Command List GET!
then, find the 2nd instance of:
if (showSpecials){
Inside here, you can remove everything before the else statement, or comment it out. Then add:
GUILayout.BeginHorizontal();{
GUILayout.Label(player1.characterName);
GUILayout.FlexibleSpace();
GUILayout.Label(player2.characterName);
}GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();{
GUILayout.Label(commandListP1);
GUILayout.FlexibleSpace();
GUILayout.Label(commandListP2);
}GUILayout.EndHorizontal();
I think that's all of it. If I missed anything, or if you get errors let me know and I'll fix it up.