private void tos_wrestlers_SelectedIndexChanged(object sender, EventArgs e) { try { if (tos_wrestlers.Items.Count == 0 || tos_wrestlers.SelectedItem == null) { return; } TOSMoves moves = (TOSMoves)tos_wrestlers.SelectedItem; tos_wrestlerMoves.Items.Clear(); foreach (Skill skill in moves.Moves.Skills) { tos_wrestlerMoves.Items.Add(skill); } if (tos_wrestlerMoves.Items.Count > 0) { tos_wrestlerMoves.SelectedIndex = 0; } } catch (Exception ex) { L.D("tos_wrestlers_SelectedIndexChanged: " + ex); } }
private void tos_addWrestler_Click(object sender, EventArgs e) { if (tos_wrestlerResults.SelectedItem == null) { return; } try { String wrestler = ((WresIDGroup)tos_wrestlerResults.SelectedItem).Name; TOSMoves moves = new TOSMoves(wrestler); tos_wrestlers.Items.Add(moves); if (tos_wrestlers.Items.Count > 0) { tos_wrestlers.SelectedIndex = tos_wrestlers.Items.Count - 1; } tos_wrestlers_SelectedIndexChanged(null, null); } catch (Exception ex) { L.D("Add Wrestler Error: " + ex); } }
private void LoadWrestlers() { try { tos_wrestlers.Items.Clear(); System.String filePath = Path.Combine(saveFolderName, wrestlerFile); if (File.Exists(filePath)) { var lines = File.ReadAllLines(filePath); foreach (var line in lines) { TOSMoves move = new TOSMoves(""); move.LoadMoves(line); tos_wrestlers.Items.Add(move); } } if (tos_wrestlers.Items.Count > 0) { tos_wrestlers.SelectedIndex = 0; } } catch (Exception e) { L.D("LoadwrestlersError: " + e); } }
private void LoadStyles() { try { tos_styles.Items.Clear(); System.String filePath = Path.Combine(saveFolderName, styleFile); if (File.Exists(filePath)) { var lines = File.ReadAllLines(filePath); foreach (var line in lines) { TOSMoves move = new TOSMoves(""); move.LoadMoves(line); tos_styles.Items.Add(move); } } else { tos_styles.Items.Add(new TOSMoves("Orthodox")); tos_styles.Items.Add(new TOSMoves("Technician")); tos_styles.Items.Add(new TOSMoves("Wrestling")); tos_styles.Items.Add(new TOSMoves("Ground")); tos_styles.Items.Add(new TOSMoves("Power")); tos_styles.Items.Add(new TOSMoves("American")); tos_styles.Items.Add(new TOSMoves("Junior")); tos_styles.Items.Add(new TOSMoves("Luchador")); tos_styles.Items.Add(new TOSMoves("Heel")); tos_styles.Items.Add(new TOSMoves("Mysterious")); tos_styles.Items.Add(new TOSMoves("Shooter")); tos_styles.Items.Add(new TOSMoves("Fighter")); tos_styles.Items.Add(new TOSMoves("Grappler")); tos_styles.Items.Add(new TOSMoves("Panther")); tos_styles.Items.Add(new TOSMoves("Giant")); tos_styles.Items.Add(new TOSMoves("Devilism")); } if (tos_styles.Items.Count > 0) { tos_styles.SelectedIndex = 0; } } catch (Exception e) { L.D("LoadStylesError: " + e); } }
private void tos_addWrestlerMove_Click(object sender, EventArgs e) { try { if (tos_wrestlers.SelectedItem == null || tos_moveResults.SelectedItem == null) { return; } TOSMoves moves = (TOSMoves)tos_wrestlers.SelectedItem; moves.AddMove((Skill)tos_moveResults.SelectedItem); tos_wrestlers_SelectedIndexChanged(null, null); } catch (Exception ex) { L.D("tos_addWrestlerMove_Click: " + ex); } }
private void tos_removeStyleMove_Click(object sender, EventArgs e) { try { if (tos_styles.SelectedItem == null || tos_styleMoves.SelectedItem == null) { return; } TOSMoves moves = (TOSMoves)tos_styles.SelectedItem; Skill skill = (Skill)tos_styleMoves.SelectedItem; moves.RemoveMove(skill); tos_styles_SelectedIndexChanged(null, null); } catch (Exception ex) { L.D("tos_removeStyleMove_Click: " + ex); } }
private void tos_styles_SelectedIndexChanged(object sender, EventArgs e) { if (tos_styles.Items.Count == 0 || tos_styles.SelectedItem == null) { return; } TOSMoves moves = (TOSMoves)tos_styles.SelectedItem; tos_styleMoves.Items.Clear(); foreach (Skill skill in moves.Moves.Skills) { tos_styleMoves.Items.Add(skill); } if (tos_styleMoves.Items.Count > 0) { tos_styleMoves.SelectedIndex = 0; } }