Skip to content

Commit

Permalink
Fix required quantity in node tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
cayb0rg committed Dec 18, 2023
1 parent 5a9c98d commit c2ed7b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/creator.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,400&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,400&family=Roboto+Mono&display=swap" rel="stylesheet">

<!-- STYLESHEETS -->
<link rel="stylesheet" type="text/css" href="creator.css">
Expand Down Expand Up @@ -1576,7 +1576,7 @@ <h4>Take Player Items</h4>
</node-tooltips>
<required-items-tooltip ng-show="hoveredLock.showItems">
<span>The answer "{{hoveredLock.answerText}}" requires item(s):</span>
<p ng-repeat="item in hoveredLock.requiredItems"><img ng-if="inventoryItems[getItemIndex(item)].icon && inventoryItems[getItemIndex(item)].icon.url" ng-src="{{inventoryItems[getItemIndex(item)].icon.url}}" /> {{inventoryItems[getItemIndex(item)].name}} (Quantity: {{item.range}})</p>
<p ng-repeat="item in hoveredLock.requiredItems"><img ng-if="inventoryItems[getItemIndex(item)].icon && inventoryItems[getItemIndex(item)].icon.url" ng-src="{{inventoryItems[getItemIndex(item)].icon.url}}" /> {{inventoryItems[getItemIndex(item)].name}} (Quantity: {{item.range ? item.range : 1}})</p>
<p ng-if="!hoveredLock.hideAnswer"><span><img src="assets/creator-assets/eye-white.png"/></span>This answer will remain visible even if the player does not have the items.</p>
<p ng-if="hoveredLock.hideAnswer"><span><img src="assets/creator-assets/eye-blocked-white.png"/></span>This answer will be invisible to the player if they do not have the items.</p>
</required-items-tooltip>
Expand Down
7 changes: 6 additions & 1 deletion src/src-assets/creator-assets/controllers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,17 @@ angular.module "Adventure"
if data.type is "lock"
$scope.hoveredLock.pendingHide = false
if $scope.hoveredLock.target isnt data.id

$scope.$apply () ->
$scope.hoveredLock.x = data.x
$scope.hoveredLock.y = data.y
$scope.hoveredLock.target = data.id
$scope.hoveredLock.requiredItems = data.requiredItems
# set required item range text
for item in $scope.hoveredLock.requiredItems
if item.uncappedMax
item.range = item.minCount
else
item.range = item.minCount + " to " + item.maxCount
$scope.hoveredLock.answerText = data.answerText
$scope.hoveredLock.hideAnswer = data.hideAnswer
return
Expand Down

0 comments on commit c2ed7b1

Please sign in to comment.