protected virtual async Task OnChatWindowRectangleChanged(RectangleDValueChangeEventArgs ea)
        {
            await this.UIThreadAsync(() =>
            {
                System.Drawing.RectangleD winRect = new System.Drawing.RectangleD(this.Left, this.Top, this.Width, this.Height);

                if (ea.NewValue.X < 2 || ea.NewValue.Y < 2 || ea.NewValue.Width < 2 || ea.NewValue.Height < 2)
                {
                    if (((TataruUIModel)ea.Sender).ChatWindowRectangle != winRect)
                    {
                        ((TataruUIModel)ea.Sender).ChatWindowRectangle = winRect;
                    }
                    return;
                }


                if (ea.NewValue != winRect)
                {
                    var newRect = ea.NewValue;

                    if (newRect.X != winRect.X && newRect.Y != winRect.Y)
                    {
                        this.Left = newRect.X;
                        this.Top  = newRect.Y;
                    }

                    if (newRect.Width != winRect.Width && newRect.Height != winRect.Height)
                    {
                        this.Width  = newRect.Width;
                        this.Height = newRect.Height;
                    }
                }
                //*/
            });
        }
Beispiel #2
0
        public UserSettings()
        {
            BackgroundColor = (Color)ColorConverter.ConvertFromString("#4B000000");

            Font1Color = (Color)ColorConverter.ConvertFromString("#FFFFFFFF");

            Font2Color = (Color)ColorConverter.ConvertFromString("#FFFFFFFF");

            IsClickThrough = false;

            IsAlwaysOnTop = true;

            IsHideToTray = false;

            IsAutoHide = false;

            IsDirecMemoryReading = true;

            AutoHideTimeout = new TimeSpan(0, 5, 0);

            FontSize = 14;

            RecentBackgroundColors = new List <Color>(new Color[] { (Color)ColorConverter.ConvertFromString("#4B000000") });

            LineBreakHeight = 0;

            InsertSpaceCount = 0;

            CurrentTranslationEngine = 0;

            CurrentFFXIVLanguage = "English";

            CurrentTranslateToLanguage = "English";

            CurentUILanguague = (int)LanguagueWrapper.Languages.English;

            SettingsWindowSize = new System.Drawing.PointD(0.0, 0.0);

            ChatWindowLocation = new System.Drawing.RectangleD(0.0, 0.0, 0.0, 0.0);

            ShowHideChatKeys     = new HotKeyCombination("ShowHideChatWin");
            ClickThoughtChatKeys = new HotKeyCombination("ClickThoughtChatWin");
            ClearChatKeys        = new HotKeyCombination("ClearChatWin");

            ChatCodes = new Dictionary <string, ChatMsgType>()
            {
                { "003D", new ChatMsgType("003D", MsgType.Translate, "NPCD", (Color)ColorConverter.ConvertFromString("#FFABD647")) },
                { "0044", new ChatMsgType("0044", MsgType.Translate, "NPCA", (Color)ColorConverter.ConvertFromString("#FFABD647")) },
            };

            //ChatWindows = new List<ChatWindowViewModelSettings>(new ChatWindowViewModelSettings[] { new ChatWindowViewModelSettings() });

            ChatWindows = new List <ChatWindowViewModelSettings>();

            IsFirstTime = 0;
        }
Beispiel #3
0
        protected override async Task OnChatWindowRectangleChanged(RectangleDValueChangeEventArgs ea)
        {
            await this.UIThreadAsync(() =>
            {
                System.Drawing.RectangleD winRect = new System.Drawing.RectangleD(this.Left, this.Top, this.Width, this.Height);

                if (ea.NewValue != winRect)
                {
                    var newRect = ea.NewValue;

                    this.Left = newRect.X;
                    this.Top  = newRect.Y;


                    this.Width  = newRect.Width;
                    this.Height = newRect.Height;
                }
            });
        }
        public ChatWindowViewModel()
        {
            this._AsyncPropertyChanged    = new AsyncEvent <AsyncPropertyChangedEventArgs>(this.EventErrorHandler, "ChatWindowViewModel \n AsyncPropertyChanged");
            ShowChatWindowCommand         = new TataruUICommand(ShowChatWindow);
            RestChatWindowPositionCommand = new TataruUICommand(ResetChatWindowPosition);

            Random rnd = new Random(DateTime.UtcNow.Date.Millisecond);

            _WinId = (DateTime.Now.Ticks * 100u) + ((uint)rnd.Next(0, 100));

            Name = "2";

            ChatFontSize        = 1;
            LineBreakHeight     = 1;
            SpacingCount        = 1;
            BackGroundColor     = Color.FromArgb(255, 0, 255, 128);
            ChatWindowRectangle = new System.Drawing.RectangleD(0, 0, 480, 320);

            ChatCodes = new BindingList <ChatCodeViewModel>()
            {
                new ChatCodeViewModel("0039", "System", Colors.Aqua, true),
            };
        }