Example #1
0
        /// <summary>
        /// Обновление содержимого темплейта в зависимости от ошибок, наличия данных или действия пользователя
        /// </summary>
        /// <param name="args"></param>
        private void UpdateTemplateVisualState(VisualParams args)
        {
            if (args == null)
            {
                return;
            }

            ShowMessage(args.Message, args.IsCryticalError);

            if (tbCurrentFullCount != null)
            {
                tbCurrentFullCount.Text = args.CurrentFullCount.ToString();
            }

            //var tbCurrentSelectedCount = template.FindName("tbCurrentSelectedCount", this) as TextBlock;
            //if (tbCurrentSelectedCount != null)
            //{
            //    tbCurrentSelectedCount.Text = this.Sele
            //}

            if (bRefresh != null)
            {
                bRefresh.IsEnabled = true;
            }
        }
Example #2
0
        private void OnPageLoaded(IDataSourcePage page, int currentFullCount, int actualPageSize)
        {
            if (!_isControlInitialized)
            {
                InitControls();
            }

            if (BeforePageLoaded != null)
            {
                BeforePageLoaded(this, new DataSourcePageEventArgs {
                    Page = page
                });
            }

            string message;
            bool   isCryticalError;

            var odataPage = page as ODataDataSourcePage;

            if (odataPage != null)
            {
                message         = odataPage.Message;
                isCryticalError = odataPage.IsCryticalError;
            }
            else
            {
                message         = null;
                isCryticalError = false;
            }

            var args = new VisualParams
            {
                Message          = message,
                CurrentFullCount = currentFullCount,
                IsCryticalError  = isCryticalError,
            };

            UpdateTemplateVisualState(args);

            //Message = "Количество " + currentFullCount;
        }
Example #3
0
        protected void Bake()
        {
            _bakedTexture = new AssetTexture(new ManagedImage(_bakeWidth, _bakeHeight,
                                                              ManagedImage.ImageChannels.Color | ManagedImage.ImageChannels.Alpha | ManagedImage.ImageChannels.Bump));

            if (_bakeType == AppearanceManager.BakeType.Eyes)
            {
                InitBakedLayerColor(255, 255, 255);
                if (!DrawLayer(AppearanceManager.TextureIndex.EyesIris))
                {
                    Logger.Log("Missing texture for EYES - unable to bake layer", Helpers.LogLevel.Warning, _client);
                }
            }
            else if (_bakeType == AppearanceManager.BakeType.Head)
            {
                // FIXME: Need to use the visual parameters to determine the base skin color in RGB but
                // it's not apparent how to define RGB levels from the skin color parameters, so
                // for now use a grey foundation for the skin
                InitBakedLayerColor(128, 128, 128);
                DrawLayer(AppearanceManager.TextureIndex.HeadBodypaint);

                // HACK: Bake the eyelashes in if we have them
                ManagedImage eyelashes = LoadAlphaLayer("head_alpha.tga");

                if (eyelashes != null)
                {
                    Logger.DebugLog("Loaded head_alpha.tga, baking in eyelashes");
                    DrawLayer(eyelashes, true);
                }
                else
                {
                    Logger.Log("head_alpha.tga resource not found, skipping eyelashes", Helpers.LogLevel.Info);
                }
            }
            else if (_bakeType == AppearanceManager.BakeType.Skirt)
            {
                float skirtRed = 1.0f, skirtGreen = 1.0f, skirtBlue = 1.0f;

                try
                {
                    _paramValues.TryGetValue(VisualParams.Find("skirt_red", "skirt").ParamID, out skirtRed);
                    _paramValues.TryGetValue(VisualParams.Find("skirt_green", "skirt").ParamID, out skirtGreen);
                    _paramValues.TryGetValue(VisualParams.Find("skirt_blue", "skirt").ParamID, out skirtBlue);
                }
                catch
                {
                    Logger.Log("Unable to determine skirt color from visual params", Helpers.LogLevel.Warning, _client);
                }

                InitBakedLayerColor((byte)(skirtRed * 255.0f), (byte)(skirtGreen * 255.0f), (byte)(skirtBlue * 255.0f));
                DrawLayer(AppearanceManager.TextureIndex.Skirt);
            }
            else if (_bakeType == AppearanceManager.BakeType.UpperBody)
            {
                InitBakedLayerColor(128, 128, 128);
                DrawLayer(AppearanceManager.TextureIndex.UpperBodypaint);
                DrawLayer(AppearanceManager.TextureIndex.UpperUndershirt);
                DrawLayer(AppearanceManager.TextureIndex.UpperGloves);
                DrawLayer(AppearanceManager.TextureIndex.UpperShirt);
                DrawLayer(AppearanceManager.TextureIndex.UpperJacket);
            }
            else if (_bakeType == AppearanceManager.BakeType.LowerBody)
            {
                InitBakedLayerColor(128, 128, 128);
                DrawLayer(AppearanceManager.TextureIndex.LowerBodypaint);
                DrawLayer(AppearanceManager.TextureIndex.LowerUnderpants);
                DrawLayer(AppearanceManager.TextureIndex.LowerSocks);
                DrawLayer(AppearanceManager.TextureIndex.LowerShoes);
                DrawLayer(AppearanceManager.TextureIndex.LowerPants);
                DrawLayer(AppearanceManager.TextureIndex.LowerJacket);
            }

            _bakedTexture.Encode();
        }