Class: Cliptic::Interface::Menu_With_Stats
- Inherits:
-
Menu
- Object
- Curses::Window
- Windows::Window
- Menu_Box
- Menu
- Cliptic::Interface::Menu_With_Stats
- Defined in:
- lib/cliptic/interface.rb
Direct Known Subclasses
Constant Summary
Constants included from Chars
Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX
Instance Attribute Summary collapse
-
#stat_win ⇒ Object
readonly
Returns the value of attribute stat_win.
Attributes inherited from Menu
Attributes inherited from Menu_Box
#bot_b, #draw_bars, #logo, #title, #top_b
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
- #enter ⇒ Object
- #hide ⇒ Object
-
#initialize(height: opts.length+6, sel: Selector) ⇒ Menu_With_Stats
constructor
A new instance of Menu_With_Stats.
- #reset_pos ⇒ Object
- #update_stats ⇒ Object
Methods inherited from Menu
#back, #choose_opt, #ctrls, #redraw, #show
Methods inherited from Menu_Box
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #draw, #move, #refresh, #reset_attrs, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize(height: opts.length+6, sel: Selector) ⇒ Menu_With_Stats
Returns a new instance of Menu_With_Stats.
220 221 222 223 224 |
# File 'lib/cliptic/interface.rb', line 220 def initialize(height:opts.length+6, sel:Selector, **) super(height:height, sel:sel, sel_opts:opts, tick:->{update_stats}) @stat_win = Stat_Window.new(line:line+height) end |
Instance Attribute Details
#stat_win ⇒ Object (readonly)
Returns the value of attribute stat_win.
219 220 221 |
# File 'lib/cliptic/interface.rb', line 219 def stat_win @stat_win end |
Instance Method Details
#enter ⇒ Object
232 233 234 235 236 237 |
# File 'lib/cliptic/interface.rb', line 232 def enter hide Main::Player::Game.new(date:stat_date).play reset_pos show end |
#hide ⇒ Object
228 229 230 231 |
# File 'lib/cliptic/interface.rb', line 228 def hide super stat_win.clear end |
#reset_pos ⇒ Object
238 239 240 241 |
# File 'lib/cliptic/interface.rb', line 238 def reset_pos super stat_win.move(line:line+height) end |
#update_stats ⇒ Object
225 226 227 |
# File 'lib/cliptic/interface.rb', line 225 def update_stats stat_win.show(date:stat_date) end |