ok, we have a SPECIAL MOVES screen in TZOMPANTLI, my friend the programmer changed a little bit the code and made a custom screen that can display an image (wich i created in photoshop) displaying the selected character move lists... this is a bit old, and also the UFE version is no up to date (this is 1.6 i think), but maybe someone can figure it out better and adapt it to the new versions... or maybe it works already--- remember, i'm no programmer:
First, the DefaultPauseScreen script is a bit changed, in order to get two inputs from the game "ConfirmPlayer1" and "ConfirmPlayer2" , around line 46. This two inputs we can create them in the inputs options from the UFE global config file if we are using cINPUT (wich we used).
DefaultPauseScreen:
using UnityEngine;
using System.Collections;
public class DefaultPauseScreen : PauseScreen{
#region public instance fields
public UFEScreen backToMenuConfirmationDialog;
public UFEScreen[] screens;
#endregion
#region protected instance fields
protected int currentScreen;
protected bool confirmationDialogVisible = false;
#endregion
#region public instance methods
public virtual void HideBackToMenuConfirmationDialog(){
this.HideBackToMenuConfirmationDialog(true);
}
public virtual void HideBackToMenuConfirmationDialog(bool triggerOnShowScreenEvent){
if (this.backToMenuConfirmationDialog != null){
for (int i = 0; i < this.screens.Length; ++i){
if (this.screens[i] != null){
CanvasGroup canvasGroup = this.screens[i].GetComponent<CanvasGroup>();
if (canvasGroup != null){
canvasGroup.interactable = true;
}
}
}
this.HideScreen(this.backToMenuConfirmationDialog);
this.confirmationDialogVisible = false;
if (triggerOnShowScreenEvent){
this.ShowScreen(this.screens[this.currentScreen]);
}
}
}
public virtual void GoToScreen(int index){
for (int i = 0; i < this.screens.Length; ++i){
if (i != index){
this.HideScreen(this.screens[i]);
}else{
if(this.screens[i].ToString().Contains("Moves")==true&&cInput.GetKey("ConfirmPlayer1"))
{
((DefaultMovesMenuScreen)this.screens[i]).Player1=true;
}
if(this.screens[i].ToString().Contains("Moves")==true&&cInput.GetKey("ConfirmPlayer2"))
{
((DefaultMovesMenuScreen)this.screens[i]).Player2=true;
}
this.ShowScreen(this.screens[i]);
}
}
this.currentScreen = index;
}
public virtual void ShowBackToMenuConfirmationDialog(){
if (this.backToMenuConfirmationDialog != null){
for (int i = 0; i < this.screens.Length; ++i){
if (this.screens[i] != null){
CanvasGroup canvasGroup = this.screens[i].GetComponent<CanvasGroup>();
if (canvasGroup != null){
canvasGroup.interactable = false;
}else{
this.HideScreen(this.screens[i]);
}
}
}
this.ShowScreen(this.backToMenuConfirmationDialog);
this.confirmationDialogVisible = true;
}
}
#endregion
#region public override methods
public override void DoFixedUpdate (){
base.DoFixedUpdate ();
if (this.confirmationDialogVisible){
if (this.backToMenuConfirmationDialog != null){
this.backToMenuConfirmationDialog.DoFixedUpdate();
}
}else{
if(this.currentScreen >= 0 && this.currentScreen < this.screens.Length && this.screens[this.currentScreen] != null){
this.screens[this.currentScreen].DoFixedUpdate();
}
}
}
public override void OnHide (){
this.confirmationDialogVisible = false;
this.HideBackToMenuConfirmationDialog(false);
if (this.currentScreen >= 0 && this.currentScreen < this.screens.Length){
this.HideScreen(this.screens[this.currentScreen]);
}
base.OnHide ();
}
public override void OnShow (){
base.OnShow ();
this.confirmationDialogVisible = false;
this.HideBackToMenuConfirmationDialog(false);
if (this.screens.Length > 0){
this.GoToScreen(0);
}
}
public override void SelectOption(int option, int player){
// TODO: select the correct option manually.
if(this.currentScreen >= 0 && this.currentScreen < this.screens.Length && this.screens[this.currentScreen] != null){
this.screens[this.currentScreen].SelectOption(option, player);
}else{
}
}
#endregion
#region protected instance methods
protected virtual void HideScreen(UFEScreen screen){
if (screen != null){
screen.OnHide();
screen.gameObject.SetActive(false);
}
}
protected virtual bool IsVisible(UFEScreen screen){
return screen != null ? screen.IsVisible() : false;
}
protected virtual void ShowScreen(UFEScreen screen){
if (screen != null){
screen.gameObject.SetActive(true);
screen.OnShow();
}
}
#endregion
}
Then in the pause screen prefab we selected the SpecialMovesScreen
the DefaultMovesMenuScreen is also slighty changed:
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
public class DefaultMovesMenuScreen : DefaultUFEScreen{// DeathlyIdeas
#region public instance fields
public Image imageActive;
public Sprite[] images;
public bool Player1;
public bool Player2;
#endregion
#region public override methods
public override void DoFixedUpdate(){
base.DoFixedUpdate();
}
public override void OnShow (){
base.OnShow ();
for (int i=0; i<images.Length; ++i) {
// Debug.Log(images[i].ToString().ToLower());
// Debug.Log("------------------- "+UFE.config.player1Character.name.ToLower());
if (Player1&&images[i].ToString().ToLower().Contains(UFE.config.player1Character.name.ToLower().Replace("(clone)","") )) {
imageActive.sprite = images [i];
} else if (Player2&&images[i].ToString().ToLower().Contains(UFE.config.player2Character.name.ToLower().Replace("(clone)",""))) {
imageActive.sprite = images [i];
}
}
//UFE.config.player1Character.name
Player1=false;
Player2=false;
}
#endregion
}
Then inside we got a background, a button to close this screen (i think we used the one wich is already there) and an Image wich is the same size as the images we are using for our characters movelists. The image is the one that the movescreen script is asking us for and below as you can see i have a list of the characters in my game, and each element is linked with the image for each character's move list (wich is an image set as an sprite 2d UI).
Very important, the name of the character movelist sprite file must be EXACTLY THE SAME as the Character File (Not the Prefab, the character file, in wich you define it's name, life points, portraits and so on)
I think that's very much it... as i say, i'm not sure it works exactly the same in the new versions, but i think it can get you in the right direction.
Greetings!
Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.