@@ -65,7 +65,7 @@ pub mod paint_actions {
65
65
66
66
use pixelaw :: core :: actions :: {IActionsDispatcherTrait as ICoreActionsDispatcherTrait };
67
67
68
- use pixelaw :: core :: models :: pixel :: {Pixel , PixelUpdate };
68
+ use pixelaw :: core :: models :: pixel :: {Pixel , PixelUpdate , PixelUpdateResultTrait };
69
69
use pixelaw :: core :: models :: registry :: App ;
70
70
use pixelaw :: core :: utils :: {
71
71
DefaultParameters , decode_rgba, encode_rgba, get_callers, get_core_actions, subu8,
@@ -190,7 +190,7 @@ pub mod paint_actions {
190
190
191
191
// TODO: Load Paint App Settings like the fade step time
192
192
// For example for the cooldown feature
193
- let COOLDOWN_SECS = 5 ;
193
+ let COOLDOWN_SECS = 0 ;
194
194
195
195
// Check if 5 seconds have passed or if the sender is the owner
196
196
assert! (
@@ -316,19 +316,19 @@ pub mod paint_actions {
316
316
// If the color is 0,0,0, fading is done.
317
317
if r == 0 && g == 0 && b == 0 {
318
318
world . erase_model (@ pixel );
319
- // delete!(world, (pixel));
320
319
return ;
321
320
}
322
321
323
322
// Fade the color
324
- let FADE_STEP = 5 ;
323
+ let FADE_STEP = 50 ;
325
324
326
325
let new_color = encode_rgba (
327
326
subu8 (r , FADE_STEP ), subu8 (g , FADE_STEP ), subu8 (b , FADE_STEP ), a ,
328
327
);
329
328
330
329
// Update color of the pixel
331
- let _ = core_actions
330
+ // TODO check results?
331
+ let _result = core_actions
332
332
. update_pixel (
333
333
player ,
334
334
system ,
@@ -340,13 +340,15 @@ pub mod paint_actions {
340
340
text : Option :: None ,
341
341
app : Option :: Some (system ),
342
342
owner : Option :: Some (player ),
343
- action : Option :: None // Not using this feature for paint
343
+ action : Option :: None
344
344
},
345
345
Option :: None ,
346
346
false ,
347
- );
347
+ ). unwrap () ;
348
348
349
- let FADE_SECONDS = 4 ;
349
+
350
+
351
+ let FADE_SECONDS = 0 ;
350
352
351
353
// Implement fading by scheduling a new fade call
352
354
let queue_timestamp = starknet :: get_block_timestamp () + FADE_SECONDS ;
@@ -355,12 +357,17 @@ pub mod paint_actions {
355
357
let THIS_CONTRACT_ADDRESS = get_contract_address ();
356
358
357
359
// Prepare calldata
358
- // Calldata[0]: Calling player
360
+ // Calldata[0]: player_override option:None
361
+ calldata . append (0x0 );
359
362
calldata . append (player . into ());
360
363
361
364
// Calldata[1]: Calling system
365
+ calldata . append (0x0 );
362
366
calldata . append (THIS_CONTRACT_ADDRESS . into ());
363
367
368
+ // Calldata[2]: Area Hint
369
+ calldata . append (0x1 );
370
+
364
371
// Calldata[2,3]: Position[x,y]
365
372
calldata . append (position . x. into ());
366
373
calldata . append (position . y. into ());
0 commit comments