Commit Graph

35 Commits

Author SHA1 Message Date
vrld
b18c399def Add missing argument to gs:resume(pre, ...) 2014-12-16 18:07:32 +01:00
xpol
bdd9ad5c04 Fixes wrong arg #1 for resume(). 2014-12-15 15:06:05 +08:00
vrld
526ca620c9 Merge pull request #36 from jessevanherk/master
add assertions to catch incorrect colon-calls to gamestate
2014-08-22 13:57:47 +02:00
Matthias Richter
af8f19a48e Forward arguments from GS.pop() to state:resume() 2014-08-22 13:57:02 +02:00
Matthias Richter
bd10ec4caf (Fix #34) Add callback for returning from push()/pop()
state:resume() will be called on the state that issued a GS.push()
after the pushed state is popped from the stack.
2014-08-22 13:42:17 +02:00
Jesse van Herk
db9a576aa7 cleanup indenting to match origin style 2014-07-01 11:42:42 -06:00
Jesse van Herk
ed2b38952a Add assertions for : calls, avoid bad recursion 2014-07-01 11:38:07 -06:00
Kevin Bradshaw
21d87e5119 Added gamepadreleased to all_callbacks 2014-02-08 16:49:34 +01:00
Matthias Richter
d42244ba35 [Gamestate] Undo last commit. Add all 0.9 callbacks. 2013-12-16 16:35:06 +01:00
Matthias Richter
4372c6404c [Gamestate] Add love.textinput to default callback list 2013-12-14 13:01:45 +01:00
Landon Manning
d697664e27 Update for 0.9.0 2013-11-10 00:16:35 -04:00
Matthias Richter
cea730deac Fix bug in GS.push(). 2013-08-24 22:58:30 +02:00
Matthias Richter
87b82750ff Localize function registry to Gamestate.switch(). 2013-08-19 14:10:00 +02:00
Matthias Richter
5c06f3d3d0 [gamestate] Add .current(). Add gamestate stack.
New methods:

function GS.current()
    retrieves currently active gamestate (i.e. the state on top of the
    stack)

function GS.push(state, ...)
    Pushes a state on the stack. Calls state:enter(...), but *not*
    state:leave() on the previous state.

function GS.pop()
    Pops a state from the stack, provided that there are states to pop.
    Calls state:leave() on the state on top of the stack before popping.
2013-08-05 16:30:30 +02:00
Carlo Cabanilla
11cf27df4d Fix "self" param to the GS.leave callback 2013-04-11 23:44:17 -03:00
Matthias Richter
615dd8f111 Fix gamestate:init() bug, and error on undefined callbacks 2013-02-25 18:46:04 +01:00
Matthias Richter
8d4e5bb65f Update license header 2013-02-20 16:54:57 +01:00
Matthias Richter
5b1b67b23e Deprecate gamestate constructor 2013-02-20 15:51:50 +01:00
Matthias Richter
f080a9c14a [Gamestate] Remove __index metamethod for new gamestates (world of pain) 2013-01-27 11:43:39 +01:00
Matthias Richter
d22749990d Allow arbitraty gamestate callbacks 2013-01-26 12:56:59 +01:00
Matthias Richter
914ee08202 Return GS callback result (for love.quit(), etc) 2012-10-06 09:46:36 +02:00
Matthias Richter
adcceed73b Update license header 2012-04-10 17:00:02 +02:00
Matthias Richter
99ece87eb6 Metatable magic in gamestate 2011-11-19 20:41:43 +01:00
Matthias Richter
c8440e2bc0 Fix issue #2: mousepressed doesn't work in gamestate.lua (thanks, benloran!) 2011-09-08 14:26:02 +02:00
Matthias Richter
28b698fb00 Eliminate use of module(...) function 2011-07-06 14:19:31 +02:00
Matthias Richter
e885ec90d4 Add gamestate:init() 2011-03-15 17:34:28 +01:00
Matthias Richter
ec3cfcab53 Apply nevon's patch: More gamestate callbacks 2011-01-22 11:53:31 +01:00
Matthias Richter
9bcb428555 Make proper tail recursion calls 2011-01-19 16:41:59 +01:00
Matthias Richter
d1d6dbb056 Make proper modules 2011-01-18 17:44:38 +01:00
Matthias Richter
902437d562 Throw error in case of missing argument instead of silently failing 2010-11-16 16:26:33 +01:00
Matthias Richter
6b2f1f4caa Add missing callbacks, make ignorant of passed arguments, bug in Gamestate.keypressed 2010-10-31 13:04:08 +01:00
Matthias Richter
8311ddbad1 Add license header 2010-09-19 15:37:55 +02:00
Matthias Richter
6315155955 Bug: prevent from switching to initial gamestate 2010-08-13 15:36:12 +02:00
Matthias Richter
da90605de9 Add error-producing initial gamestate 2010-08-13 14:48:24 +02:00
Matthias Richter
f491a92eaa Initial commit 2010-08-09 17:52:48 +02:00