public BaseNotification(BattleNotificationSettings settings, int battleDuration)
        {
            InitializeComponent();
            this.settings = settings;
            this.battleDuration = battleDuration;

            if (settings.General.UseFadeEffect)
                InitializeFadeEffect();
        }
예제 #2
0
        public MapNotification(Battle battle, double timeLeft, int startHeight, int mapDesiredWidth, bool mapLoaded, BattleNotificationSettings settings)
            : base(settings, battle.Duration)
        {
            InitializeComponent();
            this.battle = battle;

            InitializeBattleTimer(timeLeft);
            InitializePicture(mapDesiredWidth);
            SetupDialogLocation(settings.Basic.DisplayScreen, startHeight);

            this.mapLoaded = mapLoaded;
            SetupTextOverMap(battle, timeLeft, settings.Map);
        }
        public BattleNotification(Battle battle, double timeLeft, int startHeight, BattleNotificationSettings settings)
            : base(settings, battle.Duration)
        {
            InitializeComponent();

            InitializeBattleTimer(timeLeft);
            SetupDialogLocation(settings.Basic.DisplayScreen, startHeight);

            SetupControls(battle);

            if (settings.General.TransparentStyle)
                SetupOutlineLabels();

            if (settings.General.HidePrintMap)
            {
                PrintMapButton.Visible = false;
                MapCheckBox.Location = new Point(PrintMapButton.Location.X - (MapCheckBox.Width - PrintMapButton.Width), MapCheckBox.Location.Y);
            }
        }
예제 #4
0
 public MiddleClass(BattleNotificationSettings settings, int battleDuration)
     : base(settings, battleDuration)
 {
 }
 private void SetupWindowsDisplayBehaviour(BattleNotificationSettings settings)
 {
     if (!settings.General.ShowOnTop
         || !settings.General.ShowOverFullScreen
         && ForegroundWindowHelper.IsForegroundWindowOnDisplayScreen(settings.Basic.DisplayScreen)
         && ForegroundWindowHelper.IsForegroundWindowFullScreen())
     {
         if (mn != null)
             mn.TopMost = false;
         if (bn != null)
             bn.TopMost = false;
     }
 }
 private void SetupSound(BattleNotificationSettings settings)
 {
     if (settings.Basic.PlaySound)
         if (settings.Basic.UseCustomSound &&
             !string.IsNullOrEmpty(settings.Basic.SoundPath) && File.Exists(settings.Basic.SoundPath))
             PlaySound(settings.Basic.SoundPath, settings.Basic.DefaultSound);
         else
             PlayDefaultSound(settings.Basic.DefaultSound);
 }
 private void SetupLifeTime(BattleNotificationSettings settings)
 {
     if (settings.Basic.LifeSeconds > 0)
     {
         notificationTimer.Interval = Convert.ToInt32(new TimeSpan(0, 0, settings.Basic.LifeSeconds).TotalMilliseconds);
         notificationTimer.Tick += new EventHandler(OnTimedEvent);
         notificationTimer.Start();
     }
 }
예제 #8
0
        public BattleNotificationSettings GetBattleNotificationSettings()
        {
            try
            {
                MainPanel mp = instance.mainPanel;
                SettingsPanel sp = instance.settingsPanel;

                BattleNotificationSettings settings = new BattleNotificationSettings();

                //Main panel settings.
                settings.Basic.ShowBattleDialog = mp.ShowBattleCheckBox.Checked;
                settings.Basic.ShowMapDialog = mp.ShowMapCheckBox.Checked;
                if (mp.CloseDialogTimeCheckBox.Checked)
                    settings.Basic.LifeSeconds = Convert.ToInt32(mp.CloseDialogNumericUpDown.Value);
                else
                    settings.Basic.LifeSeconds = 0;
                settings.Basic.PlaySound = mp.PlaySoundCheckBox.Checked;
                settings.Basic.MapSize = mp.MapSizeDomainUpDown.SelectedIndex;
                settings.Basic.DisplayScreen = Convert.ToInt32(mp.DisplayScreenButton.Text);

                //Settings panel settings.
                settings.Basic.DefaultSound = sp.GetSelecetedDefaultSound();
                settings.Basic.SoundPath = sp.CustomSoundPathTextBox.Text;
                settings.Basic.UseCustomSound = sp.UseCustomSoundCheckBox.Checked;

                settings.General.ShowOnTop = sp.ShowOnTopCheckBox.Checked;
                settings.General.ShowOverFullScreen = sp.ShowOverFullScreenCheckBox.Checked;
                settings.General.UseFadeEffect = sp.FadeCheckBox.Checked;
                settings.General.HidePrintMap = sp.HidePrintCheckBox.Checked;
                settings.General.TransparentStyle = sp.TransparentCheckBox.Checked;

                settings.Map.TextMapColor = sp.ColorPicker.BackColor;
                settings.Map.ShowLevelName = sp.OnMapLevelCheckBox.Checked;
                settings.Map.ShowDesigner = sp.OnMapDesignerCheckBox.Checked;
                settings.Map.ShowType = sp.OnMapTypeCheckBox.Checked;
                settings.Map.ShowLifeSeconds = sp.OnMapTimeCheckBox.Checked;
                settings.Map.ShowAttributes = sp.OnMapAttsCheckBox.Checked;

                return settings;
            }
            catch (Exception ex)
            {
                Logger.Log(400, ex);
                throw;
            }
        }