game over gui in progress

This commit is contained in:
xxsoca 2023-06-23 15:15:18 +02:00
parent bea4988138
commit 378f81b32c
3 changed files with 17 additions and 2 deletions

BIN
Winner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

16
gui.pl
View File

@ -270,6 +270,7 @@ show_controls(D) :-
player_tokens(Player, Tokens), player_tokens(Player, Tokens),
string_concat('Aktiv: Spieler ', Player, String_active_player), string_concat('Aktiv: Spieler ', Player, String_active_player),
string_concat('Tokens: ', Tokens, String_tokens), string_concat('Tokens: ', Tokens, String_tokens),
% die Bausteine zur Steuerung % die Bausteine zur Steuerung
send(Controls, append, new(Label1, label(name, String_active_player))), send(Controls, append, new(Label1, label(name, String_active_player))),
send(Controls, append, new(Label4, label(name, String_tokens))), send(Controls, append, new(Label4, label(name, String_tokens))),
@ -281,7 +282,7 @@ show_controls(D) :-
send(Controls, append, new(ToY,text_item('Y:'))), send(Controls, append, new(ToY,text_item('Y:'))),
send(Controls, append, button('Bestaetigen',message(@prolog, process_move_unit, FromX, FromY, ToX, ToY, Controls))), send(Controls, append, button('Bestaetigen',message(@prolog, process_move_unit, FromX, FromY, ToX, ToY, Controls))),
send(Controls, append, button('Zug Beenden',message(@prolog, process_end_turn))), send(Controls, append, button('Zug Beenden',message(@prolog, process_end_turn))),
%send(D, left, Controls),
send(Controls, open), send(Controls, open),
assert(game_control(Controls)). assert(game_control(Controls)).
@ -316,6 +317,19 @@ process_end_turn :-
update_controls, update_controls,
spielfeld. spielfeld.
game_over_gui(Winner) :-
game_control(C),
game_window(D),
send(C, destroy),
send(D, destroy),
new(G, dialog('Winner')),
new(I, image('Winner.gif')),
new(B, bitmap(I)),
send(G, display, B),
send(G, append, new(Label, label(name, Winner))),
send(G, open).
%TODO delete %TODO delete
test_change :- test_change :-
new(D, dialog), new(D, dialog),

View File

@ -185,6 +185,7 @@ game_over(Winner) :-
% Falls das Spiel vorbei ist, mach nix % Falls das Spiel vorbei ist, mach nix
end_turn :- end_turn :-
game_over(Winner), game_over(Winner),
game_over_gui(Winner),
write("Game Over!"), nl, write("Game Over!"), nl,
write("Player "), write("Player "),
@ -232,7 +233,7 @@ calc_tokens(Tokens) :-
last_turn(LastTurn), last_turn(LastTurn),
PreLastTurn is LastTurn - 1, PreLastTurn is LastTurn - 1,
player_turn(Player, LastTurn, Tlast) player_turn(Player, LastTurn, Tlast),
player_turn(Player, PreLastTurn, Tprelast), player_turn(Player, PreLastTurn, Tprelast),
% Neue Anzahl der Tokens ausgeben % Neue Anzahl der Tokens ausgeben