Skip to content

Commit

Permalink
fix(visual): fix invalid workshop requirements display
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelZinchenko committed Dec 18, 2023
1 parent b20a3ba commit 39a4457
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Assets/Scripts/Legacy/GUI/ViewModel/Craft/CraftListItem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using DataModel.Technology;
using GameServices.Player;
using Services.Localization;
using Services.Reources;
using UnityEngine;
Expand All @@ -11,8 +12,9 @@ namespace ViewModel
{
public class CraftListItem : MonoBehaviour
{
[Inject] private readonly ILocalization _localization;
[Inject] private readonly IResourceLocator _resourceLocator;
[Inject] private readonly ILocalization _localization;
[Inject] private readonly IResourceLocator _resourceLocator;
[Inject] private readonly PlayerSkills _playerSkills;

public Toggle Toggle;
public Image Icon;
Expand All @@ -37,7 +39,7 @@ public void InitializeForCraft(ITechnology technology, int workshopLevel)
Description.text = technology.GetDescription(_localization);
Icon.color = technology.Color;

var techLevel = technology.GetWorkshopLevel();
var techLevel = technology.GetWorkshopLevel() + _playerSkills.CraftingLevelModifier;
var available = techLevel <= workshopLevel;
RequiredLevelPanel.gameObject.SetActive(!available);
RequiredLevelText.text = techLevel.ToString();
Expand Down

0 comments on commit 39a4457

Please sign in to comment.