Fix practice link from review.

This commit is contained in:
yukirij 2024-10-05 11:44:43 -07:00
parent 5497873189
commit e19168411f

View File

@ -650,7 +650,6 @@ const SCENES = {
} }
callback_resume = callback_resume.bind({ callback_resume = callback_resume.bind({
token: data.token, token: data.token,
player: data.player,
}); });
buttons_top.push(UI.button(LANG("resume"), callback_resume)); buttons_top.push(UI.button(LANG("resume"), callback_resume));
@ -664,7 +663,6 @@ const SCENES = {
} }
callback_review = callback_review.bind({ callback_review = callback_review.bind({
token: data.token, token: data.token,
player: data.player,
}); });
buttons_top.push(UI.button(LANG("review"), callback_review)); buttons_top.push(UI.button(LANG("review"), callback_review));
@ -676,14 +674,12 @@ const SCENES = {
let play_callback = function() { let play_callback = function() {
LOAD(SCENES.GamePractice, { LOAD(SCENES.GamePractice, {
token:this.token, token:this.token,
player:this.player, history:INTERFACE_DATA.Game.history,
history:INTERFACE_DATA.history, turn:INTERFACE_DATA.Replay.turn,
turn:INTERFACE_DATA.replay_turn, });
})
} }
play_callback = play_callback.bind({ play_callback = play_callback.bind({
token: data.token, token: data.token,
player: data.player,
}); });
buttons_top.push(UI.button(LANG("practice"), play_callback)); buttons_top.push(UI.button(LANG("practice"), play_callback));
} }
@ -755,12 +751,11 @@ const SCENES = {
LOAD(SCENES.GameLoad, { LOAD(SCENES.GameLoad, {
token:this.token, token:this.token,
mode:INTERFACE.Mode.Review, mode:INTERFACE.Mode.Review,
turn:INTERFACE_DATA.history_begin.length, turn:INTERFACE_DATA.Game.history_begin.length,
}); });
} }
callback_review = callback_review.bind({ callback_review = callback_review.bind({
token: data.token, token: data.token,
player: data.player,
}); });
buttons_top.push(UI.button(LANG("review"), callback_review)); buttons_top.push(UI.button(LANG("review"), callback_review));
@ -781,7 +776,7 @@ const SCENES = {
INTERFACE.init(data, INTERFACE.Mode.Local); INTERFACE.init(data, INTERFACE.Mode.Local);
if(data !== null) { if(data !== null) {
for(let i = 0; i < data.turn; ++i) { for(let i = 0; i < data.turn; ++i) {
INTERFACE_DATA.history_begin.push(data.history[i]); INTERFACE_DATA.Game.history_begin.push(data.history[i]);
} }
INTERFACE.reset(); INTERFACE.reset();
} }