Remove the 10 seconds autoquit when playing alone
Moderator: Moderators
Remove the 10 seconds autoquit when playing alone
Could you please remove it? Its hard to notice when its loaded when you are doing something else at same time
Re: Remove the 10 seconds autoquit when playing alone
Isn't this forum for engine feature requests? Add a single line to the widget that gets the player count and submit to the mods that use it. Were you not aware it was a widget?
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Remove the 10 seconds autoquit when playing alone
Code: Select all
----------------------------------------------------------------
-- global variables
----------------------------------------------------------------
local versionNumber = "v1.2"
local delay = 5
local endTime
local mx,my
----------------------------------------------------------------
-- speedups
----------------------------------------------------------------
local DiffTimers = Spring.DiffTimers
local GetTimer = Spring.GetTimer
local SendCommands = Spring.SendCommands
local Echo = Spring.Echo
local GetMouseState = Spring.GetMouseState
----------------------------------------------------------------
-- callins
----------------------------------------------------------------
function widget:GetInfo()
return {
name = "Autoquit L",
desc = versionNumber .. " Automatically quits "..delay.."s after the game ends. Move mouse to cancel.",
author = "Evil4Zerggin & zwzsg",
date = "25 December 2008",
license = "GNU LGPL, v2.1 or later",
layer = 0,
enabled = true -- loaded by default?
}
end
function widget:Initialize()
local plist = Spring.GetPlayerList()
if (#plist == 1) then
widgetHandler:RemoveWidget()
end
endTime = false
end
function widget:GameOver()
endTime = GetTimer()
mx,my = GetMouseState()
Echo("<autoquit> Automatically exiting in " .. delay .. " seconds. Move mouse to cancel.")
end
function widget:Update(dt)
if endTime then
local nmx,nmy = GetMouseState()
if nmx~=mx or nmy~=my then
Echo("<autoquit> Autoquit canceled.")
endTime = false
-- widgetHandler:RemoveWidget()
elseif DiffTimers(GetTimer(), endTime) > delay then
Echo("<autoquit> Autoquit sending quit command.")
SendCommands("quit")
end
end
end
Re: Remove the 10 seconds autoquit when playing alone
oh it was widget, i thought it was some new feature lol
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the 10 seconds autoquit when playing alone
A new feature built into spring that jsut magically arrived when you downloaded a widget without needing to update spring?
Re: Remove the 10 seconds autoquit when playing alone
Why do you think he downloaded the widget?
You're telling me you notice the exact second a feature shows up?
You're telling me you notice the exact second a feature shows up?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the 10 seconds autoquit when playing alone
How else would he have gotten it? SD doesn't just auto DL widgets also I thought it was funny cause you would thing that the big AUTOQUIT in f11 and widgets dir would be a clue.
And mainly, because this thread made me laugh.
And mainly, because this thread made me laugh.
Re: Remove the 10 seconds autoquit when playing alone
i havent downloaded any widgets, perhaps its new BA feature
Re: Remove the 10 seconds autoquit when playing alone
The tiny 'autoquit' in the menu that is rarely used, and a widget that's probably in a mod file. Don't be so mocking.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the 10 seconds autoquit when playing alone
BA Changelog wrote:- Added Evil4Zerggin & zwzsg's autoquit widget (exits spring at game end if no mousemove after 10 seconds).