Fixed sliders and repeatable buttons, for the change of timing method.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1567 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									84e81bbb3f
								
							
						
					
					
						commit
						e4d6dcbcbe
					
				
							
								
								
									
										23
									
								
								src/engine.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								src/engine.c
									
									
									
									
									
								
							@ -2748,7 +2748,7 @@ short Window_get_clicked_button(void)
 | 
			
		||||
        Hide_cursor();
 | 
			
		||||
        Window_select_normal_button(temp1->Pos_X,temp1->Pos_Y,temp1->Width,temp1->Height);
 | 
			
		||||
        Display_cursor();
 | 
			
		||||
        // Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
        Delay_with_active_mouse((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
        Hide_cursor();
 | 
			
		||||
        Window_unselect_normal_button(temp1->Pos_X,temp1->Pos_Y,temp1->Width,temp1->Height);
 | 
			
		||||
        Display_cursor();        
 | 
			
		||||
@ -2795,7 +2795,7 @@ short Window_get_clicked_button(void)
 | 
			
		||||
      
 | 
			
		||||
      Display_cursor();
 | 
			
		||||
 | 
			
		||||
      // Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
      Delay_with_active_mouse((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
 | 
			
		||||
      Hide_cursor();
 | 
			
		||||
      Window_unselect_normal_button(temp3->Pos_X,temp3->Pos_Y,11,11);
 | 
			
		||||
@ -2824,7 +2824,7 @@ short Window_get_clicked_button(void)
 | 
			
		||||
 | 
			
		||||
      Display_cursor();
 | 
			
		||||
 | 
			
		||||
      // Slider_timer((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
      Delay_with_active_mouse((Mouse_K==1)? Config.Delay_left_click_on_slider : Config.Delay_right_click_on_slider);
 | 
			
		||||
 | 
			
		||||
      Hide_cursor();
 | 
			
		||||
      Window_unselect_normal_button(temp3->Pos_X,temp3->Pos_Y+temp3->Height-11,11,11);
 | 
			
		||||
@ -2930,7 +2930,7 @@ short Window_get_button_shortcut(void)
 | 
			
		||||
      Window_select_normal_button(temp->Pos_X,temp->Pos_Y,temp->Width,temp->Height);
 | 
			
		||||
      Display_cursor();
 | 
			
		||||
      
 | 
			
		||||
      // Slider_timer(Config.Delay_right_click_on_slider);
 | 
			
		||||
      Delay_with_active_mouse(Config.Delay_right_click_on_slider);
 | 
			
		||||
      
 | 
			
		||||
      Hide_cursor();
 | 
			
		||||
      Window_unselect_normal_button(temp->Pos_X,temp->Pos_Y,temp->Width,temp->Height);
 | 
			
		||||
@ -3289,3 +3289,18 @@ void Remap_window_backgrounds(byte * conversion_table, int Min_Y, int Max_Y)
 | 
			
		||||
        }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Delay_with_active_mouse(int speed)
 | 
			
		||||
{
 | 
			
		||||
  Uint32 now;
 | 
			
		||||
  Uint32 end;
 | 
			
		||||
  end = SDL_GetTicks()+speed*10;
 | 
			
		||||
  
 | 
			
		||||
  Need_Timer_events=1;
 | 
			
		||||
  
 | 
			
		||||
  do
 | 
			
		||||
  {
 | 
			
		||||
    Get_input();
 | 
			
		||||
    now = SDL_GetTicks();
 | 
			
		||||
  } while (now<end);
 | 
			
		||||
}
 | 
			
		||||
@ -111,4 +111,6 @@ void Pixel_background(int x_pos, int y_pos, byte color);
 | 
			
		||||
/// Updates the status bar line with a color number.
 | 
			
		||||
/// Used when hovering the menu palette.
 | 
			
		||||
void Status_print_palette_color(byte color);
 | 
			
		||||
 | 
			
		||||
void Delay_with_active_mouse(int delay);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -149,13 +149,7 @@ void Error_function(int error_code, const char *filename, int line_number, const
 | 
			
		||||
    for (index=0;index<=255;index++)
 | 
			
		||||
      temp_palette[index].R=255;
 | 
			
		||||
    Set_palette(temp_palette);
 | 
			
		||||
    SDL_Delay(500);
 | 
			
		||||
    // TODO: Replace the above by a loop where cursor is active:
 | 
			
		||||
    // Need_Timer_events=1
 | 
			
		||||
    // Compute target=now+500
 | 
			
		||||
    // Do
 | 
			
		||||
    //   Get_input()
 | 
			
		||||
    // While now<target
 | 
			
		||||
    Delay_with_active_mouse(50); // Half a second of red flash
 | 
			
		||||
    Set_palette(Main_palette);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user