public void ShowCurrentProfileCharacter() { GameProfileCharacterItems gameProfileCharacterItems = GameProfileCharacters.Current.GetCharacters(); int countPresets = gameProfileCharacterItems.items.Count; int index = 0; string currentCharacterCode = GameProfileCharacters.Current.GetCurrentCharacterProfileCode(); foreach (GameProfileCharacterItem gameProfileCharacterItem in gameProfileCharacterItems.items) { if (gameProfileCharacterItem.code == currentCharacterCode) { ChangePreset(index); break; } index++; } if (index == countPresets - 1) { ChangePreset(0); } }
public void ChangePreset(int index) { GameProfileCharacterItems gameProfileCharacterItems = GameProfileCharacters.Current.GetCharacters(); int countPresets = gameProfileCharacterItems.items.Count; if (index < 0) { index = countPresets - 1; } if (index > countPresets - 1) { index = 0; } currentIndex = index; if (index > -1 && index < countPresets) { if (initialProfileCustomItem == null) { initialProfileCustomItem = GameProfileCharacters.currentCustom; } currentProfileCustomItem = GameProfileCharacters.currentCustom; if (index == -1) { UIUtil.SetLabelValue(labelCurrentDisplayName, "Previous"); UIUtil.SetLabelValue(labelCurrentType, ""); //GameCustomController.UpdateTexturePresetObject( // initialProfileCustomItem, currentObject, type); } else { profileCharacterItem = gameProfileCharacterItems.items[currentIndex]; //GameCustomController.SaveCustomItem(currentProfileCustomItem); Messenger <string> .Broadcast( GameCustomMessages.customCharacterPlayerChanged, profileCharacterItem.code); string characterType = ""; GameCharacter gameCharacter = GameCharacters.Instance.GetById(profileCharacterItem.characterCode); if (gameCharacter != null) { characterType = gameCharacter.display_name; characterType = "- TYPE: " + characterType + " -"; } UIUtil.SetInputValue(inputCurrentDisplayName, profileCharacterItem.characterDisplayName); UIUtil.SetLabelValue(labelCurrentDisplayName, profileCharacterItem.characterDisplayName); UIUtil.SetLabelValue(labelCurrentType, characterType); UIUtil.SetInputValue(inputCurrentDisplayCode, profileCharacterItem.characterDisplayCode); UIUtil.SetLabelValue(labelCurrentStatus, string.Format("{0}/{1}", index + 1, countPresets)); } } }