|
| 1 | +Game.ImportLibrary("gui/scripts/cinematics_items.lua") |
| 2 | +cinematics = cinematics ~= nil and cinematics or {} |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +function cinematics.OnCutsceneStarted(_ARG_0_, _ARG_1_) |
| 11 | + if not _ARG_1_ then |
| 12 | + local cinematic = cinematics.GetCinematicDefFromPath(_ARG_0_) |
| 13 | + if cinematic ~= nil then |
| 14 | + cinematics.SetCinematicUnlocked(cinematic.sCutscene, true) |
| 15 | + end |
| 16 | + end |
| 17 | +end |
| 18 | + |
| 19 | + |
| 20 | +function cinematics.GetCinematicDefFromPath(_ARG_0_) |
| 21 | + local ret; |
| 22 | + local match = string.match(_ARG_0_, "/(.-)/") |
| 23 | + utils.LOG(utils.LOGTYPE_DEFAULT, "Searching cinematic " .. match) |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + for _FORV_6_, _FORV_7_ in ipairs(cinematics_items.tDefs.tGeneral.aItems) do |
| 28 | + if _FORV_7_.sCutscene == match then |
| 29 | + ret = _FORV_7_ |
| 30 | + break |
| 31 | + end |
| 32 | + end |
| 33 | + return ret |
| 34 | +end |
| 35 | + |
| 36 | + |
| 37 | +function cinematics.SetCinematicUnlocked(_ARG_0_, _ARG_1_) |
| 38 | + local unlocked = cinematics.IsCinematicUnlocked(_ARG_0_) |
| 39 | + Blackboard.SetProp("CINEMATICS", _ARG_0_, "b", _ARG_1_) |
| 40 | +end |
| 41 | + |
| 42 | + |
| 43 | +function cinematics.HasAnyUnlockedCinematic() |
| 44 | + local ret = false |
| 45 | + |
| 46 | + for _FORV_4_, _FORV_5_ in ipairs(cinematics_items.tDefs.tGeneral.aItems) do |
| 47 | + if cinematics.IsCinematicUnlocked(_FORV_5_.sCutscene) then |
| 48 | + ret = true |
| 49 | + break |
| 50 | + end |
| 51 | + end |
| 52 | + |
| 53 | + return ret |
| 54 | +end |
| 55 | + |
| 56 | + |
| 57 | +function cinematics.HasAnyNewUnlockedCinematic() |
| 58 | + local ret = false |
| 59 | + |
| 60 | + for _FORV_4_, _FORV_5_ in ipairs(cinematics_items.tDefs.tGeneral.aItems) do |
| 61 | + if cinematics.IsCinematicNew(_FORV_5_.sCutscene) then |
| 62 | + ret = true |
| 63 | + break |
| 64 | + end |
| 65 | + end |
| 66 | + |
| 67 | + return ret |
| 68 | +end |
| 69 | + |
| 70 | + |
| 71 | +function cinematics.IsCinematicNew(_ARG_0_) |
| 72 | + return cinematics.IsCinematicUnlocked(_ARG_0_) and ProfileBlackboard.GetProp("CINEMATICS", _ARG_0_ .. "_NEW") ~= false |
| 73 | +end |
| 74 | + |
| 75 | + |
| 76 | +function cinematics.IsCinematicUnlocked(_ARG_0_) |
| 77 | + |
| 78 | + if Blackboard.GetProp("GAME", "I_AM_A_CHEATER") then |
| 79 | + return true |
| 80 | + end |
| 81 | + return Blackboard.GetProp("CINEMATICS", _ARG_0_) == true |
| 82 | +end |
0 commit comments