Class: GamesAndRpgParadise::GUI::Gtk::PartyViewer

Inherits:
Gtk::BaseModuleFrame
  • Object
show all
Includes:
MightAndMagic
Defined in:
lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb

Overview

GamesAndRpgParadise::GUI::Gtk::PartyViewer

Constant Summary collapse

WIDTH_OF_THE_SMALL_CLASS_ICONS =
#

WIDTH_OF_THE_SMALL_CLASS_ICONS

#
24
MALE_ICON =
#

MALE_ICON

#
GdkPixbuf::Pixbuf.new(
  file:
    '/home/x/programming/ruby/src/cyberweb/lib/cyberweb/images/standard_images/GENDER_ICON_MALE.png'
)
FEMALE_ICON =
#

FEMALE_ICON

#
GdkPixbuf::Pixbuf.new(
  file:
    '/home/x/programming/ruby/src/cyberweb/lib/cyberweb/images/standard_images/GENDER_ICON_FEMALE.png'
)
IMG_FOR_MIGHT_AND_MAGIC_DIR =
#

IMG_FOR_MIGHT_AND_MAGIC_DIR

#
'/home/x/data/images/games/MIGHT_AND_MAGIC/'
TITLE =
#

TITLE

#
'Party Viewer'
WIDTH =
#

WIDTH

#
'65% or minimum 600px'
HEIGHT =
#

HEIGHT

#
'55% or minimum 500px'
USE_THIS_FONT =
#

USE_THIS_FONT

#
:dejavu_condensed_22
MAKE_HEADERS_CLICKABLE =
#

MAKE_HEADERS_CLICKABLE

#
true
IMG_DIR =
#

IMG_DIR

#
ENV['IMG'].to_s+'/'
IMG_STD =
#

IMG_STD

#
"#{IMG_DIR}STD/"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commandline_arguments = ARGV, run_already = true) ⇒ PartyViewer

#

initialize

#


110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 110

def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  super('')
  reset
  set_title(TITLE)
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

GamesAndRpgParadise::GUI::Gtk::PartyViewer[]

#


630
631
632
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 630

def self.[](i = ARGV)
  new(i)
end

.run(i = ARGV) ⇒ Object

#

GamesAndRpgParadise::GUI::Gtk::PartyViewer.run

#


637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 637

def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::GamesAndRpgParadise::GUI::Gtk::PartyViewer.new(i)
  r = ::Gtk.run
  r << _
  r.set_favicon('/home/x/data/images/games/PARTY_VIEWER.png')
  r.automatic_size_then_automatic_title
  r.enable_quick_exit
  r.top_left_then_run
end

Instance Method Details

#border_size?Boolean

#

border_size?

#

Returns:

  • (Boolean)


165
166
167
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 165

def border_size?
  2
end

#clear_the_liststoreObject

#

clear_the_liststore

#


172
173
174
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 172

def clear_the_liststore
  @list_store_party.clear
end

#connect_skeletonObject

#

connect_skeleton (connect tag)

#


424
425
426
427
428
429
430
431
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 424

def connect_skeleton
  abort_on_exception
  set_label_align(0.02, 0.5)
  vbox = create_vbox
  vbox.maximal(@tree_view,             2)
  vbox.minimal(@vbox_with_the_buttons, 2)
  add(vbox)
end

#create_hero_group(arg = nil) ⇒ Object

#

create_hero_group

This creates a hero group. HeroTypes is used in

bl $RUBY_GAMES/might_and_magic/hero_types.rb

#


461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 461

def create_hero_group(arg = nil)
  case arg
  # ======================================================================= #
  # === :rand
  # ======================================================================= #
  when :rand
    create_hero_group([nil, :dsa].rand)
  # ======================================================================= #
  # === nil
  # ======================================================================= #
  when nil
    @array_hero_group = [
      ['(1)', (hero = HeroTypes::Barbarian.new).type,hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(2)', (hero = HeroTypes::Cleric.new).type,   hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(3)', (hero = HeroTypes::Sorcerer.new).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(4)', (hero = HeroTypes::Archer.new).type,   hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(5)', (hero = HeroTypes::Sorcerer.new).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
    ]
  # ======================================================================= #
  # === :dsa
  # ======================================================================= #
  when :dsa
    @hitpoints_real_name = 'Lebenspunkte'
    @array_hero_group = [
      ['(1)', (hero = HeroTypes.random_character).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(2)', (hero = HeroTypes.random_character).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(3)', (hero = HeroTypes.random_character).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(4)', (hero = HeroTypes.random_character).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(5)', (hero = HeroTypes.random_character).type, hero.name, hero.type,hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp]
    ]
  # ======================================================================= #
  # === :partharon
  # ======================================================================= #
  when :partharon, :parth, :default # partharons heldengruppe. Also the default party.
    @array_hero_group = [
      ['(1)', (hero = HeroTypes.random_character).type, 'Partharon', 'ninja',hero.n_attacks,'human','male',hero.level,hero.hp],
      ['(2)', (hero = HeroTypes.random_character).type, 'Hork "Bernstein" Oxling','warrior',hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(3)', (hero = HeroTypes.random_character).type, 'Echse','warrior',hero.n_attacks,'lizard',hero.gender,hero.level,hero.hp],
      ['(4)', (hero = HeroTypes.random_character).type, 'Die Magierin','mage',hero.n_attacks,'human','female',hero.level,hero.hp],
      ['(5)', (hero = HeroTypes.random_character).type, 'Berenghar','warrior',hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(6)', (hero = HeroTypes.random_character).type, 'Cumaal','barbarian', hero.n_attacks,'human',hero.gender,hero.level,hero.hp]
    ]
  else # else its random!
    @array_hero_group = [
      ['(1)', (hero = HeroTypes.random_character).type, hero.name, hero.type, hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(2)', (hero = HeroTypes.random_character).type, hero.name, hero.type, hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(3)', (hero = HeroTypes.random_character).type, hero.name, hero.type, hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(4)', (hero = HeroTypes.random_character).type, hero.name, hero.type, hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp],
      ['(5)', (hero = HeroTypes.random_character).type, hero.name, hero.type, hero.n_attacks,'dwarf',hero.gender,hero.level,hero.hp]
    ]
  end
end

#create_skeletonObject

#

create_skeleton (create tag, skeleton tag)

#


436
437
438
439
440
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 436

def create_skeleton
  create_the_liststore
  create_the_buttons
  create_the_treeview
end

#create_the_buttonsObject

#

create_the_buttons (buttons tag)

#


240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 240

def create_the_buttons
  # ======================================================================= #
  # === @button_sort
  # ======================================================================= #
  @button_sort = create_button('_Sort') # the sort button.
  @button_sort.on_clicked { sort_liststore }
  # ======================================================================= #
  # === @button_random_event
  # ======================================================================= #
  @button_random_event = create_button('_SendRandomEvent')
  @button_random_event.on_clicked { |widget, event| random_event }
  vbox = create_vbox
  vbox.minimal(@button_random_event, 2)
  vbox.minimal(@button_sort,         2)
  @vbox_with_the_buttons = vbox
  return_all_buttons.each {|this_button|
    this_button.pad5px
    this_button.bblack2
  }
end

#create_the_liststoreObject

#

create_the_liststore

#


181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 181

def create_the_liststore
  @list_store_party = gtk_list_store(
    GdkPixbuf::Pixbuf, #  (1)
    String,            #  (2) ID
    String,            #  (3) Name
    String,            #  (4) Profession
    String,            #  (5) Number of Attacks
    String,            #  (6) Race
    # String,          #  (7) Gender
    String,            #  (7) Level
    String,            #  (8) Hitpoints
    GdkPixbuf::Pixbuf, #  (9) Status icon
    Float,             # (10) Lifebar
    GdkPixbuf::Pixbuf  # (11) Gender Icon 
  )
end

#create_the_treeviewObject

#

create_the_treeview

#


276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 276

def create_the_treeview
  @tree_view = create_tree_view(@list_store_party)
  # ======================================================================= #
  # Options for the TreeView headers follow next:
  # ======================================================================= #
  @tree_view.selection.mode = :multiple
  @tree_view.is_reorderable
  @tree_view.no_search
  @tree_view.rules_hint = true
  @tree_view.the_headers_are_clickable if MAKE_HEADERS_CLICKABLE

  @renderer_editable     = return_editable_cell_renderer_text
  @renderer_non_editable_centered = return_editable_cell_renderer_text
  @renderer_non_editable_centered.xalign = 0.5
  @renderer_non_editable = ::Gtk.return_non_editable_cell_renderer_text
  @renderer_editable_hp  = ::Gtk.return_editable_cell_renderer_text
  # ======================================================================= #
  # The three primary renderers in use will have a black foreground
  # colour and a lightgrey background colour.
  # ======================================================================= #
  [
    @renderer_editable, 
    @renderer_non_editable, 
    @renderer_editable_hp,
    @renderer_non_editable_centered
  ].each { |entry|
    entry.set_property('foreground','black' )
    entry.set_property('background','lightgrey' )
  }
  @cell_renderer_progress = cell_renderer_progress(100)

  @cell_renderer_pixbuf = cell_renderer_pixbuf
  @cell_renderer_pixbuf.follow_state = true
  @cell_renderer_pixbuf_for_gender_icons = cell_renderer_pixbuf

  # ======================================================================= #
  # The entries are:
  #
  #   - class
  #   - id
  #   - name
  #   - profession
  #   - attacks
  #   - race
  #   - team position
  #
  # ======================================================================= #
  @tree_view.append_this_column('Class',        @cell_renderer_pixbuf,  pixbuf: 0)
  @tree_view.append_this_column('#id',          @renderer_non_editable, text:   1)
  @tree_view.append_this_column('Name',         @renderer_non_editable, text:   2)
  @tree_view.append_this_column('Profession',   @renderer_non_editable, text:   3)
  @tree_view.append_this_column('#Attacks',     @renderer_non_editable_centered, text:   4)
  @tree_view.append_this_column('Race',         @renderer_non_editable, text:   5)
  # ======================================================================= #
  # Now comes a) Level, b) HP, c) Status and d) Lifebar.
  # ======================================================================= #
  @tree_view.append_this_column('Level',              @renderer_non_editable,  text:   6)
  @tree_view.append_this_column(@hitpoints_real_name, @renderer_editable_hp,   text:   7)
  @tree_view.append_this_column('Status',             @cell_renderer_pixbuf,   pixbuf: 8)
  @tree_view.append_this_column('Lifebar',            @cell_renderer_progress, text: 9)

  # ::Gtk.custom_treeview_widget(
  #   @tree_view, # Append onto this tree-view widget
  #   4,          # Onto which position.
  #   :sword,     # This is the location to the image-file.
  #   '#Attacks'  # And the title that is to be used.
  # )
  # ======================================================================= #
  # This here is a bit more complicated, as it handles the Gender stuff, 
  # which is both an icon, and also a text.
  # ======================================================================= # 
  # @column = ::Gtk::TreeViewColumn.new('Gender')
  # text_renderer = gtk_cell_renderer_text
  # @column.pack_start(text_renderer, true)
  # @column.set_attributes(text_renderer, {text: 6})
  # # And finally, add the column to Gtk::TreeView
  # @tree_view.append_column(@column)
  # @column.pack_start(@cell_renderer_pixbuf_for_gender_icons, false) # add the pic first.
  # @column.set_attributes(@cell_renderer_pixbuf_for_gender_icons, { pixbuf: 11 })
  # ======================================================================= #
  # The gender has a text and a little icon:
  #
  #   @tree_view.append_this_column('Gender',       @renderer_non_editable,      :text   =>  6)
  #
  # ======================================================================= #
  # @tree_view.selection.signal_connect(:changed) { |tree_selection|
  #   tree_selection.each { |model, path, iter| 
  #     e 'HP: '+iter[6].to_s # hp
  #   } # hp
  # }
  @tree_view.signal_connect(:button_press_event) { |w, event|
    if right_button_pressed?(event)
      # =================================================================== #
      # Right mouse-button was pressed here - in this case we will
      # unselect every selection.
      # =================================================================== #
      @tree_view.selection.unselect_all
    end
    case event.event_type
    # === :button_press
    when :button_press # Gdk::Event::BUTTON_PRESS # normal mouse button
      case event.button
      # when 1
        # linker knopf, links
        #  'select_all',
        #  'select_iter',
        #  'select_path',
        #  'select_range',
        #  'selected',
        #  'each',
        #  'selected_rows',
        #  'send',
      when 2 # mitte
        random_event # for debugging things
      end 
    end
  }
end

#padding?Boolean

#

padding?

#

Returns:

  • (Boolean)


158
159
160
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 158

def padding?
  2
end

#pixbuf_for(what) ⇒ Object

#

pixbuf_for

#


201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 201

def pixbuf_for(what)
  case what
  when :archer,
       :druid,
       :barbarian,
       :monk,
       :ninja,  
       :ranger,
       :sorcerer,
       :rogue,
       :paladin,
       :cleric
    what = what.to_s
  # ======================================================================= #
  # === :fighter
  # ======================================================================= #
  when :fighter
    what = 'barbarian'
  else
    e swarn('NOT FOUND')
    pp what
  end
  what = what.dup if what.frozen?
  what << '.gif'
  _ = IMG_FOR_MIGHT_AND_MAGIC_DIR+what
  if File.exist? _
    return GdkPixbuf::Pixbuf.new(
      file: _,
      width:  WIDTH_OF_THE_SMALL_CLASS_ICONS,
      height: WIDTH_OF_THE_SMALL_CLASS_ICONS
    )
  else
    ewarn 'File at '+sfile(_)+' does not exist.'
  end
end

#populate_liststoreObject

#

populate_liststore

#


398
399
400
401
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 398

def populate_liststore
  clear_the_liststore # First, clear it.
  sort_hero_group
end

#random_eventObject

#

random_event

This does a random event. For now, it just does a placeholder, though.

#


408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 408

def random_event
  e 'Doing a random event next.'
  @renderer_editable_hp.background = 'green'
  this_hero = @array_hero_group.rand
  his_hp = this_hero[5]
  max_hp = his_hp
  his_hp -= rand(4)+1
  print his_hp,'/',max_hp
  this_hero[5] = his_hp
  e
  populate_liststore
end

#resetObject

#

reset (reset tag)

#


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 126

def reset
  reset_the_internal_variables
  infer_the_namespace
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, namespace?]
  # ======================================================================= #
  # === Set the title, width, height and the font in use.
  # ======================================================================= #
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
  use_gtk_paradise_project_css_file  
  infer_the_size_automatically
  # ======================================================================= #
  # === @list_store_party
  # ======================================================================= #
  @list_store_party = nil
  # ======================================================================= #
  # === @hitpoints_real_name
  # ======================================================================= #
  @hitpoints_real_name = 'HP' # this var can be overruled, for
  # ======================================================================= #
  # example, in DSA its called 'Lebenspunkte' instead of HP.
  # create_hero_group(:rand)
  # ======================================================================= #
  create_hero_group(:partharon)
  # @character = GamesAndRpgParadise::MightAndMagic::HeroTypes.random_character
end

#runObject

#

run (run tag)

#


573
574
575
576
577
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 573

def run
  super()
  set_the_title_of_the_frame
  populate_liststore
end

#set_image(mode = :random) ⇒ Object

#

set_image

Sets an image, depending on the passed argument.

#


519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 519

def set_image(mode = :random)
  @array_images = [
    GdkPixbuf::Pixbuf.new(
      file:   '/home/x/programming/ruby/src/cyberweb/lib/cyberweb/images/standard_images/RIP.png',
      width:  18,
      height: 18
    ),
    GdkPixbuf::Pixbuf.new(
      file:   ENV['IMG_RPG']+'/WEAPONS/SMALL_SCIMITAR.png',
      width:  18,
      height: 18
    )
  ]
  @hash_images = {
    archer:    pixbuf_for(:archer),
    cleric:    pixbuf_for(:cleric),
    druid:     pixbuf_for(:druid),
    barbarian: pixbuf_for(:barbarian),
    # fighter is duplikat von barbarian
    fighter:   pixbuf_for(:fighter),
    monk:      pixbuf_for(:monk),
    ninja:     pixbuf_for(:ninja),
    paladin:   pixbuf_for(:paladin),
    ranger:    pixbuf_for(:ranger),
    sorcerer:  pixbuf_for(:sorcerer),
    rogue:     pixbuf_for(:rogue),
  }
  case mode
  # ======================================================================= #
  # === :random
  # ======================================================================= #
  when :random,
       :rand
    @array_images.rand
  # ======================================================================= #
  # === :sword
  # ======================================================================= #
  when :sword,
       :alive
    @array_images[1]
  # ======================================================================= #
  # === :rip
  # ======================================================================= #
  when :rip,
       :dead
    @array_images[0]
  else
    @hash_images[mode]    
  end 
end

#set_the_title_of_the_frame(colour_to_use = 'darkblue') ⇒ Object

#

set_the_title_of_the_frame

We set the main frame title here.

#


447
448
449
450
451
452
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 447

def set_the_title_of_the_frame(
    colour_to_use = 'darkblue'
  )
  _ = '<markup><span weight="bold" style="italic" size="x-large" foreground="'+colour_to_use+'"> Party Viewer </span></markup>'
  label_widget.set_markup(_)
end

#sort_hero_groupObject

#

sort_hero_group (sort tag)

This sets the list store values.

#


584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 584

def sort_hero_group
  # ======================================================================= #
  # Let's look at our example data:
  #
  #   ['(1)', hero.type, hero.name, hero.type,'male',hero.level,rand(30)+5],
  #
  # For instance:
  #
  #   ["(4)", "cleric", "Die Magierin", "mage", 7, "human", "female", 5, 13],
  #
  # ======================================================================= #
  @array_hero_group.each { |v0, v1, v2, v3, v4, v5, v6, v7, v8|
    iter = @list_store_party.append
    gender = v6
    # ===================================================================== #
    # Keep in mind that it starts at 0.
    # ===================================================================== #
    iter.set_value( 0, set_image(v1.to_sym) ) # typ, das Image.
    iter.set_value( 1, v0) # Position in der Gruppe
    iter.set_value( 2, v2) # Name
    iter.set_value( 3, v3.to_s.capitalize) # Klasse / Profession
    iter.set_value( 4, v4.to_s) # Number of Attacks.
    iter.set_value( 5, v5.to_s) # Rasse.
    iter.set_value( 6, v6.to_s) # Level.
    iter.set_value( 7, v7.to_s << '/' << v7.to_s) # Hitpoints / Hitpoints display.
    iter.set_value( 8, set_image(:alive) )# is nit im array drin.
    iter.set_value(9, rand(100))
    if false
      # This here should be re-enabled eventually.
      # iter.set_value( 6, gender)  # Gender.
      # ===================================================================== #
      # Next display different image based on male versus female gender.
      # ===================================================================== #
      case gender
      when 'male'
        iter.set_value(11, MALE_ICON.scale( 12, 12 ))
      when 'female'
        iter.set_value(11, FEMALE_ICON.scale( 12, 12 ))
      end
    end
  }
end

#sort_liststoreObject

#

sort_liststore

Also shuffles data right now.

#


266
267
268
269
270
271
# File 'lib/games_and_rpg_paradise/gui/gtk3/might_and_magic/party_viewer.rb', line 266

def sort_liststore
  populate_liststore
  # clear_the_liststore
  # create_hero_group(:rand)
  # populate_liststore
end