38 return yoffset + counter * spacing + 5;
52 int y = yoffset + counter * spacing;
55 colbar->SetTransparency( 128 );
58 int y1 = Width() * 4 / 10;
60 pw.name =
new PG_LineEdit( colbar, PG_Rect( 40, 5, y1 - 40, 20 ));
64 PG_Rect r = PG_Rect( y1 + 20, 5, colbar->Width() - y1 - 40, 20 );
66 pw.type =
new PG_DropDown( colbar, r);
75 pw.type->SetEditable(
false);
77 pw.name->SetEditable(
false );
79 PG_LineEdit* le =
new PG_LineEdit( colbar, r );
81 le->SetEditable(
false );
84 PG_ThemeWidget* col =
new PG_ThemeWidget( colbar, PG_Rect( 5, 5, 20, 20 ));
85 col->SetSimpleBackground(
true);
87 col->SetBorderSize(0);
89 playerWidgets.push_back( pw );
101 for ( vector<PlayerWidgets>::iterator i = playerWidgets.begin(); i != playerWidgets.end(); ++i )
108 if ( humanNum > 1 ) {
109 MessagingHub::Instance().error(
"Only a single human player allowed in SinglePlayer mode allowed!");
121 for ( vector<PlayerWidgets>::iterator i = playerWidgets.begin(); i != playerWidgets.end(); ++i ) {
136 PG_Button* ok =
new PG_Button(
this, PG_Rect( Width() - 200, Height() - 30, 90, 20 ),
"OK" );
138 PG_Button* cancel =
new PG_Button(
this, PG_Rect( Width() - 100, Height() - 30, 90, 20 ),
"Cancel" );
139 cancel->sigClick.connect( sigc::hide( sigc::mem_fun( *
this, &PlayerSetupWindow::QuitModal )));
153 PlayerSetupWindow asw ( actmap, supervisor, NULL, PG_Rect( 100, 100, 600, 500 ));
static const char * playerStatusNames[]
ASCString getName() const
returns the name of the player
void setName(const ASCString &name)
void setupPlayers(GameMap *actmap, bool supervisor)
enum Player::PlayerStatus stat
Adapter class for using Paragui Dialogs in ASC. This class transfers the event control from ASC to Pa...
PlayerSetupWindow(GameMap *actmap, bool allEditable, PG_Widget *parent, const PG_Rect &r)
DI_Color getColor() const
signed char actplayer
the player who is currently making his moves (may be human or AI)
PlayerStatus
the status of the player
int getPlayerCount() const
bool exist() const
does the player exist at all
The map. THE central structure of ASC, which holds everything not globally available together...