221 |
|
|
222 |
|
|
223 |
// obstacle map initializer |
// obstacle map initializer |
224 |
obst_init_lab = new PG_Label(gspane, PG_Rect(COL1, ROW1+MARGIN*14, COL2-COL1-MARGIN, SLIDER_W), "Obstacle Initilaizer"); |
obst_init_lab = new PG_Label(gspane, PG_Rect(COL1, ROW1+MARGIN*14, COL2-COL1-MARGIN, SLIDER_W), "Obstacle Initializer"); |
225 |
obst_init_lab->LoadThemeStyle("Label", "Label"); |
obst_init_lab->LoadThemeStyle("Label", "Label"); |
226 |
|
|
227 |
obst_init = new PG_DropDown(gspane, 221, PG_Rect(COL2, ROW1+(MARGIN*2*7), COL3-COL2-MARGIN, SLIDER_W+9)); |
obst_init = new PG_DropDown(gspane, 221, PG_Rect(COL2, ROW1+(MARGIN*2*7), COL3-COL2-MARGIN, SLIDER_W+9)); |
433 |
|
|
434 |
// SET DEFAULT POSITIONS ---------------------\/------------------------------ |
// SET DEFAULT POSITIONS ---------------------\/------------------------------ |
435 |
int p = 0; // the slot to work on |
int p = 0; // the slot to work on |
|
char b[4]; // char buffer |
|
436 |
num_blotches->SetPosition( bm.GetMaxBlotches() ); |
num_blotches->SetPosition( bm.GetMaxBlotches() ); |
437 |
num_blotches_out->SetText( gcvt( bm.GetMaxBlotches() , 3, b) ); |
num_blotches_out->SetText( rm->IntToChar( bm.GetMaxBlotches() ).c_str() ); |
438 |
turn0_chance->SetPosition( bm.GetTurnChance(p,0) ); |
turn0_chance->SetPosition( bm.GetTurnChance(p,0) ); |
439 |
turn0_chance_out->SetText( gcvt( bm.GetTurnChance(p,0) , 3, b) ); |
turn0_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,0) ).c_str() ); |
440 |
turn1_chance->SetPosition( bm.GetTurnChance(p,1) ); |
turn1_chance->SetPosition( bm.GetTurnChance(p,1) ); |
441 |
turn1_chance_out->SetText( gcvt( bm.GetTurnChance(p,1) , 3, b) ); |
turn1_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,1) ).c_str() ); |
442 |
turn2_chance->SetPosition( bm.GetTurnChance(p,2) ); |
turn2_chance->SetPosition( bm.GetTurnChance(p,2) ); |
443 |
turn2_chance_out->SetText( gcvt( bm.GetTurnChance(p,2) , 3, b) ); |
turn2_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,2) ).c_str() ); |
444 |
turn3_chance->SetPosition( bm.GetTurnChance(p,3) ); |
turn3_chance->SetPosition( bm.GetTurnChance(p,3) ); |
445 |
turn3_chance_out->SetText( gcvt( bm.GetTurnChance(p,3) , 3, b) ); |
turn3_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,3) ).c_str() ); |
446 |
mode0_chance->SetPosition( bm.GetModeChance(p,2) ); |
mode0_chance->SetPosition( bm.GetModeChance(p,2) ); |
447 |
mode0_chance_out->SetText( gcvt( bm.GetModeChance(p,2) , 3, b) ); |
mode0_chance_out->SetText( rm->IntToChar( bm.GetModeChance(p,2) ).c_str() ); |
448 |
mode1_chance->SetPosition( bm.GetModeChance(p,3) ); |
mode1_chance->SetPosition( bm.GetModeChance(p,3) ); |
449 |
mode1_chance_out->SetText( gcvt( bm.GetModeChance(p,3) , 3, b) ); |
mode1_chance_out->SetText( rm->IntToChar( bm.GetModeChance(p,3) ).c_str() ); |
450 |
tiles_per_blotch->SetPosition( bm.GetTilesPerBlotch(p) ); |
tiles_per_blotch->SetPosition( bm.GetTilesPerBlotch(p) ); |
451 |
tiles_per_blotch_out->SetText( gcvt( bm.GetTilesPerBlotch(p) , 3, b) ); |
tiles_per_blotch_out->SetText( rm->IntToChar( bm.GetTilesPerBlotch(p) ).c_str() ); |
452 |
edge_grav->SetPosition( bm.GetEdgeGrav(p) + 50 ); // SPECIAL HACK |
edge_grav->SetPosition( bm.GetEdgeGrav(p) + 50 ); // SPECIAL HACK |
453 |
edge_grav_out->SetText( gcvt( bm.GetEdgeGrav(p) , 3, b) ); |
edge_grav_out->SetText( rm->IntToChar( bm.GetEdgeGrav(p) ).c_str() ); |
454 |
edge_det->SetPosition( bm.GetEdgeDet(p) ); |
edge_det->SetPosition( bm.GetEdgeDet(p) ); |
455 |
edge_det_out->SetText( gcvt( bm.GetEdgeDet(p) , 3, b) ); |
edge_det_out->SetText( rm->IntToChar( bm.GetEdgeDet(p) ).c_str() ); |
456 |
step->SetPosition( bm.GetStep(p) ); |
step->SetPosition( bm.GetStep(p) ); |
457 |
step_out->SetText( gcvt( bm.GetStep(p) , 3, b) ); |
step_out->SetText( rm->IntToChar( bm.GetStep(p) ).c_str() ); |
458 |
blank_chance->SetPosition( bm.GetBlankShotChance(p) ); |
blank_chance->SetPosition( bm.GetBlankShotChance(p) ); |
459 |
blank_chance_out->SetText( gcvt( bm.GetBlankShotChance(p) , 3, b) ); |
blank_chance_out->SetText( rm->IntToChar( bm.GetBlankShotChance(p) ).c_str() ); |
460 |
// SET DEFAULT POSITIONS ---------------------/\------------------------------ |
// SET DEFAULT POSITIONS ---------------------/\------------------------------ |
461 |
|
|
462 |
|
|
465 |
|
|
466 |
|
|
467 |
// EVENT WIRING ---------------------\/------------------------------ |
// EVENT WIRING ---------------------\/------------------------------ |
468 |
done->SetEventObject(MSG_BUTTONCLICK, rm, (MSG_CALLBACK_OBJ)&RenderMan::handle_start_new, (void*)done); |
//done->SetEventObject(MSG_BUTTONCLICK, rm, (MSG_CALLBACK_OBJ)&RenderMan::handle_start_new, (void*)done); |
469 |
|
done->SetEventObject(MSG_BUTTONCLICK, this, (MSG_CALLBACK_OBJ)&UIScreen_BMMore::handle_done, (void*)done); |
470 |
preview->SetEventObject(MSG_BUTTONCLICK, this, (MSG_CALLBACK_OBJ)&UIScreen_BMMore::handle_regen_map, (void*)preview); |
preview->SetEventObject(MSG_BUTTONCLICK, this, (MSG_CALLBACK_OBJ)&UIScreen_BMMore::handle_regen_map, (void*)preview); |
471 |
|
|
472 |
slot_num->SetEventObject(MSG_SCROLLPOS, this, (MSG_CALLBACK_OBJ)&UIScreen_BMMore::slide_slot_num, (void*)slot_num); |
slot_num->SetEventObject(MSG_SCROLLPOS, this, (MSG_CALLBACK_OBJ)&UIScreen_BMMore::slide_slot_num, (void*)slot_num); |
516 |
|
|
517 |
void UIScreen_BMMore::RefreshSlotOps() { |
void UIScreen_BMMore::RefreshSlotOps() { |
518 |
int p = slot_num->GetPosition(); |
int p = slot_num->GetPosition(); |
519 |
char b[4]; |
|
|
//adjust all other sliders |
|
520 |
turn0_chance->SetPosition( bm.GetTurnChance(p,0) ); |
turn0_chance->SetPosition( bm.GetTurnChance(p,0) ); |
521 |
turn0_chance_out->SetText( gcvt( bm.GetTurnChance(p,0) , 3, b) ); |
turn0_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,0)).c_str() ); |
522 |
turn1_chance->SetPosition( bm.GetTurnChance(p,1) ); |
turn1_chance->SetPosition( bm.GetTurnChance(p,1) ); |
523 |
turn1_chance_out->SetText( gcvt( bm.GetTurnChance(p,1) , 3, b) ); |
turn1_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,1)).c_str() ); |
524 |
turn2_chance->SetPosition( bm.GetTurnChance(p,2) ); |
turn2_chance->SetPosition( bm.GetTurnChance(p,2) ); |
525 |
turn2_chance_out->SetText( gcvt( bm.GetTurnChance(p,2) , 3, b) ); |
turn2_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,2)).c_str() ); |
526 |
turn3_chance->SetPosition( bm.GetTurnChance(p,3) ); |
turn3_chance->SetPosition( bm.GetTurnChance(p,3) ); |
527 |
turn3_chance_out->SetText( gcvt( bm.GetTurnChance(p,3) , 3, b) ); |
turn3_chance_out->SetText( rm->IntToChar( bm.GetTurnChance(p,3)).c_str() ); |
528 |
mode0_chance->SetPosition( bm.GetModeChance(p,1) ); |
mode0_chance->SetPosition( bm.GetModeChance(p,1) ); |
529 |
mode0_chance_out->SetText( gcvt( bm.GetModeChance(p,1) , 3, b) ); |
mode0_chance_out->SetText( rm->IntToChar( bm.GetModeChance(p,1)).c_str() ); |
530 |
mode1_chance->SetPosition( bm.GetModeChance(p,2) ); |
mode1_chance->SetPosition( bm.GetModeChance(p,2) ); |
531 |
mode1_chance_out->SetText( gcvt( bm.GetModeChance(p,2) , 3, b) ); |
mode1_chance_out->SetText( rm->IntToChar( bm.GetModeChance(p,2)).c_str() ); |
532 |
tiles_per_blotch->SetPosition( bm.GetTilesPerBlotch(p) ); |
tiles_per_blotch->SetPosition( bm.GetTilesPerBlotch(p) ); |
533 |
tiles_per_blotch_out->SetText( gcvt( bm.GetTilesPerBlotch(p) , 3, b) ); |
tiles_per_blotch_out->SetText( rm->IntToChar( bm.GetTilesPerBlotch(p)).c_str() ); |
534 |
edge_grav->SetPosition( bm.GetEdgeGrav(p)+50 ); // SPECIAL HACK |
edge_grav->SetPosition( bm.GetEdgeGrav(p)+50 ); // SPECIAL HACK |
535 |
edge_grav_out->SetText( gcvt( bm.GetEdgeGrav(p) , 3, b) ); // SPECIAL HACK |
edge_grav_out->SetText( rm->IntToChar( bm.GetEdgeGrav(p) ).c_str() ); // SPECIAL HACK |
536 |
edge_det->SetPosition( bm.GetEdgeDet(p) ); |
edge_det->SetPosition( bm.GetEdgeDet(p) ); |
537 |
edge_det_out->SetText( gcvt( bm.GetEdgeDet(p) , 3, b) ); |
edge_det_out->SetText( rm->IntToChar( bm.GetEdgeDet(p) ).c_str() ); |
538 |
step->SetPosition( bm.GetStep(p) ); |
step->SetPosition( bm.GetStep(p) ); |
539 |
step_out->SetText( gcvt( bm.GetStep(p) , 3, b) ); |
step_out->SetText( rm->IntToChar( bm.GetStep(p)).c_str() ); |
540 |
blank_chance->SetPosition( bm.GetBlankShotChance(p) ); |
blank_chance->SetPosition( bm.GetBlankShotChance(p) ); |
541 |
blank_chance_out->SetText( gcvt( bm.GetBlankShotChance(p) , 3, b) ); |
blank_chance_out->SetText( rm->IntToChar( bm.GetBlankShotChance(p)).c_str() ); |
542 |
|
|
543 |
// set brush |
// set brush |
544 |
switch( bm.GetBrush(p) ) { |
switch( bm.GetBrush(p) ) { |
575 |
|
|
576 |
|
|
577 |
void UIScreen_BMMore::RefreshGenSet() { |
void UIScreen_BMMore::RefreshGenSet() { |
578 |
char b[4]; |
|
579 |
//adjust all sliders |
//adjust all sliders |
580 |
|
|
581 |
// TODO: map size (?) |
// TODO: map size (?) |
582 |
|
|
583 |
num_blotches->SetPosition( bm.GetMaxBlotches() ); |
num_blotches->SetPosition( bm.GetMaxBlotches() ); |
584 |
num_blotches_out->SetText( gcvt( bm.GetMaxBlotches() , 3, b) ); |
num_blotches_out->SetText( rm->IntToChar( bm.GetMaxBlotches() ).c_str() ); |
585 |
|
|
586 |
slot0_chance->SetPosition( bm.GetSlotChance(0) ); |
slot0_chance->SetPosition( bm.GetSlotChance(0) ); |
587 |
slot0_chance_out->SetText( gcvt( bm.GetSlotChance(0) , 3, b) ); |
slot0_chance_out->SetText( rm->IntToChar( bm.GetSlotChance(0) ).c_str() ); |
588 |
|
|
589 |
slot1_chance->SetPosition( bm.GetSlotChance(1) ); |
slot1_chance->SetPosition( bm.GetSlotChance(1) ); |
590 |
slot1_chance_out->SetText( gcvt( bm.GetSlotChance(1) , 3, b) ); |
slot1_chance_out->SetText( rm->IntToChar( bm.GetSlotChance(1) ).c_str() ); |
591 |
|
|
592 |
slot2_chance->SetPosition( bm.GetSlotChance(2) ); |
slot2_chance->SetPosition( bm.GetSlotChance(2) ); |
593 |
slot2_chance_out->SetText( gcvt( bm.GetSlotChance(2) , 3, b) ); |
slot2_chance_out->SetText( rm->IntToChar( bm.GetSlotChance(2) ).c_str() ); |
594 |
|
|
595 |
slot3_chance->SetPosition( bm.GetSlotChance(3) ); |
slot3_chance->SetPosition( bm.GetSlotChance(3) ); |
596 |
slot3_chance_out->SetText( gcvt( bm.GetSlotChance(3) , 3, b) ); |
slot3_chance_out->SetText( rm->IntToChar( bm.GetSlotChance(3) ).c_str() ); |
597 |
|
|
598 |
slot4_chance->SetPosition( bm.GetSlotChance(4) ); |
slot4_chance->SetPosition( bm.GetSlotChance(4) ); |
599 |
slot4_chance_out->SetText( gcvt( bm.GetSlotChance(4) , 3, b) ); |
slot4_chance_out->SetText( rm->IntToChar( bm.GetSlotChance(4) ).c_str() ); |
600 |
|
|
601 |
switch( bm.GetMapInit() ) { |
switch( bm.GetMapInit() ) { |
602 |
case OBST_EMPTY: obst_init->SetText("Empty"); break; |
case OBST_EMPTY: obst_init->SetText("Empty"); break; |
608 |
|
|
609 |
|
|
610 |
|
|
|
// EVENTS |
|
611 |
|
|
|
PARAGUI_CALLBACK(UIScreen_BMMore::handle_regen_map) { |
|
|
PG_Button* b = (PG_Button*)clientdata; |
|
612 |
|
|
613 |
|
|
614 |
|
|
615 |
|
// EVENTS ============================================= |
616 |
|
|
617 |
|
PARAGUI_CALLBACK(UIScreen_BMMore::handle_done){ |
618 |
|
// dump configs for debugging |
619 |
|
bm.SaveConfigs("userdata/debug.bmc"); |
620 |
|
//switch screen |
621 |
|
rm->SetActiveScreen(UISCREEN_MAIN); |
622 |
|
return true; |
623 |
|
} |
624 |
|
|
625 |
|
|
626 |
|
|
627 |
|
PARAGUI_CALLBACK(UIScreen_BMMore::handle_regen_map) { |
628 |
// rotate stat labels: |
// rotate stat labels: |
629 |
status_label3->SetText( status_label2->GetText() ); |
status_label3->SetText( status_label2->GetText() ); |
630 |
status_label2->SetText( status_label->GetText() ); |
status_label2->SetText( status_label->GetText() ); |
662 |
|
|
663 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot_num) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot_num) { |
664 |
int p = slot_num->GetPosition(); |
int p = slot_num->GetPosition(); |
665 |
char b[4]; |
slot_num_out->SetText( rm->IntToChar(p).c_str() ); |
|
slot_num_out->SetText( gcvt(p, 3, b) ); |
|
666 |
RefreshSlotOps(); |
RefreshSlotOps(); |
667 |
return true; |
return true; |
668 |
} |
} |
669 |
|
|
670 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_map_size) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_map_size) { |
671 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
672 |
char b[4]; |
|
673 |
map_size_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
map_size_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
674 |
themap->Create( s->GetPosition(), s->GetPosition() ); |
themap->Create( s->GetPosition(), s->GetPosition() ); |
675 |
if (s->GetPosition() > 150 && WARN_LARGE_MAPS) { |
if (s->GetPosition() > 150 && WARN_LARGE_MAPS) { |
676 |
status_label3->SetText( status_label2->GetText() ); |
status_label3->SetText( status_label2->GetText() ); |
682 |
|
|
683 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot0_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot0_chance) { |
684 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
685 |
char b[4]; |
slot0_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
slot0_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
686 |
bm.SetSlotChance( 0, s->GetPosition()); |
bm.SetSlotChance( 0, s->GetPosition()); |
687 |
return true; |
return true; |
688 |
} |
} |
689 |
|
|
690 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot1_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot1_chance) { |
691 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
692 |
char b[4]; |
slot1_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
slot1_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
693 |
bm.SetSlotChance( 1, s->GetPosition()); |
bm.SetSlotChance( 1, s->GetPosition()); |
694 |
return true; |
return true; |
695 |
} |
} |
696 |
|
|
697 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot2_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot2_chance) { |
698 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
699 |
char b[4]; |
slot2_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
slot2_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
700 |
bm.SetSlotChance( 2, s->GetPosition()); |
bm.SetSlotChance( 2, s->GetPosition()); |
701 |
return true; |
return true; |
702 |
} |
} |
703 |
|
|
704 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot3_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot3_chance) { |
705 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
706 |
char b[4]; |
slot3_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
slot3_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
707 |
bm.SetSlotChance( 3, s->GetPosition()); |
bm.SetSlotChance( 3, s->GetPosition()); |
708 |
return true; |
return true; |
709 |
} |
} |
710 |
|
|
711 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot4_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_slot4_chance) { |
712 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
713 |
char b[4]; |
slot4_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
slot4_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
714 |
bm.SetSlotChance( 4, s->GetPosition()); |
bm.SetSlotChance( 4, s->GetPosition()); |
715 |
return true; |
return true; |
716 |
} |
} |
717 |
|
|
718 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_num_blotches) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_num_blotches) { |
719 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
720 |
char b[4]; |
num_blotches_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
num_blotches_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
721 |
bm.SetMaxBlotches(s->GetPosition()); |
bm.SetMaxBlotches(s->GetPosition()); |
722 |
return true; |
return true; |
723 |
} |
} |
726 |
|
|
727 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn0_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn0_chance) { |
728 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
729 |
char b[4]; |
turn0_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
turn0_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
730 |
bm.SetTurnChance( slot_num->GetPosition(), 0, s->GetPosition()); |
bm.SetTurnChance( slot_num->GetPosition(), 0, s->GetPosition()); |
731 |
return true; |
return true; |
732 |
} |
} |
733 |
|
|
734 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn1_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn1_chance) { |
735 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
736 |
char b[4]; |
turn1_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
turn1_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
737 |
bm.SetTurnChance( slot_num->GetPosition(), 1, s->GetPosition()); |
bm.SetTurnChance( slot_num->GetPosition(), 1, s->GetPosition()); |
738 |
return true; |
return true; |
739 |
} |
} |
740 |
|
|
741 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn2_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn2_chance) { |
742 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
743 |
char b[4]; |
turn2_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
turn2_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
744 |
bm.SetTurnChance( slot_num->GetPosition(), 2, s->GetPosition()); |
bm.SetTurnChance( slot_num->GetPosition(), 2, s->GetPosition()); |
745 |
return true; |
return true; |
746 |
} |
} |
747 |
|
|
748 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn3_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_turn3_chance) { |
749 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
750 |
char b[4]; |
turn3_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
turn3_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
751 |
bm.SetTurnChance( slot_num->GetPosition(), 3, s->GetPosition()); |
bm.SetTurnChance( slot_num->GetPosition(), 3, s->GetPosition()); |
752 |
return true; |
return true; |
753 |
} |
} |
754 |
|
|
755 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_tiles_per_blotch) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_tiles_per_blotch) { |
756 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
757 |
char b[4]; |
tiles_per_blotch_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
tiles_per_blotch_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
758 |
bm.SetTilesPerBlotch( slot_num->GetPosition(), s->GetPosition()); |
bm.SetTilesPerBlotch( slot_num->GetPosition(), s->GetPosition()); |
759 |
return true; |
return true; |
760 |
} |
} |
761 |
|
|
762 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_mode0_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_mode0_chance) { |
763 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
764 |
char b[4]; |
mode0_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
mode0_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
765 |
bm.SetModeChance( slot_num->GetPosition(), 1, s->GetPosition()); |
bm.SetModeChance( slot_num->GetPosition(), 1, s->GetPosition()); |
766 |
return true; |
return true; |
767 |
} |
} |
768 |
|
|
769 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_mode1_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_mode1_chance) { |
770 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
771 |
char b[4]; |
mode1_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
mode1_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
772 |
bm.SetModeChance( slot_num->GetPosition(), 2, s->GetPosition()); |
bm.SetModeChance( slot_num->GetPosition(), 2, s->GetPosition()); |
773 |
return true; |
return true; |
774 |
} |
} |
775 |
|
|
776 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_edge_grav) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_edge_grav) { |
777 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
778 |
char b[4]; |
edge_grav_out->SetText( rm->IntToChar( s->GetPosition()-50 ).c_str() ); // SPECIAL HACK |
|
edge_grav_out->SetText( gcvt(s->GetPosition()-50, 3, b) ); // SPECIAL HACK |
|
779 |
bm.SetEdgeGrav( slot_num->GetPosition(), s->GetPosition()-50); // SPECIAL HACK |
bm.SetEdgeGrav( slot_num->GetPosition(), s->GetPosition()-50); // SPECIAL HACK |
780 |
return true; |
return true; |
781 |
} |
} |
782 |
|
|
783 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_step) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_step) { |
784 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
785 |
char b[4]; |
step_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
step_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
786 |
bm.SetStep( slot_num->GetPosition(), s->GetPosition()); |
bm.SetStep( slot_num->GetPosition(), s->GetPosition()); |
787 |
return true; |
return true; |
788 |
} |
} |
789 |
|
|
790 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_edge_det) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_edge_det) { |
791 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
792 |
char b[4]; |
edge_det_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
edge_det_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
793 |
bm.SetEdgeDet( slot_num->GetPosition(), s->GetPosition()); |
bm.SetEdgeDet( slot_num->GetPosition(), s->GetPosition()); |
794 |
return true; |
return true; |
795 |
} |
} |
796 |
|
|
797 |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_blank_chance) { |
PARAGUI_CALLBACK(UIScreen_BMMore::slide_blank_chance) { |
798 |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
PG_ScrollBar* s = (PG_ScrollBar*)clientdata; |
799 |
char b[4]; |
blank_chance_out->SetText( rm->IntToChar( s->GetPosition() ).c_str() ); |
|
blank_chance_out->SetText( gcvt(s->GetPosition(), 3, b) ); |
|
800 |
bm.SetBlankShotChance( slot_num->GetPosition(), s->GetPosition()); |
bm.SetBlankShotChance( slot_num->GetPosition(), s->GetPosition()); |
801 |
return true; |
return true; |
802 |
} |
} |
864 |
|
|
865 |
PARAGUI_CALLBACK(UIScreen_BMMore::handle_save_bmconf) { |
PARAGUI_CALLBACK(UIScreen_BMMore::handle_save_bmconf) { |
866 |
status_label->SetText("Saving Blotchmaker configuration..."); |
status_label->SetText("Saving Blotchmaker configuration..."); |
867 |
bm.SaveConfigs(); |
bm.SaveConfigs("userdata/last.bmc"); |
868 |
status_label->SetText("Configuration saved."); |
status_label->SetText("Configuration saved."); |
869 |
return true; |
return true; |
870 |
} |
} |
872 |
PARAGUI_CALLBACK(UIScreen_BMMore::handle_load_bmconf) { |
PARAGUI_CALLBACK(UIScreen_BMMore::handle_load_bmconf) { |
873 |
status_label->SetText("Loading Blotchmaker configuration..."); |
status_label->SetText("Loading Blotchmaker configuration..."); |
874 |
|
|
875 |
bool good = bm.LoadConfigs(); |
bool good = bm.LoadConfigs("userdata/last.bmc"); |
876 |
RefreshSlotOps(); |
RefreshSlotOps(); |
877 |
RefreshGenSet(); |
RefreshGenSet(); |
878 |
|
|