Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DiD: added lua for faster cutscene skipping
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
data/campaigns/Descent_Into_Darkness/lua/skip_animations.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
-- Extends several animation actions so that they do not trigger when the user | ||
-- is skipping messages. | ||
--- | ||
|
||
local skippable_actions = { | ||
"animate_unit", | ||
"sound", | ||
"delay" | ||
} | ||
|
||
local skip_actions = {} | ||
|
||
for i, action_id in ipairs(skippable_actions) do | ||
|
||
skip_actions[action_id] = wesnoth.wml_actions[action_id] | ||
wesnoth.wml_actions[action_id] = function(cfg) | ||
if wesnoth.is_skipping_messages() then | ||
return | ||
end | ||
|
||
skip_actions[action_id](cfg) | ||
end | ||
end | ||
|