/// <summary> /// Open FeatureDataForm to Edit Attributes /// </summary> private void OpenFeatureDataEditor(FeatureLayer layer, Graphic graphic) { if (featureEditor.ClearSelection.CanExecute(null)) { featureEditor.ClearSelection.Execute(null); } graphic.Select(); dataEditorForm.FeatureLayer = layer; dataEditorForm.GraphicSource = graphic; dataEditorWindow.Title = layer.LayerInfo.Name; if (layer.LayerInfo.HasAttachments) { attachmentEditor.GraphicSource = graphic; attachmentEditor.FeatureLayer = layer; attachmentEditor.Visibility = Visibility.Visible; } else { attachmentEditor.Visibility = Visibility.Collapsed; } FloatingPopup.Show(dataEditorWindow); //Show Attribute Editing Window at Feature Geometry's Centroid //FloatingPopup.Show(dataEditorWindow, MapControl.MapToScreen(graphic.Geometry.Extent.GetCenter())); }
/// <summary> /// For applying a fixed amoount of damage /// </summary> /// <param name="damage">the precalculated damage to be dealt</param> /// <returns>The actaul damage dealt</returns> public virtual int applyDamage(int damage) { updateHealth(-damage); FloatingPopup.create(combatSprite.transform.position, damage.ToString(), Color.red); return((int)damage); }
/// <summary> /// <para> /// Applies the status effect to this combatant. /// </para> /// See the <see cref="Assets.Scripts.Entities.Combat.EffectProcessor"/> class for effect processing logic. /// </summary> /// <param name="statusEffect">ID for an ability status effect. see EffectProcess.cs.</param> /// <param name="potency">The strength or duration if applicable of the status effect</param> /// <param name="turnsApplied">The amount of combat turns the affect will be applied for.</param> public virtual void applyEffect(int statusEffect, int potency, int turnsApplied) { EffectProcessor.getInstance().applyEffect(this, statusEffect, potency, turnsApplied); string conditionLabel = EffectProcessor.getEffectLabel(statusEffect, potency); FloatingPopup.create(combatSprite.transform.position, conditionLabel, Color.blue); log.Debug($"<b><color=#87CEEB>[CONDITION]</color></b> -{id}:\"{name}\" has been affected with <color=#87CEEB><b>{conditionLabel}</b></color>"); }
/// <summary> /// Provides the base logic for applying a hp recovery/healing effect to a combatant. /// </summary> /// <remarks> /// This provides a flat healing value to the target /// </remarks> /// <param name="minValue">The lower bound of the healing being applied that is used to calculate the actual amount healed. </param> /// <param name="maxValue">The upper bound of the healing being applied that is used to calculate the actual amount healed.</param> /// <returns>The amount healed</returns> public virtual int applyHealing(int value) { updateHealth(value); FloatingPopup.create(combatSprite.transform.position, value.ToString(), new Color(0, 100, 0)); log.Debug($"<b><color=green>[HEAL]</color></b> -{id}:\"{name}\" is healed for <color=green><b>{value}</b></color>"); return((int)value); }
private void DataEditorForm_EditEnded(object sender, EventArgs e) { FloatingPopup.Close(); }
private void LinkMenuButton_MenuItemClick(object sender, MenuItemClickEventArgs e) { string sUrl = (string)e.ItemTag; if (!string.IsNullOrEmpty(sUrl)) { if (sUrl.Equals("About")) { if (AboutWindow == null) { AboutWindow = new PopupWindow() { Title = "About", Background = this.Background, ShowArrow = false, IsResizable = false, IsFloatable = true }; StackPanel aboutContent = new StackPanel() { Orientation = Orientation.Vertical, Margin = new Thickness(12, 12, 12, 12) }; AboutWindow.Content = aboutContent; string[] contentLines = Regex.Split(AppConfig.AppHelpMenu.About.Text, @"\\n"); for (int i = 0; i < contentLines.Length; i++) { if (contentLines[i].Trim().StartsWith("http://", StringComparison.CurrentCultureIgnoreCase)) { HyperlinkButton linkBlock = new HyperlinkButton() { NavigateUri = new Uri(contentLines[i].Trim(), UriKind.Absolute), Content = contentLines[i].Trim(), Margin = new Thickness(2), FontSize = 12.5, Foreground = new SolidColorBrush(Colors.Blue), HorizontalAlignment = System.Windows.HorizontalAlignment.Center, TargetName = "_blank" }; aboutContent.Children.Add(linkBlock); } else { TextBlock textBlock = new TextBlock() { Text = contentLines[i].Trim(), Margin = new Thickness(2), FontSize = 12.5, HorizontalAlignment = System.Windows.HorizontalAlignment.Center }; aboutContent.Children.Add(textBlock); } } } FloatingPopup.Show(AboutWindow); } else { try { System.Windows.Browser.HtmlPopupWindowOptions winOptions = new System.Windows.Browser.HtmlPopupWindowOptions() { Resizeable = true, Width = 1000, Height = 800 }; System.Windows.Browser.HtmlWindow win = System.Windows.Browser.HtmlPage.PopupWindow(new Uri(sUrl, UriKind.Absolute), "_blank", winOptions); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }