#NEWLINE# def asset_loading_counter( self ) : #NEWLINE# #INDENT# if ( ( self . tick_num % 5 ) != 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( AssetManager . total_assets or self . _pc_total_assets ) : #NEWLINE# #INDENT# percent = max ( 0 , int ( ( ( float ( ( ( AssetManager . total_assets - self . _pc_assets_to_load ) - AssetManager . loader_queue . qsize ( ) ) ) / AssetManager . total_assets ) * 100 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# percent = 100 #NEWLINE# #UNINDENT# self . log . debug ( 'Asset Loading Counter. PC remaining:{}, MC remaining:{}, Percent Complete: {}' . format ( self . _pc_assets_to_load , AssetManager . loader_queue . qsize ( ) , percent ) ) #NEWLINE# self . events . post ( 'asset_loader' , total = ( AssetManager . loader_queue . qsize ( ) + self . _pc_assets_to_load ) , pc = self . _pc_assets_to_load , mc = AssetManager . loader_queue . qsize ( ) , percent = percent ) #NEWLINE# if ( not AssetManager . loader_queue . qsize ( ) ) : #NEWLINE# #INDENT# if ( not self . pc_connected ) : #NEWLINE# #INDENT# self . events . post ( 'waiting_for_client_connection' ) #NEWLINE# self . events . remove_handler ( self . asset_loading_counter ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . _pc_assets_to_load ) : #NEWLINE# #INDENT# self . log . debug ( 'Asset Loading Complete' ) #NEWLINE# self . events . post ( 'asset_loading_complete' ) #NEWLINE# self . send ( 'reset_complete' ) #NEWLINE# self . events . remove_handler ( self . asset_loading_counter )