Update of /cvsroot/opendemo/opendemo/tools/odcut
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29968
Modified Files:
odcutgui.pm
Log Message:
store the config object from the main program into the odcutgui object
replace basic configuration values by using the config object
Index: odcutgui.pm
===================================================================
RCS file: /cvsroot/opendemo/opendemo/tools/odcut/odcutgui.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** odcutgui.pm 27 Oct 2004 19:54:13 -0000 1.46
--- odcutgui.pm 31 Oct 2004 21:52:53 -0000 1.47
***************
*** 43,46 ****
--- 43,48 ----
($self->{"output"}) = @_;
+ $self->{"config"} = $self->{"output"}->{"config"};
+ printf "config check: password='%s'\n", $self->{"config"}->game_password;
$self->CreateStatusBar(2);
***************
*** 151,155 ****
[-1,-1], [-1,-1]);
$self->{OUTPUT} = Wx::TextCtrl->new( $self, -1,
! $self->{"output"}->get_outputfile(),
[-1,-1], [-1,-1], wxTE_READONLY);
$self->{OUTPUT}->SetToolTip("Output file name");
--- 153,157 ----
[-1,-1], [-1,-1]);
$self->{OUTPUT} = Wx::TextCtrl->new( $self, -1,
! $self->{"config"}->output_file,
[-1,-1], [-1,-1], wxTE_READONLY);
$self->{OUTPUT}->SetToolTip("Output file name");
***************
*** 605,622 ****
my ($self) = @_;
- # TODO make this configurable
- if (!exists $self->{"game_dir"}) {
- $self->{"game_dir"} = "/home/uwe/games/q3a/game/linuxq3apoint-1.32b-2";
- }
- if (!exists $self->{"game_executable"}) {
- $self->{"game_executable"} = $self->{"game_dir"} . "/quake3.x86";
- }
- if (!exists $self->{"game_opendemo"}) {
- $self->{"game_opendemo"} = "od";
- }
- if (!exists $self->{"game_password"}) {
- $self->{"game_password"} = "odcut";
- }
-
# Clean up.
if (exists $self->{"odgame"}) {
--- 607,610 ----
***************
*** 635,641 ****
# Cwd::getcwd() . "/../pwrap.pl",
"xterm", "-e",
! $self->{"game_executable"},
! "+set", "fs_game", $self->{"game_opendemo"},
! "+set", "rconPassword", $self->{"game_password"},
"+sv_pure", "0",
# What a hack! We need to start this map to activate rcon.
--- 623,629 ----
# Cwd::getcwd() . "/../pwrap.pl",
"xterm", "-e",
! $self->{"config"}->game_executable,
! "+set", "fs_game", $self->{"config"}->game_opendemo,
! "+set", "rconPassword", $self->{"config"}->game_password,
"+sv_pure", "0",
# What a hack! We need to start this map to activate rcon.
***************
*** 647,651 ****
# Make sure the external binary will be started in the right directory.
my $prevdir=Cwd::getcwd();
! chdir $self->{"game_dir"};
$self->{"odgame_pid"} = Wx::ExecuteArgs( @command, wxEXEC_ASYNC,
$self->{"odgame"} );
--- 635,639 ----
# Make sure the external binary will be started in the right directory.
my $prevdir=Cwd::getcwd();
! chdir $self->{"config"}->game_dir;
$self->{"odgame_pid"} = Wx::ExecuteArgs( @command, wxEXEC_ASYNC,
$self->{"odgame"} );
***************
*** 686,690 ****
# The 'odcut' here will appear on the game console to mark the command.
! my $request = "rcon\r" . $self->{"game_password"} . "\rodcut " . $command . "\0";
my $reply = $self->SendGame($request);
--- 674,678 ----
# The 'odcut' here will appear on the game console to mark the command.
! my $request = "rcon\r" . $self->{"config"}->game_password . "\rodcut " . $command . "\0";
my $reply = $self->SendGame($request);
***************
*** 741,745 ****
# this requires, that the demo file pipe is in od.
! my $demofile = basename($output->get_outputfile());
my $map = $output->get_currentfile()->mapname();
--- 729,733 ----
# this requires, that the demo file pipe is in od.
! my $demofile = basename($self->{"config"}->output_file);
my $map = $output->get_currentfile()->mapname();
***************
*** 793,797 ****
{
my $self = shift;
! my $filename = $self->{"output"}->get_outputfile();
my $dialog = Wx::TextEntryDialog->new($self, "Create named pipe (FIFO)\n" .
"$filename with mode (octal):", "Create fifo $filename",
--- 781,785 ----
{
my $self = shift;
! my $filename = $self->{"config"}->output_file;
my $dialog = Wx::TextEntryDialog->new($self, "Create named pipe (FIFO)\n" .
"$filename with mode (octal):", "Create fifo $filename",
|