… | |
… | |
136 | $rem += $_ - $i; |
136 | $rem += $_ - $i; |
137 | $_ = $i; |
137 | $_ = $i; |
138 | } |
138 | } |
139 | } |
139 | } |
140 | |
140 | |
|
|
141 | sub full_refresh { |
|
|
142 | # make a copy, otherwise for complains about freed values. |
|
|
143 | my @widgets = values %WIDGET; |
|
|
144 | |
|
|
145 | $_->update |
|
|
146 | for @widgets; |
|
|
147 | } |
|
|
148 | |
141 | # call when resolution changes etc. |
149 | # call when resolution changes etc. |
142 | sub rescale_widgets { |
150 | sub rescale_widgets { |
143 | my ($sx, $sy) = @_; |
151 | my ($sx, $sy) = @_; |
144 | |
152 | |
|
|
153 | # make a copy, otherwise for complains about freed values. |
145 | for my $widget (values %WIDGET) { |
154 | my @widgets = values %WIDGET; |
|
|
155 | |
|
|
156 | for my $widget (@widgets) { |
146 | if ($widget->{toplevel}) { |
157 | if ($widget->{toplevel}) { |
147 | $widget->{x} = int 0.5 + $widget->{x} * $sx if exists $widget->{x}; |
158 | $widget->{x} = int 0.5 + $widget->{x} * $sx if exists $widget->{x}; |
148 | $widget->{w} = int 0.5 + $widget->{w} * $sx if exists $widget->{w}; |
159 | $widget->{w} = int 0.5 + $widget->{w} * $sx if exists $widget->{w}; |
149 | $widget->{req_w} = int 0.5 + $widget->{req_w} * $sx if exists $widget->{req_w}; |
160 | $widget->{req_w} = int 0.5 + $widget->{req_w} * $sx if exists $widget->{req_w}; |
150 | $widget->{user_w} = int 0.5 + $widget->{user_w} * $sx if exists $widget->{user_w}; |
161 | $widget->{user_w} = int 0.5 + $widget->{user_w} * $sx if exists $widget->{user_w}; |
… | |
… | |
195 | %$self = (); |
206 | %$self = (); |
196 | } |
207 | } |
197 | |
208 | |
198 | sub show { |
209 | sub show { |
199 | my ($self) = @_; |
210 | my ($self) = @_; |
200 | |
|
|
201 | return if $self->{parent}; |
211 | return if $self->{parent}; |
202 | |
212 | |
203 | $CFClient::UI::ROOT->add ($self); |
213 | $CFClient::UI::ROOT->add ($self); |
|
|
214 | } |
|
|
215 | |
|
|
216 | sub show_centered { |
|
|
217 | my ($self) = @_; |
|
|
218 | return if $self->{parent}; |
|
|
219 | |
|
|
220 | $self->show; |
|
|
221 | |
|
|
222 | $CFClient::UI::ROOT->on_post_alloc ( |
|
|
223 | "centered $self" => sub { |
|
|
224 | $self->move (($::WIDTH - $self->{w}) * 0.5, ($::HEIGHT - $self->{h}) * 0.5); |
|
|
225 | }, |
|
|
226 | ); |
204 | } |
227 | } |
205 | |
228 | |
206 | sub hide { |
229 | sub hide { |
207 | my ($self) = @_; |
230 | my ($self) = @_; |
208 | |
231 | |
… | |
… | |
416 | Scalar::Util::weaken ($self->{parent} = $parent); |
439 | Scalar::Util::weaken ($self->{parent} = $parent); |
417 | |
440 | |
418 | # TODO: req_w _does_change after ->reconfigure |
441 | # TODO: req_w _does_change after ->reconfigure |
419 | $self->check_size |
442 | $self->check_size |
420 | unless exists $self->{req_w}; |
443 | unless exists $self->{req_w}; |
|
|
444 | |
|
|
445 | $self->show; |
421 | } |
446 | } |
422 | |
447 | |
423 | sub check_size { |
448 | sub check_size { |
424 | my ($self, $forced) = @_; |
449 | my ($self, $forced) = @_; |
425 | |
450 | |
… | |
… | |
688 | $self->{texture} = new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub { |
713 | $self->{texture} = new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub { |
689 | glClearColor 0, 0, 0, 0; |
714 | glClearColor 0, 0, 0, 0; |
690 | glClear GL_COLOR_BUFFER_BIT; |
715 | glClear GL_COLOR_BUFFER_BIT; |
691 | |
716 | |
692 | $self->_render; |
717 | $self->_render; |
693 | # glColorMask 1, 1, 1, 0; |
|
|
694 | # glEnable GL_BLEND; |
|
|
695 | # glBlendFunc GL_SRC_ALPHA, GL_ZERO; |
|
|
696 | # glRasterPos 0, 0; |
|
|
697 | # glCopyPixels 0, 0, $self->{w}, $self->{h}; |
|
|
698 | # glDisable GL_BLEND; |
|
|
699 | # glColorMask 1, 1, 1, 1; |
|
|
700 | }; |
718 | }; |
701 | } |
719 | } |
702 | |
720 | |
703 | sub _draw { |
721 | sub _draw { |
704 | my ($self) = @_; |
722 | my ($self) = @_; |
… | |
… | |
708 | my $tex = $self->{texture} |
726 | my $tex = $self->{texture} |
709 | or return; |
727 | or return; |
710 | |
728 | |
711 | glEnable GL_TEXTURE_2D; |
729 | glEnable GL_TEXTURE_2D; |
712 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
730 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
713 | glColor 0, 0, 0, 1; |
731 | glColor 1, 1, 1, 1; |
714 | |
732 | |
715 | $tex->draw_quad_alpha_premultiplied (0, 0, $w, $h); |
733 | $tex->draw_quad_alpha_premultiplied (0, 0, $w, $h); |
716 | |
734 | |
717 | glDisable GL_TEXTURE_2D; |
735 | glDisable GL_TEXTURE_2D; |
718 | } |
736 | } |
… | |
… | |
725 | |
743 | |
726 | sub size_request { |
744 | sub size_request { |
727 | my ($self) = @_; |
745 | my ($self) = @_; |
728 | |
746 | |
729 | @$self{qw(child_w child_h)} = @{$self->child}{qw(req_w req_h)}; |
747 | @$self{qw(child_w child_h)} = @{$self->child}{qw(req_w req_h)}; |
730 | $self->child->configure (0, 0, @$self{qw(child_w child_h)}); |
|
|
731 | |
748 | |
732 | @$self{qw(child_w child_h)} |
749 | @$self{qw(child_w child_h)} |
733 | } |
750 | } |
734 | |
751 | |
735 | sub size_allocate { |
752 | sub size_allocate { |
736 | my ($self, $w, $h) = @_; |
753 | my ($self, $w, $h) = @_; |
737 | |
754 | |
|
|
755 | my ($cw, $ch) = @$self{qw(child_w child_h)}; |
|
|
756 | # $w = $self->{w}; |
|
|
757 | $self->child->configure (0, 0, $cw, $ch); |
738 | $self->update; |
758 | $self->update; |
739 | } |
759 | } |
740 | |
760 | |
741 | sub set_offset { |
761 | sub set_offset { |
742 | my ($self, $x, $y) = @_; |
762 | my ($self, $x, $y) = @_; |
… | |
… | |
801 | $self->{vp}->set_offset (0, $_[1] * ($self->{vp}{child_h} - $self->{vp}{h})); |
821 | $self->{vp}->set_offset (0, $_[1] * ($self->{vp}{child_h} - $self->{vp}{h})); |
802 | }, |
822 | }, |
803 | ; |
823 | ; |
804 | |
824 | |
805 | $self = $class->SUPER::new ( |
825 | $self = $class->SUPER::new ( |
806 | vp => (new CFClient::UI::ViewPort), |
826 | vp => (new CFClient::UI::ViewPort expand => 1), |
807 | slider => $slider, |
827 | slider => $slider, |
808 | @_, |
828 | @_, |
809 | ); |
829 | ); |
810 | |
830 | |
811 | $self->{vp}->add ($self->{scrolled}); |
831 | $self->{vp}->add ($self->{scrolled}); |
… | |
… | |
1297 | #bg => none |
1317 | #bg => none |
1298 | #active_bg => none |
1318 | #active_bg => none |
1299 | #font => default_font |
1319 | #font => default_font |
1300 | #text => initial text |
1320 | #text => initial text |
1301 | #markup => initial narkup |
1321 | #markup => initial narkup |
|
|
1322 | #max_w => maximum pixel width |
|
|
1323 | ellipsise => 3, # end |
1302 | layout => (new CFClient::Layout), |
1324 | layout => (new CFClient::Layout), |
1303 | fontsize => 1, |
1325 | fontsize => 1, |
1304 | align => -1, |
1326 | align => -1, |
1305 | valign => -1, |
1327 | valign => -1, |
1306 | padding => 2, |
1328 | padding => 2, |
… | |
… | |
1371 | sub size_request { |
1393 | sub size_request { |
1372 | my ($self) = @_; |
1394 | my ($self) = @_; |
1373 | |
1395 | |
1374 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
1396 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
1375 | $self->{layout}->set_width ($self->{max_w} || -1); |
1397 | $self->{layout}->set_width ($self->{max_w} || -1); |
|
|
1398 | $self->{layout}->set_ellipsise ($self->{ellipsise}); |
|
|
1399 | $self->{layout}->set_single_paragraph_mode ($self->{ellipsise}); |
1376 | $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); |
1400 | $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); |
1377 | |
1401 | |
1378 | my ($w, $h) = $self->{layout}->size; |
1402 | my ($w, $h) = $self->{layout}->size; |
1379 | |
1403 | |
1380 | if (exists $self->{template}) { |
1404 | if (exists $self->{template}) { |
… | |
… | |
1416 | |
1440 | |
1417 | my $tex = $self->{texture} ||= do { |
1441 | my $tex = $self->{texture} ||= do { |
1418 | $self->{layout}->set_foreground (@{$self->{fg}}); |
1442 | $self->{layout}->set_foreground (@{$self->{fg}}); |
1419 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
1443 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
1420 | $self->{layout}->set_width ($self->{w}); |
1444 | $self->{layout}->set_width ($self->{w}); |
|
|
1445 | $self->{layout}->set_ellipsise ($self->{ellipsise}); |
|
|
1446 | $self->{layout}->set_single_paragraph_mode ($self->{ellipsise}); |
1421 | $self->{layout}->set_height (List::Util::min $self->{h}, $self->{fontsize} * $::FONTSIZE); |
1447 | $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); |
1422 | |
1448 | |
1423 | my $tex = new_from_layout CFClient::Texture $self->{layout}; |
1449 | my $tex = new_from_layout CFClient::Texture $self->{layout}; |
1424 | |
1450 | |
1425 | $self->{ox} = int ($self->{align} < 0 ? $self->{padding} |
1451 | $self->{ox} = int ($self->{align} < 0 ? $self->{padding} |
1426 | : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} |
1452 | : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} |
… | |
… | |
1464 | active_fg => [0, 0, 0], |
1490 | active_fg => [0, 0, 0], |
1465 | can_hover => 1, |
1491 | can_hover => 1, |
1466 | can_focus => 1, |
1492 | can_focus => 1, |
1467 | valign => 0, |
1493 | valign => 0, |
1468 | can_events => 1, |
1494 | can_events => 1, |
|
|
1495 | #text => ... |
1469 | @_ |
1496 | @_ |
1470 | ) |
1497 | ) |
1471 | } |
1498 | } |
1472 | |
1499 | |
1473 | sub _set_text { |
1500 | sub _set_text { |
… | |
… | |
2048 | range => [0, 0, 100, 10], |
2075 | range => [0, 0, 100, 10], |
2049 | req_w => $::WIDTH / 80, |
2076 | req_w => $::WIDTH / 80, |
2050 | req_h => $::WIDTH / 80, |
2077 | req_h => $::WIDTH / 80, |
2051 | vertical => 0, |
2078 | vertical => 0, |
2052 | can_hover => 1, |
2079 | can_hover => 1, |
2053 | inner_pad => .05, |
2080 | inner_pad => 0.02, |
2054 | @_ |
2081 | @_ |
2055 | ); |
2082 | ); |
2056 | |
2083 | |
2057 | $self->set_value ($self->{range}[0]); |
2084 | $self->set_value ($self->{range}[0]); |
2058 | $self->update; |
2085 | $self->update; |
2059 | |
2086 | |
2060 | $self |
2087 | $self |
|
|
2088 | } |
|
|
2089 | |
|
|
2090 | sub set_range { |
|
|
2091 | my ($self, $range) = @_; |
|
|
2092 | |
|
|
2093 | $self->{range} = $range; |
|
|
2094 | |
|
|
2095 | $self->update; |
2061 | } |
2096 | } |
2062 | |
2097 | |
2063 | sub set_value { |
2098 | sub set_value { |
2064 | my ($self, $value) = @_; |
2099 | my ($self, $value) = @_; |
2065 | |
2100 | |
… | |
… | |
2148 | glScale $self->{w}, $self->{h}; |
2183 | glScale $self->{w}, $self->{h}; |
2149 | |
2184 | |
2150 | if ($self->{vertical}) { |
2185 | if ($self->{vertical}) { |
2151 | # draw a vertical slider like a rotated horizontal slider |
2186 | # draw a vertical slider like a rotated horizontal slider |
2152 | |
2187 | |
|
|
2188 | glTranslate 1, 0, 0; |
2153 | glRotate 90, 0, 0, 1; |
2189 | glRotate 90, 0, 0, 1; |
2154 | glTranslate 0, 1, 0; |
|
|
2155 | } |
2190 | } |
2156 | |
2191 | |
2157 | my $fg = $FOCUS == $self ? $self->{active_fg} : $self->{fg}; |
2192 | my $fg = $FOCUS == $self ? $self->{active_fg} : $self->{fg}; |
2158 | my $bg = $FOCUS == $self ? $self->{active_bg} : $self->{bg}; |
2193 | my $bg = $FOCUS == $self ? $self->{active_bg} : $self->{bg}; |
2159 | |
2194 | |
… | |
… | |
2166 | # draw handle |
2201 | # draw handle |
2167 | $tex[0]->draw_quad_alpha ($self->{knob_x}, 0, $self->{knob_w}, 1); |
2202 | $tex[0]->draw_quad_alpha ($self->{knob_x}, 0, $self->{knob_w}, 1); |
2168 | |
2203 | |
2169 | glDisable GL_TEXTURE_2D; |
2204 | glDisable GL_TEXTURE_2D; |
2170 | } |
2205 | } |
|
|
2206 | |
|
|
2207 | ############################################################################# |
|
|
2208 | |
|
|
2209 | package CFClient::UI::ValSlider; |
|
|
2210 | |
|
|
2211 | our @ISA = CFClient::UI::HBox::; |
|
|
2212 | |
|
|
2213 | sub new { |
|
|
2214 | my ($class, %arg) = @_; |
|
|
2215 | |
|
|
2216 | my $range = delete $arg{range}; |
|
|
2217 | |
|
|
2218 | my $self = $class->SUPER::new ( |
|
|
2219 | slider => (new CFClient::UI::Slider expand => 1, range => $range), |
|
|
2220 | entry => (new CFClient::UI::Label text => "", template => delete $arg{template}), |
|
|
2221 | to_value => sub { shift }, |
|
|
2222 | from_value => sub { shift }, |
|
|
2223 | %arg, |
|
|
2224 | ); |
|
|
2225 | |
|
|
2226 | $self->{slider}->connect (changed => sub { |
|
|
2227 | my ($self, $value) = @_; |
|
|
2228 | $self->{parent}{entry}->set_text ($self->{parent}{to_value}->($value)); |
|
|
2229 | $self->{parent}->emit (changed => $value); |
|
|
2230 | }); |
|
|
2231 | |
|
|
2232 | # $self->{entry}->connect (changed => sub { |
|
|
2233 | # my ($self, $value) = @_; |
|
|
2234 | # $self->{parent}{slider}->set_value ($self->{parent}{from_value}->($value)); |
|
|
2235 | # $self->{parent}->emit (changed => $value); |
|
|
2236 | # }); |
|
|
2237 | |
|
|
2238 | $self->add ($self->{slider}, $self->{entry}); |
|
|
2239 | |
|
|
2240 | $self->{slider}->emit (changed => $self->{slider}{range}[0]); |
|
|
2241 | |
|
|
2242 | $self |
|
|
2243 | } |
|
|
2244 | |
|
|
2245 | sub set_range { shift->{slider}->set_range (@_) } |
|
|
2246 | sub set_value { shift->{slider}->set_value (@_) } |
2171 | |
2247 | |
2172 | ############################################################################# |
2248 | ############################################################################# |
2173 | |
2249 | |
2174 | package CFClient::UI::TextView; |
2250 | package CFClient::UI::TextView; |
2175 | |
2251 | |
… | |
… | |
2205 | |
2281 | |
2206 | $self->{fontsize} = $fontsize; |
2282 | $self->{fontsize} = $fontsize; |
2207 | $self->reflow; |
2283 | $self->reflow; |
2208 | } |
2284 | } |
2209 | |
2285 | |
|
|
2286 | sub size_allocate { |
|
|
2287 | my ($self, $w, $h) = @_; |
|
|
2288 | |
|
|
2289 | $self->SUPER::size_allocate ($w, $h); |
|
|
2290 | |
|
|
2291 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
|
|
2292 | $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); |
|
|
2293 | $self->{layout}->set_width ($self->{children}[0]{w}); |
|
|
2294 | |
|
|
2295 | $self->reflow; |
|
|
2296 | } |
|
|
2297 | |
2210 | sub text_height { |
2298 | sub text_height { |
2211 | my ($self, $text) = @_; |
2299 | my ($self, $text, $indent) = @_; |
2212 | |
2300 | |
2213 | my $layout = $self->{layout}; |
2301 | my $layout = $self->{layout}; |
2214 | |
2302 | |
2215 | $layout->set_height ($self->{fontsize} * $::FONTSIZE); |
2303 | $layout->set_height ($self->{fontsize} * $::FONTSIZE); |
2216 | $layout->set_width ($self->{children}[0]{w}); |
2304 | $layout->set_width ($self->{children}[0]{w} - $indent); |
2217 | $layout->set_markup ($text); |
2305 | $layout->set_markup ($text); |
2218 | |
2306 | |
2219 | ($layout->size)[1] |
2307 | ($layout->size)[1] |
2220 | } |
2308 | } |
2221 | |
2309 | |
… | |
… | |
2224 | |
2312 | |
2225 | $self->{need_reflow}++; |
2313 | $self->{need_reflow}++; |
2226 | $self->update; |
2314 | $self->update; |
2227 | } |
2315 | } |
2228 | |
2316 | |
2229 | sub size_allocate { |
|
|
2230 | my ($self, $w, $h) = @_; |
|
|
2231 | |
|
|
2232 | $self->SUPER::size_allocate ($w, $h); |
|
|
2233 | |
|
|
2234 | $self->{layout}->set_font ($self->{font}) if $self->{font}; |
|
|
2235 | $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); |
|
|
2236 | $self->{layout}->set_width ($self->{children}[0]{w}); |
|
|
2237 | |
|
|
2238 | $self->reflow; |
|
|
2239 | } |
|
|
2240 | |
|
|
2241 | sub add_paragraph { |
2317 | sub add_paragraph { |
2242 | my ($self, $color, $text) = @_; |
2318 | my ($self, $color, $text, $indent) = @_; |
2243 | |
2319 | |
2244 | #TODO: intelligently "reformat" paragraph |
2320 | #TODO: intelligently "reformat" paragraph |
2245 | |
2321 | |
|
|
2322 | for my $line (split /\n/, $text) { |
2246 | my $height = $self->text_height ($text); |
2323 | my $height = $self->text_height ($line); |
2247 | |
|
|
2248 | $self->{height} += $height; |
2324 | $self->{height} += $height; |
2249 | |
|
|
2250 | push @{$self->{par}}, [$height, $color, $text]; |
2325 | push @{$self->{par}}, [$height, $color, $indent, $line]; |
|
|
2326 | } |
2251 | |
2327 | |
2252 | $self->{children}[1]{range} = [$self->{height} - $self->{h}, 0, $self->{height}, $self->{h}]; |
2328 | $self->{children}[1]{range} = [$self->{height} - $self->{h}, 0, $self->{height}, $self->{h}]; |
2253 | $self->{children}[1]->update; |
2329 | $self->{children}[1]->update; |
2254 | } |
2330 | } |
2255 | |
2331 | |
… | |
… | |
2264 | |
2340 | |
2265 | $ROOT->on_post_alloc ($self, sub { |
2341 | $ROOT->on_post_alloc ($self, sub { |
2266 | if (delete $self->{need_reflow}) { |
2342 | if (delete $self->{need_reflow}) { |
2267 | my $height = 0; |
2343 | my $height = 0; |
2268 | |
2344 | |
2269 | $height += $_->[0] = $self->text_height ($_->[2]) |
2345 | $height += $_->[0] = $self->text_height ($_->[3], $_->[2]) |
2270 | for @{$self->{par}}; |
2346 | for @{$self->{par}}; |
2271 | |
2347 | |
2272 | $self->{height} = $height; |
2348 | $self->{height} = $height; |
2273 | |
2349 | |
2274 | $self->{children}[1]{range} = [$height - $self->{h}, 0, $height, $self->{h}]; |
2350 | $self->{children}[1]{range} = [$height - $self->{h}, 0, $height, $self->{h}]; |
|
|
2351 | $self->{children}[1]->update; |
2275 | |
2352 | |
2276 | delete $self->{texture}; |
2353 | delete $self->{texture}; |
2277 | } |
2354 | } |
2278 | |
2355 | |
2279 | $self->{texture} ||= new_from_opengl CFClient::Texture $self->{children}[0]{w}, $self->{children}[0]{h}, sub { |
2356 | $self->{texture} ||= new_from_opengl CFClient::Texture $self->{children}[0]{w}, $self->{children}[0]{h}, sub { |
2280 | glClearColor 0, 0, 0, 0; |
2357 | glClearColor 0.5, 0.5, 0.5, 0; |
2281 | glClear GL_COLOR_BUFFER_BIT; |
2358 | glClear GL_COLOR_BUFFER_BIT; |
2282 | |
|
|
2283 | glEnable GL_TEXTURE_2D; |
|
|
2284 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
|
|
2285 | |
2359 | |
2286 | my $top = int $self->{children}[1]{range}[0]; |
2360 | my $top = int $self->{children}[1]{range}[0]; |
2287 | |
2361 | |
2288 | my $y0 = $top; |
2362 | my $y0 = $top; |
2289 | my $y1 = $top + $self->{h}; |
2363 | my $y1 = $top + $self->{h}; |
… | |
… | |
2292 | |
2366 | |
2293 | my $layout = $self->{layout}; |
2367 | my $layout = $self->{layout}; |
2294 | |
2368 | |
2295 | $layout->set_font ($self->{font}) if $self->{font}; |
2369 | $layout->set_font ($self->{font}) if $self->{font}; |
2296 | |
2370 | |
|
|
2371 | glEnable GL_BLEND; |
|
|
2372 | glBlendFunc GL_ONE, GL_ONE_MINUS_SRC_ALPHA; |
|
|
2373 | |
2297 | for my $par (@{$self->{par}}) { |
2374 | for my $par (@{$self->{par}}) { |
2298 | my $h = $par->[0]; |
2375 | my $h = $par->[0]; |
2299 | |
2376 | |
2300 | if ($y0 < $y + $h && $y < $y1) { |
2377 | if ($y0 < $y + $h && $y < $y1) { |
2301 | $layout->set_foreground (@{ $par->[1] }); |
2378 | $layout->set_foreground (@{ $par->[1] }); |
|
|
2379 | $layout->set_width ($self->{w} - $par->[2]); |
2302 | $layout->set_markup ($par->[2]); |
2380 | $layout->set_markup ($par->[3]); |
2303 | |
2381 | |
2304 | my ($W, $H) = $layout->size; |
2382 | my ($w, $h, $data, $format, $internalformat) = $layout->render; |
2305 | CFClient::Texture->new_from_layout ($layout)->draw_quad_alpha_premultiplied (0, $y - $y0); |
2383 | |
|
|
2384 | glRasterPos $par->[2], $y - $y0; |
|
|
2385 | glDrawPixels $w, $h, $format, GL_UNSIGNED_BYTE, $data; |
2306 | } |
2386 | } |
2307 | |
2387 | |
2308 | $y += $h; |
2388 | $y += $h; |
2309 | } |
2389 | } |
2310 | |
2390 | |
2311 | glDisable GL_TEXTURE_2D; |
2391 | glDisable GL_BLEND; |
2312 | }; |
2392 | }; |
2313 | }); |
2393 | }); |
2314 | } |
2394 | } |
2315 | |
2395 | |
2316 | sub _draw { |
2396 | sub _draw { |
2317 | my ($self) = @_; |
2397 | my ($self) = @_; |
2318 | |
2398 | |
2319 | glEnable GL_TEXTURE_2D; |
2399 | glEnable GL_TEXTURE_2D; |
2320 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
2400 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
2321 | glColor 1, 1, 1, 1; |
2401 | glColor 1, 1, 1, 1; |
2322 | $self->{texture}->draw_quad_alpha_premultiplied (0, 0, $self->{children}[0]{w}, $self->{children}[0]{h}); |
2402 | $self->{texture}->draw_quad_alpha (0, 0, $self->{children}[0]{w}, $self->{children}[0]{h}); |
2323 | glDisable GL_TEXTURE_2D; |
2403 | glDisable GL_TEXTURE_2D; |
2324 | |
2404 | |
2325 | $self->{children}[1]->draw; |
2405 | $self->{children}[1]->draw; |
2326 | |
2406 | |
2327 | } |
2407 | } |
… | |
… | |
2426 | |
2506 | |
2427 | sub set_tooltip_from { |
2507 | sub set_tooltip_from { |
2428 | my ($self, $widget) = @_; |
2508 | my ($self, $widget) = @_; |
2429 | |
2509 | |
2430 | $self->add (new CFClient::UI::Label |
2510 | $self->add (new CFClient::UI::Label |
2431 | markup => $widget->{tooltip}, |
2511 | markup => $widget->{tooltip}, |
2432 | max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH, |
2512 | max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH, |
2433 | fontsize => 0.8, |
2513 | fontsize => 0.8, |
2434 | fg => [0, 0, 0, 1], |
2514 | fg => [0, 0, 0, 1], |
|
|
2515 | ellipsise => 0, |
2435 | font => ($widget->{tooltip_font} || $::FONT_PROP), |
2516 | font => ($widget->{tooltip_font} || $::FONT_PROP), |
2436 | ); |
2517 | ); |
2437 | } |
2518 | } |
2438 | |
2519 | |
2439 | sub size_request { |
2520 | sub size_request { |
2440 | my ($self) = @_; |
2521 | my ($self) = @_; |
… | |
… | |
2486 | use CFClient::OpenGL; |
2567 | use CFClient::OpenGL; |
2487 | |
2568 | |
2488 | sub new { |
2569 | sub new { |
2489 | my $class = shift; |
2570 | my $class = shift; |
2490 | |
2571 | |
2491 | $class->SUPER::new ( |
2572 | my $self = $class->SUPER::new ( |
2492 | aspect => 1, |
2573 | aspect => 1, |
2493 | @_, |
2574 | @_, |
2494 | ) |
2575 | ); |
|
|
2576 | |
|
|
2577 | if ($self->{anim} && $self->{animspeed}) { |
|
|
2578 | Scalar::Util::weaken (my $widget = $self); |
|
|
2579 | |
|
|
2580 | $self->{timer} = Event->timer ( |
|
|
2581 | at => $self->{animspeed} * int $::NOW / $self->{animspeed}, |
|
|
2582 | hard => 1, |
|
|
2583 | interval => $self->{animspeed}, |
|
|
2584 | cb => sub { |
|
|
2585 | ++$widget->{frame}; |
|
|
2586 | $widget->update; |
|
|
2587 | }, |
|
|
2588 | ); |
|
|
2589 | } |
|
|
2590 | |
|
|
2591 | $self |
2495 | } |
2592 | } |
2496 | |
2593 | |
2497 | sub size_request { |
2594 | sub size_request { |
2498 | (32, 8) |
2595 | (32, 8) |
2499 | } |
2596 | } |
2500 | |
2597 | |
|
|
2598 | sub update { |
|
|
2599 | my ($self) = @_; |
|
|
2600 | |
|
|
2601 | return unless $self->{visible}; |
|
|
2602 | |
|
|
2603 | $self->SUPER::update; |
|
|
2604 | } |
|
|
2605 | |
2501 | sub _draw { |
2606 | sub _draw { |
2502 | my ($self) = @_; |
2607 | my ($self) = @_; |
2503 | |
2608 | |
2504 | return unless $::CONN;#d# manage and cache textures differently |
2609 | return unless $::CONN;#d# manage and cache textures differently |
|
|
2610 | |
|
|
2611 | my $face; |
|
|
2612 | |
|
|
2613 | if ($self->{frame}) { |
|
|
2614 | my $anim = $::CONN->{anim}[$self->{anim}]; |
|
|
2615 | |
|
|
2616 | $face = $anim->[ $self->{frame} % @$anim ] |
|
|
2617 | if $anim && @$anim; |
|
|
2618 | } |
|
|
2619 | |
2505 | my $tex = $::CONN->{texture}[$::CONN->{faceid}[$self->{face}]]; |
2620 | my $tex = $::CONN->{texture}[$::CONN->{faceid}[$face || $self->{face}]]; |
2506 | |
2621 | |
2507 | # TODO animation |
|
|
2508 | if ($tex) { |
2622 | if ($tex) { |
2509 | glEnable GL_TEXTURE_2D; |
2623 | glEnable GL_TEXTURE_2D; |
2510 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
2624 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
2511 | glColor 1, 1, 1, 1; |
2625 | glColor 1, 1, 1, 1; |
2512 | $tex->draw_quad_alpha (0, 0, $self->{w}, $self->{h}); |
2626 | $tex->draw_quad_alpha (0, 0, $self->{w}, $self->{h}); |
2513 | glDisable GL_TEXTURE_2D; |
2627 | glDisable GL_TEXTURE_2D; |
2514 | } |
2628 | } |
2515 | } |
2629 | } |
2516 | |
2630 | |
|
|
2631 | sub DESTROY { |
|
|
2632 | my ($self) = @_; |
|
|
2633 | |
|
|
2634 | $self->{timer}->cancel |
|
|
2635 | if $self->{timer}; |
|
|
2636 | |
|
|
2637 | $self->SUPER::DESTROY; |
|
|
2638 | } |
|
|
2639 | |
2517 | ############################################################################# |
2640 | ############################################################################# |
2518 | |
2641 | |
2519 | package CFClient::UI::InventoryItem; |
2642 | package CFClient::UI::InventoryItem; |
2520 | |
2643 | |
2521 | our @ISA = CFClient::UI::HBox::; |
2644 | our @ISA = CFClient::UI::HBox::; |
2522 | |
2645 | |
2523 | sub new { |
2646 | sub _item_to_desc { |
2524 | my $class = shift; |
2647 | my ($item) = @_; |
2525 | |
2648 | |
2526 | my %args = @_; |
2649 | my $desc = |
2527 | |
|
|
2528 | my $item = delete $args{item}; |
|
|
2529 | |
|
|
2530 | my $desc = $item->{nrof} < 2 |
2650 | $item->{nrof} < 2 |
2531 | ? $item->{name} |
2651 | ? $item->{name} |
2532 | : "$item->{nrof} $item->{name_pl}"; |
2652 | : "$item->{nrof} × $item->{name_pl}"; |
2533 | |
2653 | |
2534 | $item->{flags} & Crossfire::Protocol::F_OPEN |
2654 | $item->{flags} & Crossfire::Protocol::F_OPEN |
2535 | and $desc .= " (open)"; |
2655 | and $desc .= " (open)"; |
2536 | $item->{flags} & Crossfire::Protocol::F_APPLIED |
2656 | $item->{flags} & Crossfire::Protocol::F_APPLIED |
2537 | and $desc .= " (applied)"; |
2657 | and $desc .= " (applied)"; |
… | |
… | |
2544 | $item->{flags} & Crossfire::Protocol::F_DAMNED |
2664 | $item->{flags} & Crossfire::Protocol::F_DAMNED |
2545 | and $desc .= " (damned)"; |
2665 | and $desc .= " (damned)"; |
2546 | $item->{flags} & Crossfire::Protocol::F_LOCKED |
2666 | $item->{flags} & Crossfire::Protocol::F_LOCKED |
2547 | and $desc .= " *"; |
2667 | and $desc .= " *"; |
2548 | |
2668 | |
|
|
2669 | $desc |
|
|
2670 | } |
|
|
2671 | |
|
|
2672 | sub new { |
|
|
2673 | my $class = shift; |
|
|
2674 | |
|
|
2675 | my %args = @_; |
|
|
2676 | |
|
|
2677 | my $item = delete $args{item}; |
|
|
2678 | |
|
|
2679 | my $desc = _item_to_desc ($item); |
|
|
2680 | |
2549 | my $self = $class->SUPER::new ( |
2681 | my $self = $class->SUPER::new ( |
2550 | can_hover => 1, |
2682 | can_hover => 1, |
2551 | can_events => 1, |
2683 | can_events => 1, |
2552 | tooltip => ((CFClient::UI::Label::escape $desc) |
2684 | tooltip => ((CFClient::UI::Label::escape $desc) |
2553 | . "\n<small>leftclick - pick up\nmiddle click - apply\nrightclick - menu</small>"), |
2685 | . "\n<small>leftclick - examine\nshift+leftclick - move/pickup/drop\nmiddle click - apply\nrightclick - menu</small>"), |
2554 | connect_button_down => sub { |
2686 | connect_button_down => sub { |
2555 | my ($self, $ev, $x, $y) = @_; |
2687 | my ($self, $ev, $x, $y) = @_; |
2556 | |
2688 | |
2557 | # todo: maybe put examine on 1? but should just be a tooltip :( |
2689 | # todo: maybe put examine on 1? but should just be a tooltip :( |
|
|
2690 | if (($ev->{mod} & CFClient::KMOD_SHIFT) && $ev->{button} == 1) { |
|
|
2691 | my $targ = $::CONN->{player}{tag}; |
|
|
2692 | |
|
|
2693 | if ($item->{container} == $::CONN->{player}{tag}) { |
|
|
2694 | $targ = $main::OPENCONT; |
|
|
2695 | } |
|
|
2696 | |
|
|
2697 | $::CONN->send ("move $targ $item->{tag} 0"); |
2558 | if ($ev->{button} == 1) { |
2698 | } elsif ($ev->{button} == 1) { |
2559 | $::CONN->send ("move $::CONN->{player}{tag} $item->{tag} 0"); |
2699 | $::CONN->send ("examine $item->{tag}"); |
2560 | } elsif ($ev->{button} == 2) { |
2700 | } elsif ($ev->{button} == 2) { |
2561 | $::CONN->send ("apply $item->{tag}"); |
2701 | $::CONN->send ("apply $item->{tag}"); |
2562 | } elsif ($ev->{button} == 3) { |
2702 | } elsif ($ev->{button} == 3) { |
2563 | my @menu_items = ( |
2703 | my @menu_items = ( |
2564 | ["examine", sub { $::CONN->send ("examine $item->{tag}") }], |
2704 | ["examine", sub { $::CONN->send ("examine $item->{tag}") }], |
2565 | ["mark", sub { $::CONN->send ("mark $item->{tag}") }], |
2705 | ["mark", sub { $::CONN->send ("mark ". pack "N", $item->{tag}) }], |
2566 | ["apply", sub { $::CONN->send ("apply $item->{tag}") }], |
2706 | ["apply", sub { $::CONN->send ("apply $item->{tag}") }], |
|
|
2707 | ( |
|
|
2708 | $item->{flags} & Crossfire::Protocol::F_LOCKED |
|
|
2709 | ? ( |
|
|
2710 | ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $item->{tag}) }], |
|
|
2711 | ) |
|
|
2712 | : ( |
|
|
2713 | ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $item->{tag}) }], |
2567 | ["drop", sub { $::CONN->send ("move $main::OPENCONT $item->{tag} 0") }], |
2714 | ["drop", sub { $::CONN->send ("move $main::OPENCONT $item->{tag} 0") }], |
2568 | [ |
2715 | ) |
2569 | $item->{flags} & Crossfire::Protocol::F_LOCKED ? "lock" : "unlock", |
|
|
2570 | sub { $::CONN->send ("lock ". () ."$item->{tag}") }, |
|
|
2571 | ], |
2716 | ), |
2572 | ); |
2717 | ); |
2573 | |
2718 | |
2574 | CFClient::UI::Menu->new (items => \@menu_items)->popup ($ev); |
2719 | CFClient::UI::Menu->new (items => \@menu_items)->popup ($ev); |
2575 | } |
2720 | } |
2576 | |
2721 | |
2577 | 1 |
2722 | 1 |
2578 | }, |
2723 | }, |
2579 | %args |
2724 | %args |
2580 | ); |
2725 | ); |
|
|
2726 | |
2581 | |
2727 | |
2582 | $self->add (new CFClient::UI::Face |
2728 | $self->add (new CFClient::UI::Face |
2583 | can_events => 0, |
2729 | can_events => 0, |
2584 | face => $item->{face}, |
2730 | face => $item->{face}, |
2585 | anim => $item->{anim}, |
2731 | anim => $item->{anim}, |
2586 | animspeed => $item->{animspeed}, |
2732 | animspeed => $item->{animspeed}, |
2587 | ); |
2733 | ); |
2588 | |
2734 | |
2589 | $self->add (new CFClient::UI::Label |
2735 | $self->add ($self->{name_lbl} = new CFClient::UI::Label can_events => 0); |
2590 | can_events => 0, |
2736 | |
2591 | text => $desc, |
2737 | $self->{item} = $item; |
2592 | ); |
2738 | |
|
|
2739 | $self->update_item; |
2593 | |
2740 | |
2594 | $self |
2741 | $self |
|
|
2742 | } |
|
|
2743 | |
|
|
2744 | sub update_item { |
|
|
2745 | my ($self) = @_; |
|
|
2746 | |
|
|
2747 | my $desc = _item_to_desc ($self->{item}); |
|
|
2748 | |
|
|
2749 | $self->{name_lbl}->set_text ($desc); |
2595 | } |
2750 | } |
2596 | |
2751 | |
2597 | ############################################################################# |
2752 | ############################################################################# |
2598 | |
2753 | |
2599 | package CFClient::UI::Inventory; |
2754 | package CFClient::UI::Inventory; |
… | |
… | |
2602 | |
2757 | |
2603 | sub new { |
2758 | sub new { |
2604 | my $class = shift; |
2759 | my $class = shift; |
2605 | |
2760 | |
2606 | my $self = $class->SUPER::new ( |
2761 | my $self = $class->SUPER::new ( |
2607 | scrolled => (new CFClient::UI::VBox), |
2762 | scrolled => (new CFClient::UI::Table), |
2608 | @_, |
2763 | @_, |
2609 | ); |
2764 | ); |
2610 | |
2765 | |
2611 | $self |
2766 | $self |
2612 | } |
2767 | } |
… | |
… | |
2623 | } @$items; |
2778 | } @$items; |
2624 | |
2779 | |
2625 | $self->{real_items} = \@items; |
2780 | $self->{real_items} = \@items; |
2626 | |
2781 | |
2627 | for my $item (@items) { |
2782 | for my $item (@items) { |
2628 | my $desc = $item->{nrof} < 2 |
2783 | $item->{item} = $item; |
2629 | ? $item->{name} |
|
|
2630 | : "$item->{nrof} $item->{name_pl}"; |
|
|
2631 | |
|
|
2632 | $item = $item->{widget} ||= new CFClient::UI::InventoryItem item => $item; |
2784 | $item = $item->{widget} ||= new CFClient::UI::InventoryItem item => $item; |
|
|
2785 | $item->update_item (); |
2633 | } |
2786 | } |
2634 | |
2787 | |
|
|
2788 | my $i = 0; |
|
|
2789 | for (@items) { |
2635 | $self->{scrolled}->add (@items); |
2790 | $self->{scrolled}->add (0, $i, $_); |
|
|
2791 | my $nrof = $_->{item}->{nrof} || 1; |
|
|
2792 | $self->{scrolled}->add (1, $i++, new CFClient::UI::Label text => ($_->{item}->{weight} * $nrof) / 1000); |
|
|
2793 | } |
2636 | |
2794 | |
2637 | # $range->{range} = [$self->{pos}, 0, $self->{max_pos}, $page]; |
2795 | # $range->{range} = [$self->{pos}, 0, $self->{max_pos}, $page]; |
2638 | } |
2796 | } |
2639 | |
2797 | |
2640 | sub size_request { |
2798 | sub size_request { |
… | |
… | |
2718 | |
2876 | |
2719 | package CFClient::UI::Statusbox; |
2877 | package CFClient::UI::Statusbox; |
2720 | |
2878 | |
2721 | our @ISA = CFClient::UI::VBox::; |
2879 | our @ISA = CFClient::UI::VBox::; |
2722 | |
2880 | |
|
|
2881 | sub new { |
|
|
2882 | my $class = shift; |
|
|
2883 | |
|
|
2884 | $class->SUPER::new ( |
|
|
2885 | fontsize => 0.8, |
|
|
2886 | @_, |
|
|
2887 | ) |
|
|
2888 | } |
|
|
2889 | |
2723 | sub reorder { |
2890 | sub reorder { |
2724 | my ($self) = @_; |
2891 | my ($self) = @_; |
2725 | my $NOW = time; |
2892 | my $NOW = time; |
2726 | |
2893 | |
2727 | while (my ($k, $v) = each %{ $self->{item} }) { |
2894 | while (my ($k, $v) = each %{ $self->{item} }) { |
… | |
… | |
2746 | : $item->{text}; |
2913 | : $item->{text}; |
2747 | |
2914 | |
2748 | for ($short) { |
2915 | for ($short) { |
2749 | s/^\s+//; |
2916 | s/^\s+//; |
2750 | s/\s+/ /g; |
2917 | s/\s+/ /g; |
2751 | my $len = int 40 / $item->{fontsize}; |
|
|
2752 | substr $_, $len, length, "…" if $len < length; |
|
|
2753 | } |
2918 | } |
2754 | |
2919 | |
2755 | new CFClient::UI::Label |
2920 | new CFClient::UI::Label |
2756 | markup => $short, |
2921 | markup => $short, |
2757 | tooltip => $item->{tooltip}, |
2922 | tooltip => $item->{tooltip}, |
2758 | tooltip_font => $::FONT_PROP, |
2923 | tooltip_font => $::FONT_PROP, |
2759 | tooltip_width => 0.67, |
2924 | tooltip_width => 0.67, |
2760 | fontsize => $item->{fontsize}, |
2925 | fontsize => $item->{fontsize} || $self->{fontsize}, |
|
|
2926 | max_w => $::WIDTH * 0.44, |
2761 | fg => $item->{fg}, |
2927 | fg => $item->{fg}, |
2762 | can_events => 1, |
2928 | can_events => 1, |
2763 | can_hover => 1 |
2929 | can_hover => 1 |
2764 | }; |
2930 | }; |
2765 | } |
2931 | } |
… | |
… | |
2792 | $self->{item}{$group} = { |
2958 | $self->{item}{$group} = { |
2793 | id => ++$self->{id}, |
2959 | id => ++$self->{id}, |
2794 | text => $text, |
2960 | text => $text, |
2795 | timeout => $timeout, |
2961 | timeout => $timeout, |
2796 | tooltip => $text, |
2962 | tooltip => $text, |
2797 | fontsize => 0.8, |
|
|
2798 | fg => [0.8, 0.8, 0.8, 0.8], |
2963 | fg => [0.8, 0.8, 0.8, 0.8], |
2799 | pri => 0, |
2964 | pri => 0, |
2800 | count => 1, |
2965 | count => 1, |
2801 | %arg, |
2966 | %arg, |
2802 | }; |
2967 | }; |
2803 | } |
2968 | } |
2804 | |
2969 | |
2805 | $self->reorder; |
2970 | $self->reorder; |
2806 | } |
2971 | } |
2807 | |
2972 | |
|
|
2973 | sub reconfigure { |
|
|
2974 | my ($self) = @_; |
|
|
2975 | |
|
|
2976 | delete $_->{label} |
|
|
2977 | for values %{ $self->{item} || {} }; |
|
|
2978 | |
|
|
2979 | $self->reorder; |
|
|
2980 | $self->SUPER::reconfigure; |
|
|
2981 | } |
|
|
2982 | |
2808 | ############################################################################# |
2983 | ############################################################################# |
2809 | |
2984 | |
2810 | package CFClient::UI::Root; |
2985 | package CFClient::UI::Root; |
2811 | |
2986 | |
2812 | our @ISA = CFClient::UI::Container::; |
2987 | our @ISA = CFClient::UI::Container::; |
… | |
… | |
2895 | $child->{x} = int $child->{x}; |
3070 | $child->{x} = int $child->{x}; |
2896 | $child->{y} = int $child->{y}; |
3071 | $child->{y} = int $child->{y}; |
2897 | } |
3072 | } |
2898 | |
3073 | |
2899 | $self->SUPER::add (@children); |
3074 | $self->SUPER::add (@children); |
|
|
3075 | |
|
|
3076 | while (@children) { |
|
|
3077 | my $w = pop @children; |
|
|
3078 | push @children, $w->children; |
|
|
3079 | $w->{visible} = 1; |
|
|
3080 | } |
|
|
3081 | } |
|
|
3082 | |
|
|
3083 | sub remove { |
|
|
3084 | my ($self, @children) = @_; |
|
|
3085 | |
|
|
3086 | $self->SUPER::remove (@children); |
|
|
3087 | |
|
|
3088 | while (@children) { |
|
|
3089 | my $w = pop @children; |
|
|
3090 | push @children, $w->children; |
|
|
3091 | delete $w->{visible}; |
|
|
3092 | } |
2900 | } |
3093 | } |
2901 | |
3094 | |
2902 | sub on_refresh { |
3095 | sub on_refresh { |
2903 | my ($self, $id, $cb) = @_; |
3096 | my ($self, $id, $cb) = @_; |
2904 | |
3097 | |
… | |
… | |
2973 | glClearColor +($::CFG->{fow_intensity}) x 3, 1; |
3166 | glClearColor +($::CFG->{fow_intensity}) x 3, 1; |
2974 | glClear GL_COLOR_BUFFER_BIT; |
3167 | glClear GL_COLOR_BUFFER_BIT; |
2975 | |
3168 | |
2976 | glMatrixMode GL_PROJECTION; |
3169 | glMatrixMode GL_PROJECTION; |
2977 | glLoadIdentity; |
3170 | glLoadIdentity; |
2978 | glOrtho 0, $::WIDTH, $::HEIGHT, 0, -10000 , 10000; |
3171 | glOrtho 0, $::WIDTH, $::HEIGHT, 0, -10000, 10000; |
2979 | glMatrixMode GL_MODELVIEW; |
3172 | glMatrixMode GL_MODELVIEW; |
2980 | glLoadIdentity; |
3173 | glLoadIdentity; |
2981 | |
3174 | |
2982 | $self->_draw; |
3175 | $self->_draw; |
2983 | } |
3176 | } |
… | |
… | |
2985 | ############################################################################# |
3178 | ############################################################################# |
2986 | |
3179 | |
2987 | package CFClient::UI; |
3180 | package CFClient::UI; |
2988 | |
3181 | |
2989 | $ROOT = new CFClient::UI::Root; |
3182 | $ROOT = new CFClient::UI::Root; |
2990 | $TOOLTIP = new CFClient::UI::Tooltip; |
3183 | $TOOLTIP = new CFClient::UI::Tooltip z => 900; |
2991 | |
3184 | |
2992 | 1 |
3185 | 1 |
2993 | |
3186 | |