indexing description: "[ Scene that displays the remote highscore ]" date: "$Date$" revision: "$Revision$" class REMOTE_HIGHSCORE_SCENE inherit EM_WIDGET_SCENE redefine initialize_scene end SHARED_HIGHSCORE create make_widget_scene feature -- Initialization initialize_scene is -- initialize the scene local do Precursor set_frame_counter_visibility (true) set_background_color (theme_colors.window_background) setup_widgets end on_go_to_local is -- handle click on 'local highscore' button do set_next_scene (create {LOCAL_HIGHSCORE_SCENE}.make_widget_scene) start_next_scene end setup_widgets is -- setup widgets for the scene local go_to_local: EM_BUTTON new_name: EM_LABEL new_score: EM_LABEL title: EM_LABEL name_offset_x, score_offset_x: INTEGER name_offset_y, score_offset_y: INTEGER spacing: INTEGER row: INTEGER do create go_to_local.make_from_dimension (180, 40) go_to_local.set_position (300, 400) go_to_local.set_text ("Local Highscore") go_to_local.clicked_event.subscribe (agent on_go_to_local) add_widget (go_to_local) -- todo create title.make_from_text ("Remote Highscore - (More details: http://eiffelmedia.origo.ethz.ch/highscore)") title.set_position (100, 50) add_widget (title) -- We'll display the remote highscore using labels, this can be done differently name_offset_x := 100 score_offset_x := 300 name_offset_y := 100 score_offset_y := name_offset_y spacing := 17 from highscore.remote_highscore.start row := 0 until highscore.remote_highscore.after loop new_name := create {EM_LABEL}.make_from_text(highscore.remote_highscore.item_for_iteration.name) new_name.set_position (name_offset_x, name_offset_y + row * spacing) add_widget (new_name) new_score := create {EM_LABEL}.make_from_text(highscore.remote_highscore.item_for_iteration.score.out) new_score.set_position (score_offset_x, score_offset_y + row * spacing) add_widget (new_score) row := row + 1 highscore.remote_highscore.forth end end end