public static Library FindLibrary(TerrainPower tp) { Library library; if (tp == null) { return(null); } foreach (Library library1 in Session.Libraries) { foreach (TerrainPower terrainPower in library1.TerrainPowers) { if (terrainPower == null || !(terrainPower.ID == tp.ID)) { continue; } library = library1; return(library); } } if (Session.fProject != null) { foreach (TerrainPower terrainPower1 in Session.fProject.Library.TerrainPowers) { if (terrainPower1 == null || !(terrainPower1.ID == tp.ID)) { continue; } library = Session.fProject.Library; return(library); } } return(null); }
public static TerrainPower FindTerrainPower(Guid power_id, SearchType search_type) { if ((search_type == SearchType.External) || (search_type == SearchType.Global)) { foreach (Library lib in Libraries) { TerrainPower tp = lib.FindTerrainPower(power_id); if (tp != null) { return(tp); } } } if ((search_type == SearchType.Project) || (search_type == SearchType.Global)) { if (Project != null) { TerrainPower tp = Project.Library.FindTerrainPower(power_id); if (tp != null) { return(tp); } } } return(null); }
public TerrainPowerForm(TerrainPower power) { this.InitializeComponent(); foreach (TerrainPowerType value in Enum.GetValues(typeof(TerrainPowerType))) { this.TypeBox.Items.Add(value); } foreach (ActionType actionType in Enum.GetValues(typeof(ActionType))) { this.ActionBox.Items.Add(actionType); } this.fPower = power.Copy(); this.NameBox.Text = this.fPower.Name; this.TypeBox.SelectedItem = this.fPower.Type; this.ActionBox.SelectedItem = this.fPower.Action; this.FlavourBox.Text = this.fPower.FlavourText; this.RequirementBox.Text = this.fPower.Requirement; this.CheckBox.Text = this.fPower.Check; this.SuccessBox.Text = this.fPower.Success; this.FailureBox.Text = this.fPower.Failure; this.AttackBox.Text = this.fPower.Attack; this.TargetBox.Text = this.fPower.Target; this.HitBox.Text = this.fPower.Hit; this.MissBox.Text = this.fPower.Miss; this.EffectBox.Text = this.fPower.Effect; }
public TerrainPowerDetailsForm(TerrainPower tp) { InitializeComponent(); fTerrainPower = tp.Copy(); Browser.DocumentText = HTML.TerrainPower(fTerrainPower, Session.Preferences.TextSize); }
public void ShowTerrainPower(TerrainPower tp) { string html = HTML.TerrainPower(tp, Session.Preferences.PlayerViewTextSize); set_html(html); Show(); }
private void EditBtn_Click(object sender, EventArgs e) { TerrainPower terrainPower = this.fToken.TerrainPower ?? new TerrainPower() { Name = this.NameBox.Text }; TerrainPowerForm terrainPowerForm = new TerrainPowerForm(terrainPower); if (terrainPowerForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.fToken.TerrainPower = terrainPowerForm.Power; this.NameBox.Text = this.fToken.TerrainPower.Name; this.update_power(); } }
public static TerrainPower FindTerrainPower(Guid power_id, SearchType search_type) { TerrainPower terrainPower; TerrainPower terrainPower1; if (search_type == SearchType.External || search_type == SearchType.Global) { List <Library> .Enumerator enumerator = Session.Libraries.GetEnumerator(); try { while (enumerator.MoveNext()) { TerrainPower terrainPower2 = enumerator.Current.FindTerrainPower(power_id); if (terrainPower2 == null) { continue; } terrainPower1 = terrainPower2; return(terrainPower1); } if ((search_type == SearchType.Project || search_type == SearchType.Global) && Session.Project != null) { terrainPower = Session.Project.Library.FindTerrainPower(power_id); if (terrainPower != null) { return(terrainPower); } } return(null); } finally { ((IDisposable)enumerator).Dispose(); } } if ((search_type == SearchType.Project || search_type == SearchType.Global) && Session.Project != null) { terrainPower = Session.Project.Library.FindTerrainPower(power_id); if (terrainPower != null) { return(terrainPower); } } return(null); }
private void EditBtn_Click(object sender, EventArgs e) { TerrainPower power = fToken.TerrainPower; if (power == null) { power = new TerrainPower(); power.Name = NameBox.Text; } TerrainPowerForm dlg = new TerrainPowerForm(power); if (dlg.ShowDialog() == DialogResult.OK) { fToken.TerrainPower = dlg.Power; NameBox.Text = fToken.TerrainPower.Name; update_power(); } }
public static Library FindLibrary(TerrainPower tp) { if (tp == null) { return(null); } foreach (Library lib in Libraries) { foreach (TerrainPower item in lib.TerrainPowers) { if (item == null) { continue; } if (item.ID == tp.ID) { return(lib); } } } if (fProject != null) { foreach (TerrainPower item in fProject.Library.TerrainPowers) { if (item == null) { continue; } if (item.ID == tp.ID) { return(fProject.Library); } } } return(null); }
public TerrainPowerForm(TerrainPower power) { InitializeComponent(); Array types = Enum.GetValues(typeof(TerrainPowerType)); foreach (TerrainPowerType type in types) { TypeBox.Items.Add(type); } Array actions = Enum.GetValues(typeof(ActionType)); foreach (ActionType action in actions) { ActionBox.Items.Add(action); } fPower = power.Copy(); NameBox.Text = fPower.Name; TypeBox.SelectedItem = fPower.Type; ActionBox.SelectedItem = fPower.Action; FlavourBox.Text = fPower.FlavourText; RequirementBox.Text = fPower.Requirement; CheckBox.Text = fPower.Check; SuccessBox.Text = fPower.Success; FailureBox.Text = fPower.Failure; AttackBox.Text = fPower.Attack; TargetBox.Text = fPower.Target; HitBox.Text = fPower.Hit; MissBox.Text = fPower.Miss; EffectBox.Text = fPower.Effect; }
public TerrainPowerDetailsForm(TerrainPower tp) { this.InitializeComponent(); this.fTerrainPower = tp.Copy(); this.Browser.DocumentText = HTML.TerrainPower(this.fTerrainPower, DisplaySize.Small); }
public void ShowTerrainPower(TerrainPower tp) { this.set_html(HTML.TerrainPower(tp, PlayerViewForm.DisplaySize)); base.Show(); }