Skip to content

Commit

Permalink
Update nw.js and electron samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
hokein committed Sep 6, 2015
1 parent 09750af commit a014488
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions samples/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ function testSteamAPI() {
} else {
log('Steam API initialized successfully.');

greenworks.on('activated', function() { log('receive activated'); });
greenworks.on('activated', function() { log('receive activated'); });
greenworks.on('steam-severs-connected', function() { log('connected'); });
greenworks.on('steam-severs-disconnected', function() { log('disconnected'); });
greenworks.on('steam-sever-connect-failure', function() { log('connected failure'); });
greenworks.on('steam-shutdown', function() { log('shutdown'); });

greenworks.saveTextToFile('test_file.txt', 'test_content',
function() { log('Save text to file successfully'); },
function(err) { log('Failed on saving text to file'); });
Expand All @@ -32,6 +39,10 @@ function testSteamAPI() {
function() { log('Activating achievement successfully'); },
function(err) { log('Failed on activating achievement.'); });
log('Cloud Enabled: ' + greenworks.isCloudEnabled());

greenworks.getNumberOfPlayers(
function(a) { log("Number of players " + a) },
function(err) { log ('Failed on getting number of players'); });
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions samples/nw.js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ function testSteamAPI() {
} else {
log('Steam API initialized successfully.');

greenworks.on('activated', function() { log('receive activated'); });
greenworks.on('activated', function() { log('receive activated'); });
greenworks.on('steam-severs-connected', function() { log('connected'); });
greenworks.on('steam-severs-disconnected', function() { log('disconnected'); });
greenworks.on('steam-sever-connect-failure', function() { log('connected failure'); });
greenworks.on('steam-shutdown', function() { log('shutdown'); });

greenworks.saveTextToFile('test_file.txt', 'test_content',
function() { log('Save text to file successfully'); },
function(err) { log('Failed on saving text to file'); });
Expand All @@ -32,6 +39,10 @@ function testSteamAPI() {
function() { log('Activating achievement successfully'); },
function(err) { log('Failed on activating achievement.'); });
log('Cloud Enabled: ' + greenworks.isCloudEnabled());

greenworks.getNumberOfPlayers(
function(a) { log("Number of players " + a) },
function(err) { log ('Failed on getting number of players'); });
}
}
}
Expand Down

0 comments on commit a014488

Please sign in to comment.