Clearer loading screen that expands on what is being loaded + autofocus on search.
This commit is contained in:
		
							parent
							
								
									d36fdace38
								
							
						
					
					
						commit
						693eb81962
					
				@ -66,6 +66,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  int char_list_size = 0;
 | 
			
		||||
  int loaded_chars = 0;
 | 
			
		||||
  int generated_chars = 0;
 | 
			
		||||
  int evidence_list_size = 0;
 | 
			
		||||
  int loaded_evidence = 0;
 | 
			
		||||
  int music_list_size = 0;
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,5 @@
 | 
			
		||||
#include "courtroom.h"
 | 
			
		||||
#include "lobby.h"
 | 
			
		||||
 | 
			
		||||
#include "file_functions.h"
 | 
			
		||||
#include "debug_functions.h"
 | 
			
		||||
@ -29,6 +30,7 @@ void Courtroom::construct_char_select()
 | 
			
		||||
 | 
			
		||||
  ui_char_search = new QLineEdit(ui_char_select_background);
 | 
			
		||||
  ui_char_search->setPlaceholderText("Search");
 | 
			
		||||
  ui_char_search->setFocus();
 | 
			
		||||
  set_size_and_pos(ui_char_search, "char_search");
 | 
			
		||||
 | 
			
		||||
  ui_char_passworded = new QCheckBox(ui_char_select_background);
 | 
			
		||||
@ -70,6 +72,8 @@ void Courtroom::set_char_select()
 | 
			
		||||
 | 
			
		||||
  ui_char_select_background->resize(f_charselect.width, f_charselect.height);
 | 
			
		||||
  ui_char_select_background->set_image("charselect_background.png");
 | 
			
		||||
 | 
			
		||||
  ui_char_search->setFocus();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Courtroom::set_char_select_page()
 | 
			
		||||
@ -183,6 +187,14 @@ void Courtroom::character_loading_finished()
 | 
			
		||||
 | 
			
		||||
      connect(character, SIGNAL(clicked()), char_button_mapper, SLOT(map()));
 | 
			
		||||
      char_button_mapper->setMapping(character, ui_char_button_list.size() - 1);
 | 
			
		||||
 | 
			
		||||
      // This part here serves as a way of showing to the player that the game is still running, it is
 | 
			
		||||
      // just loading the pictures of the characters.
 | 
			
		||||
      ao_app->generated_chars++;
 | 
			
		||||
      int total_loading_size = ao_app->char_list_size * 2 + ao_app->evidence_list_size + ao_app->music_list_size;
 | 
			
		||||
      int loading_value = int(((ao_app->loaded_chars + ao_app->generated_chars + ao_app->loaded_music + ao_app->loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      ao_app->w_lobby->set_loading_value(loading_value);
 | 
			
		||||
      ao_app->w_lobby->set_loading_text("Generating chars:\n" + QString::number(ao_app->generated_chars) + "/" + QString::number(ao_app->char_list_size));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    filter_character_list();
 | 
			
		||||
 | 
			
		||||
@ -297,8 +297,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
 | 
			
		||||
      w_courtroom->append_char(f_char);
 | 
			
		||||
 | 
			
		||||
      int total_loading_size = char_list_size + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      w_lobby->set_loading_value(loading_value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -341,8 +341,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
 | 
			
		||||
    w_courtroom->append_evidence(f_evi);
 | 
			
		||||
 | 
			
		||||
    int total_loading_size = char_list_size + evidence_list_size + music_list_size;
 | 
			
		||||
    int loading_value = int(((loaded_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
    int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size;
 | 
			
		||||
    int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
    w_lobby->set_loading_value(loading_value);
 | 
			
		||||
 | 
			
		||||
    QString next_packet_number = QString::number(loaded_evidence);
 | 
			
		||||
@ -370,8 +370,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
 | 
			
		||||
      w_courtroom->append_music(f_music);
 | 
			
		||||
 | 
			
		||||
      int total_loading_size = char_list_size + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      w_lobby->set_loading_value(loading_value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -415,8 +415,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
 | 
			
		||||
      w_courtroom->append_char(f_char);
 | 
			
		||||
 | 
			
		||||
      int total_loading_size = char_list_size + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      w_lobby->set_loading_value(loading_value);
 | 
			
		||||
    }
 | 
			
		||||
    w_courtroom->character_loading_finished();
 | 
			
		||||
@ -436,8 +436,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
 | 
			
		||||
      w_courtroom->append_music(f_contents.at(n_element));
 | 
			
		||||
 | 
			
		||||
      int total_loading_size = char_list_size + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size;
 | 
			
		||||
      int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
 | 
			
		||||
      w_lobby->set_loading_value(loading_value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user