Skip to content

Commit

Permalink
Fixed javascript\FyreVMWeb and updated extension and story to emit hi…
Browse files Browse the repository at this point in the history
…nts on story load.
  • Loading branch information
chicagodave authored and chicagodave committed Dec 4, 2016
1 parent aadcad5 commit e1f81c6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions extensions/David Cornelson/FyreVM Simple Web Hints.i7x
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ hint-channel is a channel with content name "hintContent" and content type "json
To select the hint channel:
select hint-channel;

When play begins when outputting channels:
emit hints.

Every turn when outputting channels:
emit hints;
emit hints.

To emit hints:
select the hint channel;
say "[bracket]";
Expand Down
Binary file modified projects/Cloak of Darkness/javascript/Cloak of Darkness.ulx
Binary file not shown.
18 changes: 9 additions & 9 deletions projects/Cloak of Darkness/javascript/FyreVMWeb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,30 @@ module FyreVMWeb {
// We only get the content definition on first turn... (may need to revisit this)
//
if (this.contentDefinition == undefined) {
this.contentDefinition = this.ChannelData["CMGT"].split(';');
this.contentDefinition = JSON.parse(this.ChannelData["CMGT"]);
}

fyrevm = {};

for (var channelName in this.ChannelData) {

for (var channelDef in this.contentDefinition) {
var channelDetails = this.contentDefinition[channelDef].split(',');
var chanName = this.GetChannelName(Number(channelDetails[0]));
for (var ch=0; ch < this.contentDefinition.length; ch++) {
var channelDef = this.contentDefinition[ch];
var chanName = this.GetChannelName(channelDef['id']);
if (chanName == channelName) {

switch (channelDetails[1]) {
switch (channelDef['contentType']) {
case "text":
fyrevm[channelDetails[2]] = this.ChannelData[channelName];
fyrevm[channelDef['contentName']] = this.ChannelData[channelName];
break;
case "number":
fyrevm[channelDetails[2]] = Number(this.ChannelData[channelName]);
fyrevm[channelDef['contentName']] = Number(this.ChannelData[channelName]);
break;
case "json":
fyrevm[channelDetails[2]] = JSON.parse(this.ChannelData[channelName]);
fyrevm[channelDef['contentName']] = JSON.parse(this.ChannelData[channelName]);
break;
case "css":
fyrevm[channelDetails[2]] = this.ChannelData[channelName];
fyrevm[channelDef['contentName']] = this.ChannelData[channelName];
break;
}

Expand Down
2 changes: 1 addition & 1 deletion projects/Cloak of Darkness/javascript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h1 id='title'>Cloak of Darkness</h1>
manager.InputElement = document.getElementById('commandLine');

// load the story...
manager.LoadStory("CloakofDarkness.ulx")
manager.LoadStory("Cloak of Darkness.ulx")

function processStoryInfo() {
// cache the story info...
Expand Down
Binary file modified projects/Cloak of Darkness/localStorageSample/Cloak of Darkness.ulx
Binary file not shown.

0 comments on commit e1f81c6

Please sign in to comment.