@@ -117,6 +117,7 @@ double scaleValue(double inputValue, double inputMin, double inputMax, double ou
117117static tai_hook_ref_t ref_hook0 ;
118118static int status_draw_time_patched (void * a1 , int a2 )
119119{
120+ static int was_charging = 0 ;
120121 in_draw_time = 1 ;
121122 int out = TAI_CONTINUE (int , ref_hook0 , a1 , a2 );
122123 in_draw_time = 0 ;
@@ -127,10 +128,19 @@ static int status_draw_time_patched(void *a1, int a2)
127128 }
128129 scePafWidgetSetFontSize (a1 , 20.0 , 1 , bat_num_start , bat_num_len );
129130 scePafWidgetSetFontSize (a1 , 16.0 , 1 , percent_start , 1 );
131+
132+ int is_charging = scePowerIsBatteryCharging ();
133+ if (is_charging && !was_charging ) {
134+ scePafWidgetSetFontSize (a1 , 18.0f , 1 , bat_num_start , bat_num_len );
135+ scePafWidgetSetFontSize (a1 , 14.0f , 1 , percent_start , 1 );
136+ }
137+ was_charging = is_charging ;
130138 }
131139 return out ;
132140}
133141
142+ was_charging = is_charging ;
143+
134144static tai_hook_ref_t ref_hook1 ;
135145static uint16_t * * some_strdup_patched (uint16_t * * a1 , uint16_t * a2 , int a2_size )
136146{
@@ -142,14 +152,9 @@ static uint16_t **some_strdup_patched(uint16_t **a1, uint16_t *a2, int a2_size)
142152 percent = oldpercent ;
143153 }
144154 oldpercent = percent ;
145- char buff [12 ];
146- int len ;
147- if (scePowerIsBatteryCharging ()) {
148- len = sceClibSnprintf (buff , sizeof (buff ), " »%d%%" , percent );
149- } else {
150- len = sceClibSnprintf (buff , sizeof (buff ), " %d%%" , percent );
151- }
152- for (int i = 0 ; i < len ; ++ i ) {
155+ char buff [10 ];
156+ int len = sceClibSnprintf (buff , 10 , " %d%%" , percent );
157+ for (int i = 0 ; i < len ; ++ i ) {
153158 a2 [a2_size + i ] = buff [i ];
154159 }
155160 a2 [a2_size + len ] = 0 ;
0 commit comments