1 /* -*- Mode: C++; c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil -*-
2  *
3  * Quadra, an action puzzle game
4  * Copyright (C) 1998-2000  Ludus Design
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 
21 #ifndef _HEADER_GAME_MENU
22 #define _HEADER_GAME_MENU
23 
24 #include "net_stuff.h"
25 #include "net_call.h"
26 #include "packets.h"
27 
28 class Game;
29 class Stringtable;
30 
31 class Create_game: public Menu, public Notifyable {
32 	static int game_end_y;
33 	Bitmap *bit_;
34 	Zone *start, *cancel, *save;
35 	Zone *z_record_name;
36 	char name[32], record_name[32];
37 	Observable *game_type;
38 	Observable *record_watch;
39 	Zone *record_zone;
40 	int selected, level_up, game_end, game_end_value, game_public;
41 	int record_game;
42 	Zone_text *game_end_text;
43 	Zone_text *game_desc[10];
44 	Stringtable *game_descriptions;
45 	class Zone_state_text2 *game_end_selector;
46 	Zone_input_numeric *game_end_num;
47 	void save_setting();
48 	bool net_game, local_net;
49 	bool notified;
50 	void recreate_game_end();
51 public:
52 	Create_game(Bitmap *bit, Font *font, Font *font2, const Palette& p, bool pnet_game, bool plocal_net);
53 	virtual ~Create_game();
54 	virtual void step();
55 	virtual void notify();
56 };
57 
58 class Create_game_start: public Module {
59 	Bitmap *bit_;
60 	Font *font_;
61 	const Palette &pal;
62 public:
63 	Create_game_start(const Palette &pal_, Bitmap *bit, Font *font);
64 	virtual ~Create_game_start();
65 	virtual void init();
66 };
67 
68 class Create_game_end: public Menu {
69 	Zone *cancel;
70 	const Palette &pal;
71 public:
72 	Create_game_end(const Palette &pal_, Bitmap *bit, Font *font);
73 	virtual ~Create_game_end();
74 	virtual void step();
75 	virtual void init();
76 };
77 
78 class Join_game: public Menu, public Net_callable {
79 	Zone *cancel;
80 	Zone_text *status;
81 	Packet_wantjoin pac;
82 	Exec_ping *eping;
83 	int delay;
84 	Bitmap *bit_;
85 	Font *font2_;
86 	Dword address;
87 	int port;
88 	bool rejoin;
89 public:
90 	Join_game(Bitmap *bit, Font *font, Font *font2, const Palette& p, const char *n, Dword sa, int sport, bool prejoin);
91 	virtual ~Join_game();
92 	virtual void init();
93 	virtual void step();
94 	virtual void net_call(Packet *p2);
95 };
96 
97 class Join_download: public Menu {
98 	Bitmap *bit_;
99 	Font *font2_;
100 	int nb_total, nb_current, nb_percent;
101 	bool rejoin;
102 public:
103 	Join_download(Bitmap *bit, Font *font, Font *font2, const Palette& p, bool prejoin);
104 	virtual ~Join_download();
105 	virtual void step();
106 };
107 
108 #endif
109