Пример #1
0
        public OverlayStreamBossItemViewModel(OverlayStreamBossItemModel item)
            : this()
        {
            this.startingHealth = item.StartingHealth;
            this.followBonus    = item.FollowBonus;
            this.hostBonus      = item.HostBonus;
            this.subBonus       = item.SubscriberBonus;
            this.donationBonus  = item.DonationBonus;
            this.sparkBonus     = item.SparkBonus;
            this.emberBonus     = item.EmberBonus;

            this.healingBonus  = item.HealingBonus;
            this.overkillBonus = item.OverkillBonus;

            this.width  = item.Width;
            this.height = item.Height;
            this.Font   = item.TextFont;

            this.TextColor       = ColorSchemes.GetColorName(item.TextColor);
            this.BorderColor     = ColorSchemes.GetColorName(item.BorderColor);
            this.ProgressColor   = ColorSchemes.GetColorName(item.ProgressColor);
            this.BackgroundColor = ColorSchemes.GetColorName(item.BackgroundColor);

            this.damageAnimation  = item.DamageAnimation;
            this.newBossAnimation = item.NewBossAnimation;

            this.NewBossCommand = item.NewStreamBossCommand;

            this.HTML = item.HTML;
        }
 public OverlayStreamBossItemModel(string htmlText, int startingHealth, int width, int height, string textColor, string textFont, string borderColor, string backgroundColor,
                                   string progressColor, double followBonus, double hostBonus, double subscriberBonus, double donationBonus, double sparkBonus, double emberBonus, double healingBonus, double overkillBonus,
                                   OverlayItemEffectVisibleAnimationTypeEnum damageAnimation, OverlayItemEffectVisibleAnimationTypeEnum newBossAnimation, CustomCommand newStreamBossCommand)
     : base(OverlayItemModelTypeEnum.StreamBoss, htmlText)
 {
     this.StartingHealth       = startingHealth;
     this.Width                = width;
     this.Height               = height;
     this.TextColor            = textColor;
     this.TextFont             = textFont;
     this.BorderColor          = borderColor;
     this.BackgroundColor      = backgroundColor;
     this.ProgressColor        = progressColor;
     this.FollowBonus          = followBonus;
     this.HostBonus            = hostBonus;
     this.SubscriberBonus      = subscriberBonus;
     this.DonationBonus        = donationBonus;
     this.SparkBonus           = sparkBonus;
     this.EmberBonus           = emberBonus;
     this.HealingBonus         = healingBonus;
     this.OverkillBonus        = overkillBonus;
     this.DamageAnimation      = damageAnimation;
     this.NewBossAnimation     = newBossAnimation;
     this.NewStreamBossCommand = newStreamBossCommand;
 }
 public OverlaySparkCrystalItemModel(string htmlText, string textColor, string textFont, int crystalWidth, int crystalHeight, string customImageFilePath,
                                     OverlayItemEffectVisibleAnimationTypeEnum progressAnimation, OverlayItemEffectVisibleAnimationTypeEnum milestoneReachedAnimation)
     : base(OverlayItemModelTypeEnum.SparkCrystal, htmlText)
 {
     this.TextColor                 = textColor;
     this.TextFont                  = textFont;
     this.CrystalWidth              = crystalWidth;
     this.CrystalHeight             = crystalHeight;
     this.CustomImageFilePath       = customImageFilePath;
     this.ProgressAnimation         = progressAnimation;
     this.MilestoneReachedAnimation = milestoneReachedAnimation;
 }
Пример #4
0
        public OverlaySparkCrystalItemViewModel(OverlaySparkCrystalItemModel item)
            : this()
        {
            this.width  = item.CrystalWidth;
            this.height = item.CrystalHeight;
            this.CustomImageFilePath = item.CustomImageFilePath;

            this.Font      = item.TextFont;
            this.TextColor = ColorSchemes.GetColorName(item.TextColor);

            this.progressAnimation         = item.ProgressAnimation;
            this.milestoneReachedAnimation = item.MilestoneReachedAnimation;

            this.HTML = item.HTML;
        }
        public OverlayActionEditorControlViewModel(OverlayActionModel action)
            : base(action)
        {
            if (!string.IsNullOrEmpty(action.OverlayName))
            {
                this.SelectedOverlayEndpoint = action.OverlayName;
            }
            else
            {
                this.SelectedOverlayEndpoint = ChannelSession.Services.Overlay.DefaultOverlayName;
            }

            if (action.WidgetID != Guid.Empty)
            {
                this.SelectedActionType = OverlayActionTypeEnum.ShowHideWidget;
                this.SelectedWidget     = ChannelSession.Settings.OverlayWidgets.FirstOrDefault(w => w.Item.ID.Equals(action.WidgetID));
                this.WidgetVisible      = action.ShowWidget;
            }
            else
            {
                if (action.OverlayItem != null)
                {
                    if (action.OverlayItem.Effects != null)
                    {
                        this.ItemDuration = action.OverlayItem.Effects.Duration;
                        this.SelectedEntranceAnimation = action.OverlayItem.Effects.EntranceAnimation;
                        this.SelectedVisibleAnimation  = action.OverlayItem.Effects.VisibleAnimation;
                        this.SelectedExitAnimation     = action.OverlayItem.Effects.ExitAnimation;
                    }

                    if (action.OverlayItem.Position != null)
                    {
                        this.ItemPosition.SetPosition(action.OverlayItem.Position);
                    }

                    if (action.OverlayItem is OverlayImageItemModel)
                    {
                        this.SelectedActionType = OverlayActionTypeEnum.Image;
                        this.ImageItemViewModel = new OverlayImageItemViewModel((OverlayImageItemModel)action.OverlayItem);
                    }
                    else if (action.OverlayItem is OverlayTextItemModel)
                    {
                        this.SelectedActionType = OverlayActionTypeEnum.Text;
                        this.TextItemViewModel  = new OverlayTextItemViewModel((OverlayTextItemModel)action.OverlayItem);
                    }
                    else if (action.OverlayItem is OverlayYouTubeItemModel)
                    {
                        this.SelectedActionType   = OverlayActionTypeEnum.YouTube;
                        this.YouTubeItemViewModel = new OverlayYouTubeItemViewModel((OverlayYouTubeItemModel)action.OverlayItem);
                    }
                    else if (action.OverlayItem is OverlayVideoItemModel)
                    {
                        this.SelectedActionType = OverlayActionTypeEnum.Video;
                        this.VideoItemViewModel = new OverlayVideoItemViewModel((OverlayVideoItemModel)action.OverlayItem);
                    }
                    else if (action.OverlayItem is OverlayWebPageItemModel)
                    {
                        this.SelectedActionType   = OverlayActionTypeEnum.WebPage;
                        this.WebPageItemViewModel = new OverlayWebPageItemViewModel((OverlayWebPageItemModel)action.OverlayItem);
                    }
                    else if (action.OverlayItem is OverlayHTMLItemModel)
                    {
                        this.SelectedActionType = OverlayActionTypeEnum.HTML;
                        this.HTMLItemViewModel  = new OverlayHTMLItemViewModel((OverlayHTMLItemModel)action.OverlayItem);
                    }
                }
            }
        }
        public override ActionBase GetAction()
        {
            string type = (string)this.TypeComboBox.SelectedItem;

            if (!string.IsNullOrEmpty(type))
            {
                if (type.Equals(ShowHideWidgetOption))
                {
                    if (this.WidgetNameComboBox.SelectedIndex >= 0)
                    {
                        OverlayWidgetModel widget = (OverlayWidgetModel)this.WidgetNameComboBox.SelectedItem;
                        return(new OverlayAction(widget.Item.ID, this.ShowHideWidgetCheckBox.IsChecked.GetValueOrDefault()));
                    }
                }
                else
                {
                    OverlayItemModelTypeEnum overlayType = EnumHelper.GetEnumValueFromString <OverlayItemModelTypeEnum>(type);

                    if (this.OverlayNameComboBox.SelectedIndex < 0)
                    {
                        return(null);
                    }
                    string overlayName = (string)this.OverlayNameComboBox.SelectedItem;

                    double duration;
                    if (double.TryParse(this.DurationTextBox.Text, out duration) && duration > 0 && this.EntranceAnimationComboBox.SelectedIndex >= 0 &&
                        this.VisibleAnimationComboBox.SelectedIndex >= 0 && this.ExitAnimationComboBox.SelectedIndex >= 0)
                    {
                        OverlayItemEffectEntranceAnimationTypeEnum entrance = EnumHelper.GetEnumValueFromString <OverlayItemEffectEntranceAnimationTypeEnum>((string)this.EntranceAnimationComboBox.SelectedItem);
                        OverlayItemEffectVisibleAnimationTypeEnum  visible  = EnumHelper.GetEnumValueFromString <OverlayItemEffectVisibleAnimationTypeEnum>((string)this.VisibleAnimationComboBox.SelectedItem);
                        OverlayItemEffectExitAnimationTypeEnum     exit     = EnumHelper.GetEnumValueFromString <OverlayItemEffectExitAnimationTypeEnum>((string)this.ExitAnimationComboBox.SelectedItem);

                        OverlayItemEffectsModel effects = new OverlayItemEffectsModel(entrance, visible, exit, duration);

                        OverlayItemPositionModel position = this.ItemPosition.GetPosition();

                        OverlayItemModelBase item = null;

                        if (overlayType == OverlayItemModelTypeEnum.Image)
                        {
                            item = this.ImageItem.GetItem();
                        }
                        else if (overlayType == OverlayItemModelTypeEnum.Text)
                        {
                            item = this.TextItem.GetItem();
                        }
                        else if (overlayType == OverlayItemModelTypeEnum.YouTube)
                        {
                            item = this.YouTubeItem.GetItem();
                        }
                        else if (overlayType == OverlayItemModelTypeEnum.Video)
                        {
                            item = this.VideoItem.GetItem();
                        }
                        else if (overlayType == OverlayItemModelTypeEnum.WebPage)
                        {
                            item = this.WebPageItem.GetItem();
                        }
                        else if (overlayType == OverlayItemModelTypeEnum.HTML)
                        {
                            item = this.HTMLItem.GetItem();
                        }

                        if (item != null)
                        {
                            item.Position = position;
                            item.Effects  = effects;

                            return(new OverlayAction(overlayName, item));
                        }
                    }
                }
            }
            return(null);
        }
Пример #7
0
 public OverlayItemEffectsModel(OverlayItemEffectEntranceAnimationTypeEnum entrance, OverlayItemEffectVisibleAnimationTypeEnum visible, OverlayItemEffectExitAnimationTypeEnum exit, double duration)
 {
     this.EntranceAnimation = entrance;
     this.VisibleAnimation  = visible;
     this.ExitAnimation     = exit;
     this.Duration          = duration;
 }