… | |
… | |
167 | our $STATUSBOX; |
167 | our $STATUSBOX; |
168 | our $DEBUG_STATUS; |
168 | our $DEBUG_STATUS; |
169 | |
169 | |
170 | our $INV; |
170 | our $INV; |
171 | our $INVR; |
171 | our $INVR; |
172 | our $INV_RIGHT_HB; |
172 | our $INVR_HB; |
173 | |
|
|
174 | our $PICKUP_CFG; |
|
|
175 | |
173 | |
176 | ############################################################################# |
174 | ############################################################################# |
177 | |
175 | |
178 | sub status { |
176 | sub status { |
179 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
177 | $STATUSBOX->add (CFPlus::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
… | |
… | |
771 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
769 | on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } |
772 | ); |
770 | ); |
773 | |
771 | |
774 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1"); |
772 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1"); |
775 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
773 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
776 | state => $CFG->{opengl11}, |
774 | state => $CFG->{force_opengl11}, |
777 | tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in " |
775 | tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in " |
778 | . "higher memory usage and slower performance. It will, however, help tremendously on " |
776 | . "higher memory usage and slower performance. It will, however, help tremendously on " |
779 | . "cards that claim to support a feature but fall back to software rendering. " |
777 | . "cards that claim to support a feature but fall back to software rendering. " |
780 | . "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, " |
778 | . "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, " |
781 | . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you " |
779 | . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you " |
782 | . "experience extremely low framerates and your card should do better, try this option.</b>", |
780 | . "experience extremely low framerates and your card should do better, try this option.</b>", |
783 | on_changed => sub { my ($self, $value) = @_; $CFG->{opengl11} = $value; 0 } |
781 | on_changed => sub { my ($self, $value) = @_; $CFG->{force_opengl11} = $value; 0 } |
|
|
782 | ); |
|
|
783 | |
|
|
784 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Compress Textures"); |
|
|
785 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
|
|
786 | state => $CFG->{texture_compression}, |
|
|
787 | tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " |
|
|
788 | . "will save a lot of memory and increase performance. The compression algorithm " |
|
|
789 | . "can differ form card to card, so your mileage may vary.", |
|
|
790 | on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } |
784 | ); |
791 | ); |
785 | |
792 | |
786 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
793 | $table->add_at (0, $row, new CFPlus::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
787 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
794 | $table->add_at (1, $row++, new CFPlus::UI::CheckBox |
788 | state => $CFG->{fast}, |
795 | state => $CFG->{fast}, |
… | |
… | |
1610 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1617 | $sw1->add ($INV = new CFPlus::UI::Inventory); |
1611 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1618 | $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); |
1612 | |
1619 | |
1613 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1620 | $hb->add (my $vb2 = new CFPlus::UI::VBox); |
1614 | |
1621 | |
1615 | $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox); |
1622 | $vb2->add ($INVR_HB = new CFPlus::UI::HBox); |
1616 | |
1623 | |
1617 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1624 | $vb2->add (my $sw2 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1618 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1625 | $sw2->add ($INVR = new CFPlus::UI::Inventory); |
1619 | |
1626 | |
1620 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1627 | # XXX: Call after $INVR = ... because set_opencont sets the items |
… | |
… | |
1875 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1882 | on_activate => sub { $QUIT_DIALOG->hide; 0 }, |
1876 | ); |
1883 | ); |
1877 | $hb->add (new CFPlus::UI::Button |
1884 | $hb->add (new CFPlus::UI::Button |
1878 | text => "Quit anyway", |
1885 | text => "Quit anyway", |
1879 | expand => 1, |
1886 | expand => 1, |
1880 | on_activate => sub { exit }, |
1887 | on_activate => sub { Event::unloop_all }, |
1881 | ); |
1888 | ); |
1882 | } |
1889 | } |
1883 | |
1890 | |
1884 | $QUIT_DIALOG->show; |
1891 | $QUIT_DIALOG->show; |
1885 | $QUIT_DIALOG->grab_focus; |
1892 | $QUIT_DIALOG->grab_focus; |
… | |
… | |
2079 | tooltip => "Terminates the program", |
2086 | tooltip => "Terminates the program", |
2080 | on_activate => sub { |
2087 | on_activate => sub { |
2081 | if ($CONN) { |
2088 | if ($CONN) { |
2082 | open_quit_dialog; |
2089 | open_quit_dialog; |
2083 | } else { |
2090 | } else { |
2084 | exit; |
2091 | Event::unloop_all; |
2085 | } |
2092 | } |
2086 | 0 |
2093 | 0 |
2087 | }, |
2094 | }, |
2088 | ); |
2095 | ); |
2089 | |
2096 | |
2090 | $BUTTONBAR->show; |
2097 | $BUTTONBAR->show; |
2091 | $SETUP_DIALOG->show; |
2098 | $SETUP_DIALOG->show; |
|
|
2099 | $MESSAGE_WINDOW->show; |
2092 | } |
2100 | } |
2093 | |
2101 | |
2094 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
2102 | $STATUSBOX->add ("Set video mode $WIDTH×$HEIGHT", timeout => 10, fg => [1, 1, 1, 0.5]); |
2095 | } |
2103 | } |
2096 | |
2104 | |
… | |
… | |
2190 | CFPlus::DB::Server::run; |
2198 | CFPlus::DB::Server::run; |
2191 | |
2199 | |
2192 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2200 | CFPlus::UI::set_layout ($::CFG->{layout}); |
2193 | |
2201 | |
2194 | my %DEF_CFG = ( |
2202 | my %DEF_CFG = ( |
2195 | sdl_mode => 0, |
2203 | sdl_mode => 0, |
2196 | fullscreen => 0, |
2204 | fullscreen => 0, |
2197 | fast => 0, |
2205 | fast => 0, |
2198 | opengl11 => 0, |
2206 | force_opengl11 => undef, |
|
|
2207 | texture_compression => 1, |
2199 | map_scale => 1, |
2208 | map_scale => 1, |
2200 | fow_enable => 1, |
2209 | fow_enable => 1, |
2201 | fow_intensity => 0, |
2210 | fow_intensity => 0, |
2202 | map_smoothing => 1, |
2211 | map_smoothing => 1, |
2203 | gui_fontsize => 1, |
2212 | gui_fontsize => 1, |
2204 | log_fontsize => 0.7, |
2213 | log_fontsize => 0.7, |
2205 | gauge_fontsize => 1, |
2214 | gauge_fontsize => 1, |
2206 | gauge_size => 0.35, |
2215 | gauge_size => 0.35, |
2207 | stat_fontsize => 0.7, |
2216 | stat_fontsize => 0.7, |
2208 | mapsize => 100, |
2217 | mapsize => 100, |
2209 | audio_enable => 1, |
2218 | audio_enable => 1, |
2210 | effects_enable => 1, |
2219 | effects_enable => 1, |
2211 | effects_volume => 1, |
2220 | effects_volume => 1, |
2212 | bgm_enable => 1, |
2221 | bgm_enable => 1, |
2213 | bgm_volume => 0.5, |
2222 | bgm_volume => 0.5, |
2214 | output_sync => 1, |
2223 | output_sync => 1, |
2215 | output_count => 1, |
2224 | output_count => 1, |
2216 | output_rate => "", |
2225 | output_rate => "", |
2217 | pickup => 0, |
2226 | pickup => 0, |
2218 | inv_sort => "mtime", |
2227 | inv_sort => "mtime", |
2219 | default => "profile", # default profile |
2228 | default => "profile", # default profile |
2220 | show_tips => 1, |
2229 | show_tips => 1, |
2221 | logview_max_par => 1000, |
2230 | logview_max_par => 1000, |
2222 | ); |
2231 | ); |
2223 | |
2232 | |
2224 | while (my ($k, $v) = each %DEF_CFG) { |
2233 | while (my ($k, $v) = each %DEF_CFG) { |
2225 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2234 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2226 | } |
2235 | } |
… | |
… | |
2292 | } |
2301 | } |
2293 | |
2302 | |
2294 | show_tip_of_the_day if $CFG->{show_tips}; |
2303 | show_tip_of_the_day if $CFG->{show_tips}; |
2295 | |
2304 | |
2296 | Event::loop; |
2305 | Event::loop; |
|
|
2306 | |
|
|
2307 | #video_shutdown; |
|
|
2308 | #audio_shutdown; |
2297 | #CFPlus::SDL_Quit; |
2309 | CFPlus::SDL_Quit; |
2298 | #CFPlus::_exit 0; |
|
|
2299 | |
|
|
2300 | END { |
|
|
2301 | video_shutdown; |
|
|
2302 | audio_shutdown; |
|
|
2303 | CFPlus::SDL_Quit; |
|
|
2304 | CFPlus::DB::Server::stop; |
2310 | CFPlus::DB::Server::stop; |
2305 | } |
|
|
2306 | |
2311 | |
2307 | =head1 NAME |
2312 | =head1 NAME |
2308 | |
2313 | |
2309 | cfplus - A Crossfire TRT and Crossfire game client |
2314 | cfplus - A Crossfire TRT and Crossfire game client |
2310 | |
2315 | |