Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions LuaUI/Widgets/gui_chili_gesture_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function widget:GetInfo()
handler = true,
}
end

Spring.Echo('test')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops

include("keysym.lua")
VFS.Include("LuaRules/Configs/customcmds.h.lua")
-------------------------------------------------
Expand Down Expand Up @@ -226,9 +226,8 @@ local function CanInitialQueue()
end


function widget:Update(t)
function widget:MouseMove(mx, my)
if not menu or KEYBOARD_ONLY or mouselessOpen then return end
local mx, my = Spring.GetMouseState()
ProcessMove(mx,my)
if hold_pos then
local dx = mx - hold_pos[1]
Expand All @@ -240,6 +239,17 @@ function widget:Update(t)
end
end


function widget:Update(t)
if not menu or KEYBOARD_ONLY or mouselessOpen then return end
if hold_pos then
if osclock() - menu_start > IDLE_THRESHOLD then
menu_invisible = false
hold_pos = nil
end
end
end

local lx = 0
local ly = 0

Expand Down Expand Up @@ -391,10 +401,10 @@ function EndMenu(ok)
level = level + 1 -- save level
levels[level] = {menu_selected, menu_selected.angle+180}
end
if osclock() - menu_start > level * 0.25 then -- if speed was slower than 250ms per level, flash the gesture
if osclock() - menu_start > level * 0.25 then -- if speed was slower than 250ms per level, flash the gesture
menu_flash = {origin[1], origin[2], osclock()}
end
Spring.SetActiveCommand(cmdid, 1, left, right, alt, ctrl, meta, shift) -- FIXME set only when you close menu
Spring.SetActiveCommand(cmdid, 1, left, right, alt, ctrl, meta, shift) -- FIXME set only when you close menu
end
end
origin = nil
Expand Down Expand Up @@ -619,7 +629,7 @@ local function DrawMenuItem(item, x,y, size, alpha, displayLabel, angle, cmdDesc
if displayLabel == nil then displayLabel = true end
if item then
local ud = UnitDefNames[item.unit]
if (ud) then
if (ud) then
if (displayLabel and item.label) then
glColor(1,1,1,alpha)
local wid = glGetTextWidth(item.label)*12
Expand Down