html/core/engine.js in gamefic-sdk-1.4.1 vs html/core/engine.js in gamefic-sdk-1.5.0
- old
+ new
@@ -6,11 +6,12 @@
var lastInput = null;
var lastPrompt = null;
var getResponse = function(withOutput) {
var r = {
output: (withOutput ? Opal.GameficOpal.$static_user().$flush() : null),
- state: Opal.GameficOpal.$static_plot().$scenes().$fetch(Opal.GameficOpal.$static_character().$scene()).$type(),
+ //state: Opal.GameficOpal.$static_plot().$scenes().$fetch(Opal.GameficOpal.$static_character().$scene()).$type(),
+ state: Opal.GameficOpal.$static_character().$scene().$type(),
prompt: lastPrompt,
input: lastInput,
testing: (Opal.GameficOpal.$static_character().$queue().$length() > 0)
}
return r;
@@ -26,11 +27,11 @@
}
return {
start: function() {
Opal.GameficOpal.$load_scripts();
Opal.GameficOpal.$static_plot().$introduce(Opal.GameficOpal.$static_character());
- lastPrompt = Opal.GameficOpal.$static_plot().$scenes().$fetch(Opal.GameficOpal.$static_character().$scene()).$prompt_for(Opal.GameficOpal.$static_character());
+ lastPrompt = Opal.GameficOpal.$static_character().$prompt();
this.update('');
},
update: function(input) {
if (input != null) {
Opal.GameficOpal.$static_character().$queue().$push(input);
@@ -40,14 +41,14 @@
inputCallbacks.forEach(function(callback) {
callback(response);
});
Opal.GameficOpal.$static_plot().$update();
Opal.GameficOpal.$static_plot().$ready();
- lastPrompt = Opal.GameficOpal.$static_plot().$scenes().$fetch(Opal.GameficOpal.$static_character().$scene()).$prompt_for(Opal.GameficOpal.$static_character());
+ lastPrompt = Opal.GameficOpal.$static_character().$prompt();
response = getResponse(true);
var updateResponse = response;
doReady(response);
- lastPrompt = Opal.GameficOpal.$static_plot().$scenes().$fetch(Opal.GameficOpal.$static_character().$scene()).$prompt_for(Opal.GameficOpal.$static_character());
+ lastPrompt = Opal.GameficOpal.$static_character().$prompt();
response = getResponse(true);
response.output = updateResponse.output + response.output;
handle(response);
finishCallbacks.forEach(function(callback) {
callback(response);