mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
now with nice resume/run text changes. This closes #20
This commit is contained in:
parent
617afd2d4f
commit
527c914a42
@ -14,6 +14,7 @@ function attachListeners() {
|
||||
$('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.
|
||||
$('#startGameButton').on('click', startSelectedGame);
|
||||
$('#quitGameButton').on('click', stopGame);
|
||||
$('#selectGame').on('change', gameSelectUpdated);
|
||||
$(window).resize(fullscreenNaclModule);
|
||||
}
|
||||
|
||||
@ -70,7 +71,7 @@ function hideAllWorkflowDivs() {
|
||||
$('#streamSettings').css('display', 'inline-block');
|
||||
$('#hostSettings').css('display', 'inline-block');
|
||||
$('#gameSelection').css('display', 'none');
|
||||
// common.hideModule(); // do NOT hide the nacl module. you can't interact with it then
|
||||
// do NOT hide the nacl module. you can't interact with it then
|
||||
}
|
||||
|
||||
// pair button was pushed. pass what the user entered into the GFEHostIPField.
|
||||
@ -140,6 +141,7 @@ function showAppsPushed() {
|
||||
$('#selectGame')[0].appendChild(opt);
|
||||
}
|
||||
if (api.currentGame != 0) $('#selectGame')[0].value = api.currentGame;
|
||||
gameSelectUpdated(); // default the button to 'Resume Game' if one is running.
|
||||
});
|
||||
});
|
||||
showAppsMode();
|
||||
@ -154,6 +156,20 @@ function showAppsMode() {
|
||||
$("body").css('backgroundColor', 'white');
|
||||
}
|
||||
|
||||
// every time the user selects an app from the select menu,
|
||||
// we want to check if that's the currently running app
|
||||
// and if it is, we want the "run" button to change to "resume"
|
||||
function gameSelectUpdated() {
|
||||
var currentApp = $("#selectGame").val();
|
||||
api.refreshServerInfo().then(function (ret) {
|
||||
if(api.currentGame == parseInt(currentApp)) {
|
||||
$("#startGameButton")[0].innerHTML = 'Resume Game'
|
||||
} else {
|
||||
$("#startGameButton")[0].innerHTML = 'Run Game'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startSelectedGame() {
|
||||
// do NOT update the target.
|
||||
// we're just grabbing the currently selected option from #selectGame, and feeding it into NvHTTP
|
||||
|
Loading…
x
Reference in New Issue
Block a user