Beispiel #1
0
        private ItemPanel CreateUiItemAndAddButtons(ConfigurationItemData configurationItemData, Func <int?> getPercentFromGame, InfoManager infoManager)
        {
            var itemPanel = CreateAndAddItemPanel();

            itemPanel.Initialize(_configuration, configurationItemData, _languageResource, getPercentFromGame, infoManager);
            return(itemPanel);
        }
Beispiel #2
0
        //TODO: refactor to localized item instead
        public void Initialize(Configuration configuration, ConfigurationItemData configurationItemData, LanguageResource languageResource, Func <int?> getPercentFromGame, InfoManager infoManager)
        {
            _configuration         = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _configurationItemData = configurationItemData ?? throw new ArgumentNullException(nameof(configurationItemData));
            _languageResource      = languageResource ?? throw new ArgumentNullException(nameof(languageResource));
            _getPercentFromGame    = getPercentFromGame ?? throw new ArgumentNullException(nameof(getPercentFromGame));
            _infoManager           = infoManager ?? throw new ArgumentNullException(nameof(infoManager));

            width  = configuration.ItemWidth;
            height = configuration.ItemHeight;

            isVisible = _configurationItemData.Enabled;

            CreateAndAddIconButton();
            CreateAndAddPercentButton();
            UpdateLocalization();
        }