Remove militia placement restriction for promoted pieces; and language file.

This commit is contained in:
yukirij 2024-08-18 22:08:38 -07:00
parent 102a5aa0ea
commit 9f7439eacf
6 changed files with 35 additions and 8 deletions

View File

@ -147,6 +147,7 @@ async fn main()
]).ok();
cache.cache_file_group("text/javascript", "/.js", &[
"www/js/const.js",
"www/js/language.js",
"www/js/util.js",
"www/js/game_asset.js",
"www/js/game.js",

View File

@ -482,11 +482,12 @@ pub async fn thread_system(mut app:App, bus:Bus<protocol::QRPacket>)
}
// SessionRetire
QRPacketData::QSessionRetire(_request) => {
QRPacketData::QSessionRetire(request) => {
println!("Request: Session Retire");
//
// Not implemented
//
if let Some(_session) = app.sessions.get_mut(&request.token) {
}
Some(QRPacket::new(0, QRPacketData::None))
}
@ -564,10 +565,8 @@ pub async fn thread_system(mut app:App, bus:Bus<protocol::QRPacket>)
}
}
println!("sendblock");
if request.status != STATUS_ERROR {
for packet in packets {
println!("sendto: {}", packet.id);
app.send_response(packet).await;
}

View File

@ -224,7 +224,7 @@ GAME.Game = class {
let hex = this.board.tiles[piece.tile].hex;
// Check if column has militia.
if(piece.piece == GAME.Const.PieceId.Militia) {
if(piece.piece == GAME.Const.PieceId.Militia && !piece.promoted) {
this.board.columns[hex.x].militia[piece.player] = true;
}

View File

@ -821,6 +821,15 @@ const INTERFACE = {
INTERFACE_DATA.mirror = !INTERFACE_DATA.mirror;
INTERFACE.draw();
},
retire() {
if(INTERFACE_DATA.online) {
MESSAGE_COMPOSE([
OpCode.SessionRetire,
INTERFACE_DATA.token,
]);
}
}
};
INTERFACE.Radius = 2.0 / Math.sqrt(3.0);

18
www/js/language.js Normal file
View File

@ -0,0 +1,18 @@
const LANGUAGE = { };
LANGUAGE.Term = class {
constructor(en, jp) {
this.data = [ en, jp ];
}
};
LANGUAGE.Terms = {
Dawn: new Term( "Dawn", "暁" ),
Dusk: new Term( "Dusk", "黄昏" ),
Handle: new Term( "Handle", "" ),
Secret: new Term( "Secret", "" ),
Browse: new Term( "Resume", "" ),
Resume: new Term( "Resume", "" ),
};

View File

@ -503,7 +503,7 @@ const SCENES = {
if(data === null) { return false; }
let buttons_bottom = [ ];
if(data.mode != 2) { buttons_bottom.push(UI.button("Retire", () => { })); }
if(data.mode != 2) { buttons_bottom.push(UI.button("Retire", () => { INTERFACE.retire(); })); }
buttons_bottom.push(UI.button("Back", () => { LOAD(SCENES.Browse) }));
UI.nav([