mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11:54 +08:00
Load event before anything else
An event could produce different notifications or rewards according to different outcomes of the event itself (e.g. a negative event impacting on buildings and/or villagers, or a wanderer leaving items of some specific kind), but the notification is generated before the onLoad() call. I'd say that this is the best action order: 1. event action 2. event notification 3. event reward (and possible additional notifications due to that)
This commit is contained in:
committed by
Blake Grotewold
parent
ebf5e6934e
commit
de705e4a5e
+5
-5
@@ -42,6 +42,11 @@ var Events = {
|
|||||||
Events.activeScene = name;
|
Events.activeScene = name;
|
||||||
var scene = Events.activeEvent().scenes[name];
|
var scene = Events.activeEvent().scenes[name];
|
||||||
|
|
||||||
|
// onLoad
|
||||||
|
if(scene.onLoad) {
|
||||||
|
scene.onLoad();
|
||||||
|
}
|
||||||
|
|
||||||
// Notify the scene change
|
// Notify the scene change
|
||||||
if(scene.notification) {
|
if(scene.notification) {
|
||||||
Notifications.notify(null, scene.notification);
|
Notifications.notify(null, scene.notification);
|
||||||
@@ -52,11 +57,6 @@ var Events = {
|
|||||||
$SM.addM('stores', scene.reward);
|
$SM.addM('stores', scene.reward);
|
||||||
}
|
}
|
||||||
|
|
||||||
// onLoad
|
|
||||||
if(scene.onLoad) {
|
|
||||||
scene.onLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#description', Events.eventPanel()).empty();
|
$('#description', Events.eventPanel()).empty();
|
||||||
$('#buttons', Events.eventPanel()).empty();
|
$('#buttons', Events.eventPanel()).empty();
|
||||||
if(scene.combat) {
|
if(scene.combat) {
|
||||||
|
|||||||
Reference in New Issue
Block a user