BuildingDistributionSettingPanel(EMaterialType materialType, EBuildingType buildingType, IPositionSupplier positionSupplier) { this.buildingType = buildingType; barFill = new ActionProvidedBarFill(ratio -> { ShortPoint2D position = positionSupplier.getPosition(); if (position != null) { return new SetMaterialDistributionSettingsAction(position, materialType, buildingType, ratio); } else { return null; } }, Labels.getName(buildingType) + "-distribution-barfill"); Label rowTitle = new Label(Labels.getName(buildingType), EFontSize.SMALL, EHorizontalAlignment.LEFT); addChild(rowTitle, 0f, 1f - textHeight, 1f, 1f); addChild(lblPercentage, 0f, 0f, textPercentageWidth, 1f - (textHeight + textMarginBottom)); addChild(barFill, textPercentageWidth, 0f, 1f, 1f - (textHeight + textMarginBottom)); }
taskScheduler.scheduleTask(new SetMaterialDistributionSettingsGuiTask(playerId, a.getManagerPosition(), a.getMaterialType(), a.getBuildingType(), a.getRatio())); break;