Skip to content

Commit

Permalink
Fixed not displaying Tutorials;
Browse files Browse the repository at this point in the history
Fixed opening Spawn and Context menu at the same time;
  • Loading branch information
gtnardy committed Jul 30, 2022
1 parent 47b293d commit b37ef56
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Client/ContextMenu.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ContextMenuOpened = ContextMenuOpened or false

Input.Bind("ContextMenu", InputEvent.Pressed, function()
if (SpawnMenuOpened) then return end

if (ContextMenuOpened) then
MainHUD:CallEvent("ToggleContextMenuVisibility", false)

Expand Down
8 changes: 8 additions & 0 deletions Client/SpawnMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ToolGunsTutorials = ToolGunsTutorials or {}
-- WORKAROUND used for weapons Patterns
SelectedOption = SelectedOption or ""

SpawnMenuOpened = SpawnMenuOpened or false

-- Configures the Highlight colors to be used
Client.SetHighlightColor(Color(0, 20, 0, 1.20), 0, HighlightMode.Always) -- Index 0
Client.SetOutlineColor(Color(0, 0, 300), 2) -- Index 2
Expand Down Expand Up @@ -58,13 +60,19 @@ Package.Subscribe("Load", function()
end)

Input.Bind("SpawnMenu", InputEvent.Released, function()
if (ContextMenuOpened) then return end

MainHUD:CallEvent("ToggleSpawnMenuVisibility", false)
SpawnMenuOpened = false
Client.SetMouseEnabled(false)
Client.SetChatVisibility(true)
end)

Input.Bind("SpawnMenu", InputEvent.Pressed, function()
if (ContextMenuOpened) then return end

MainHUD:CallEvent("ToggleSpawnMenuVisibility", true)
SpawnMenuOpened = true
Client.SetMouseEnabled(true)
Client.SetChatVisibility(false)
MainHUD:BringToFront()
Expand Down
4 changes: 2 additions & 2 deletions Client/UI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
</head>
<body>
<div id="tutorials">
<div id="tutorial-title">
<div id="tutorial_title">
Tool
</div>
<div id="tutorial-body">
<div id="tutorial_body">
<!-- <span class="tutorial"><img src="..." class="tutorial-key"> Attach Something</span> -->
<!-- <span class="tutorial"><img src="..." class="tutorial-key"> Do Another Thing</span> -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion Package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# contributors
author = "nanos™"
# version
version = "2.11.4"
version = "2.11.5"
# image URL
image = "https://i.imgur.com/aoEa4N4.jpg"
# package type: 'script' (normal package), 'game-mode' (unique package - can only load one at a time), 'library' (doesn't start a Lua VM) or 'loading-screen' (special package for loading screen)
Expand Down

0 comments on commit b37ef56

Please sign in to comment.