mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-21 15:54:07 +00:00
rogueviz::seuphorica:: a better system for hand ordering
This commit is contained in:
parent
36eda3e132
commit
dd782f6d32
@ -774,6 +774,7 @@ void is_clone(struct tile& orig, struct tile& clone) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sort_hand() {
|
void sort_hand() {
|
||||||
|
return;
|
||||||
sort(drawn.begin(), drawn.end(), [] (tile &t1, tile &t2) {
|
sort(drawn.begin(), drawn.end(), [] (tile &t1, tile &t2) {
|
||||||
auto h1 = tb_hand.locate_tile(t1);
|
auto h1 = tb_hand.locate_tile(t1);
|
||||||
auto h2 = tb_hand.locate_tile(t2);
|
auto h2 = tb_hand.locate_tile(t2);
|
||||||
@ -782,6 +783,12 @@ void sort_hand() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void move_to_front(int &b) {
|
||||||
|
while(b > 0) {
|
||||||
|
swap(drawn[b], drawn[b-1]); b--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void seuphorica_menu();
|
void seuphorica_menu();
|
||||||
|
|
||||||
int start_tick;
|
int start_tick;
|
||||||
@ -992,10 +999,11 @@ void seuphorica_screen() {
|
|||||||
}
|
}
|
||||||
if(box_moved == &drawn && current_box == &drawn) {
|
if(box_moved == &drawn && current_box == &drawn) {
|
||||||
sort_hand();
|
sort_hand();
|
||||||
|
move_to_front(tile_boxid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(box_moved == &drawn && current_box == &shop) {
|
if(box_moved == &drawn && current_box == &shop) {
|
||||||
swap(drawn[tile_boxid], drawn[0]);
|
move_to_front(tile_boxid);
|
||||||
back_to_shop();
|
back_to_shop();
|
||||||
sort_hand();
|
sort_hand();
|
||||||
}
|
}
|
||||||
@ -1014,7 +1022,7 @@ void seuphorica_screen() {
|
|||||||
if(box_moved == &drawn && current_box == nullptr && mouseover) {
|
if(box_moved == &drawn && current_box == nullptr && mouseover) {
|
||||||
auto at = mouseover;
|
auto at = mouseover;
|
||||||
if(in_board(at) && !board.count(at) && tile_orientation.count(at)) {
|
if(in_board(at) && !board.count(at) && tile_orientation.count(at)) {
|
||||||
swap(drawn[tile_boxid], drawn[0]);
|
move_to_front(tile_boxid);
|
||||||
drop_hand_on(at);
|
drop_hand_on(at);
|
||||||
sort_hand();
|
sort_hand();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user