Skip to content

Commit

Permalink
Merge pull request #25 from shnok/inventory
Browse files Browse the repository at this point in the history
build fix, inventory button click detection
  • Loading branch information
shnok authored Aug 2, 2024
2 parents 4158638 + 3456c54 commit 7792ed1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,16 @@ private void OnExpandButtonPressed(MouseDownEvent evt) {

UpdateItemList(_playerItems);
}

evt.PreventDefault();
}

private void CreateMinimizedWindow() {

// Header button
Button minimizeWindowButton = (Button) GetElementByClass("minimize-btn");
minimizeWindowButton.AddManipulator(new ButtonClickSoundManipulator(minimizeWindowButton));
minimizeWindowButton.RegisterCallback<MouseDownEvent>(OnMinimizeInventoryClick, TrickleDown.TrickleDown);
minimizeWindowButton.RegisterCallback<MouseUpEvent>(OnMinimizeInventoryClick, TrickleDown.TrickleDown);

// Minized inventory button
_minimizedInventoryBtn = _minimizedTemplate.Instantiate()[0];
Expand All @@ -214,10 +216,10 @@ private void CreateMinimizedWindow() {
_root.Add(_minimizedInventoryBtn);
}

private void OnMinimizeInventoryClick(MouseDownEvent evt) {
private void OnMinimizeInventoryClick(MouseUpEvent evt) {
if(!_minimizedInventoryBtn.ClassListContains("minimized")) {
_minimizedInventoryBtn.AddToClassList("minimized");
_minimizedInventoryMouseOverManipulator.Disable();
_minimizedInventoryMouseOverManipulator.Enable();
HideWindow();
_minimized = true;
}
Expand Down Expand Up @@ -328,7 +330,6 @@ public void UpdateItemList(List<ItemInstance> items) {
public override void ShowWindow() {
base.ShowWindow();

Debug.Log("Show window");
AudioManager.Instance.PlayUISound("inventory_open_01");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using static UnityEditor.ShaderGraph.Internal.KeywordDependentCollection;

public class SkillLearn : L2Window
{
Expand Down
Binary file modified l2-unity/Assets/StreamingAssets/InterfaceSound.bank
Binary file not shown.
Binary file modified l2-unity/Assets/StreamingAssets/Master.strings.bank
Binary file not shown.

0 comments on commit 7792ed1

Please sign in to comment.