|
82 | 82 | -- Deactivate the current state, push a new state and initialize it |
83 | 83 | -- |
84 | 84 | local function push( screen, args ) |
85 | | - if ScreenManager.peek() then |
86 | | - ScreenManager.peek():setActive( false ) |
87 | | - end |
| 85 | + if ScreenManager.peek() then |
| 86 | + ScreenManager.peek():setActive( false ) |
| 87 | + end |
88 | 88 |
|
89 | | - -- Push the new screen onto the stack. |
90 | | - stack[#stack + 1] = screens[screen].new() |
| 89 | + -- Push the new screen onto the stack. |
| 90 | + stack[#stack + 1] = screens[screen].new() |
91 | 91 |
|
92 | | - -- Create the new screen and initialise it. |
93 | | - stack[#stack]:init( unpack( args ) ) |
| 92 | + -- Create the new screen and initialise it. |
| 93 | + stack[#stack]:init( unpack( args ) ) |
94 | 94 | end |
95 | 95 |
|
96 | 96 | --- |
@@ -123,14 +123,14 @@ function ScreenManager.performChanges() |
123 | 123 | end |
124 | 124 |
|
125 | 125 | for _, change in ipairs( changes ) do |
126 | | - if change.action == 'pop' then |
127 | | - pop() |
128 | | - elseif change.action == 'switch' then |
129 | | - clear() |
130 | | - push( change.screen, change.args ) |
131 | | - elseif change.action == 'push' then |
132 | | - push( change.screen, change.args ) |
133 | | - end |
| 126 | + if change.action == 'pop' then |
| 127 | + pop() |
| 128 | + elseif change.action == 'switch' then |
| 129 | + clear() |
| 130 | + push( change.screen, change.args ) |
| 131 | + elseif change.action == 'push' then |
| 132 | + push( change.screen, change.args ) |
| 133 | + end |
134 | 134 | end |
135 | 135 |
|
136 | 136 | changes = {} |
|
0 commit comments