ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/deliantra
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/deliantra (file contents):
Revision 1.28 by root, Thu Mar 20 22:28:35 2008 UTC vs.
Revision 1.29 by root, Mon Mar 24 00:24:47 2008 UTC

190our $SDL_ACTIVE; 190our $SDL_ACTIVE;
191our %SDL_CB; 191our %SDL_CB;
192 192
193our $ALT_ENTER_MESSAGE; 193our $ALT_ENTER_MESSAGE;
194our $STATUSBOX; 194our $STATUSBOX;
195our $MODBOX;
195our $DEBUG_STATUS; 196our $DEBUG_STATUS;
196 197
197our $INV; 198our $INV;
198our $INVR; 199our $INVR;
199our $INVR_HB; 200our $INVR_HB;
208 $DEBUG_STATUS->set_text ($_[0]); 209 $DEBUG_STATUS->set_text ($_[0]);
209} 210}
210 211
211sub message { 212sub message {
212 $MESSAGE_DIST->message (@_); 213 $MESSAGE_DIST->message (@_);
214}
215
216sub update_modbox {
217 my $mod = DC::SDL_GetModState;
218
219 my $markup;
220
221 $markup .= $mod & DC::KMOD_CTRL
222 ? ($MAPWIDGET->{ctrl} ? "[REPEAT]" : "[<span foreground='#888'>REPEAT</span>]")
223 : "[<span foreground='#888'> once </span>]";
224
225 $markup .= $mod & DC::KMOD_SHIFT
226 ? ($MAPWIDGET->{shft} ? "[FIRE]" : "[<span foreground='#888'>FIRE</span>]")
227 : "[<span foreground='#888'>move</span>]";
228
229 $markup .= $mod & (DC::KMOD_ALT | DC::KMOD_META)
230 ? "[ALT]"
231 : "[<span foreground='#888'>alt</span>]";
232
233 $markup .= $mod & DC::KMOD_NUM
234 ? "[NUM]"
235 : "[<span foreground='#888'>num</span>]";
236
237 $MODBOX->set_markup ($markup);
213} 238}
214 239
215############################################################################# 240#############################################################################
216#TODO: maybe move into own audio module... 241#TODO: maybe move into own audio module...
217 242
2146 force_x => "max", 2171 force_x => "max",
2147 force_y => 0; 2172 force_y => 0;
2148 $DEBUG_STATUS->show; 2173 $DEBUG_STATUS->show;
2149 2174
2150 $STATUSBOX = new DC::UI::Statusbox; 2175 $STATUSBOX = new DC::UI::Statusbox;
2151 $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]); 2176
2177 $MODBOX = new DC::UI::Label
2178 can_events => 1,
2179 can_hover => 1,
2180 markup => "",
2181 align => 0,
2182 font => $FONT_FIXED,
2183 tooltip => "#modifier_box";
2184
2185 update_modbox;
2152 2186
2153 (new DC::UI::Frame 2187 (new DC::UI::Frame
2154 bg => [0, 0, 0, 0.4], 2188 bg => [0, 0, 0, 0.4],
2155 force_x => 0, 2189 force_x => 0,
2156 force_y => "max", 2190 force_y => "max",
2157 child => $STATUSBOX, 2191 child => (my $LR = new DC::UI::VBox),
2158 )->show; 2192 )->show;
2193
2194 $LR->add ($STATUSBOX);
2195 $LR->add ($MODBOX);
2196 $LR->add (new DC::UI::Label
2197 align => 0,
2198 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode",
2199 fontsize => 0.5,
2200 fg => [1, 1, 0, 0.7],
2201 );
2159 2202
2160 DC::UI::Toplevel->new ( 2203 DC::UI::Toplevel->new (
2161 title => "Minimap", 2204 title => "Minimap",
2162 name => "mapmap", 2205 name => "mapmap",
2163 x => 0, 2206 x => 0,
2345 # alt-enter 2388 # alt-enter
2346 $FULLSCREEN_ENABLE->toggle; 2389 $FULLSCREEN_ENABLE->toggle;
2347 video_shutdown; 2390 video_shutdown;
2348 video_init; 2391 video_init;
2349 } else { 2392 } else {
2350 DC::UI::feed_sdl_key_down_event ($_[0]); 2393 &DC::UI::feed_sdl_key_down_event;
2351 } 2394 }
2395 update_modbox;
2352 }, 2396 },
2353 DC::SDL_KEYUP => \&DC::UI::feed_sdl_key_up_event, 2397 DC::SDL_KEYUP => sub {
2398 &DC::UI::feed_sdl_key_up_event;
2399 update_modbox;
2400 },
2354 DC::SDL_MOUSEMOTION => \&DC::UI::feed_sdl_motion_event, 2401 DC::SDL_MOUSEMOTION => \&DC::UI::feed_sdl_motion_event,
2355 DC::SDL_MOUSEBUTTONDOWN => \&DC::UI::feed_sdl_button_down_event, 2402 DC::SDL_MOUSEBUTTONDOWN => \&DC::UI::feed_sdl_button_down_event,
2356 DC::SDL_MOUSEBUTTONUP => \&DC::UI::feed_sdl_button_up_event, 2403 DC::SDL_MOUSEBUTTONUP => \&DC::UI::feed_sdl_button_up_event,
2357 DC::SDL_USEREVENT => sub { 2404 DC::SDL_USEREVENT => sub {
2358 if ($_[0]{code} == 1) { 2405 if ($_[0]{code} == 1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines