Skip to content

Commit 443c8d9

Browse files
committed
fix bug with elements being drawn after feedback cancellation, fix some bugs with the buttons on bottom
1 parent 2aa7588 commit 443c8d9

2 files changed

Lines changed: 42 additions & 30 deletions

File tree

src/interface.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5001,9 +5001,13 @@ int report_ui(pixel* vid_buf, char *save_id, bool bug)
50015001
drawtext(vid_buf, (XRES+BARSIZE-400)+163, (YRES+MENUSIZE-150)-13, "Send", 255, 255, 255, 255);
50025002
else
50035003
drawtext(vid_buf, (XRES+BARSIZE-400)+163, (YRES+MENUSIZE-150)-13, "Report", 255, 255, 255, 255);
5004-
if (mx>(XRES+BARSIZE-400)+150 && my>(YRES+MENUSIZE-150)-18 && mx<(XRES+BARSIZE-400)+200 && my<(YRES+MENUSIZE-150)) {
5005-
fillrect(vid_buf, (XRES+BARSIZE-400)+150, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40);
5004+
if (mx>(XRES+BARSIZE-400)+150 && my>(YRES+MENUSIZE-150)-18 && mx<(XRES+BARSIZE-400)+200 && my<(YRES+MENUSIZE-150))
5005+
{
50065006
if (b)
5007+
{
5008+
fillrect(vid_buf, (XRES+BARSIZE-400)+150, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 100);
5009+
}
5010+
else if (!b && bq == 1)
50075011
{
50085012
int ret = 0;
50095013
if (bug)
@@ -5023,12 +5027,18 @@ int report_ui(pixel* vid_buf, char *save_id, bool bug)
50235027
return 0;
50245028
}
50255029
}
5030+
else
5031+
fillrect(vid_buf, (XRES+BARSIZE-400)+150, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40);
50265032
}
50275033
if (mx>200 && my>(YRES+MENUSIZE-150)-18 && mx<250 && my<(YRES+MENUSIZE-150))
50285034
{
50295035
fillrect(vid_buf, 200, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40);
5030-
if (b)
5036+
if (!b && bq)
50315037
return 0;
5038+
else if (b)
5039+
fillrect(vid_buf, 200, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 100);
5040+
else
5041+
fillrect(vid_buf, 200, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40);
50325042
}
50335043
ui_edit_draw(vid_buf, &ed);
50345044
#ifdef OGLR

src/main.cpp

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,7 @@ int main(int argc, char *argv[])
26462646
it = 50;
26472647
if (y > YRES+MENUSIZE-BARSIZE)//check if mouse is on menu buttons
26482648
{
2649-
if (!lb)//mouse is NOT held down, so it is a first click
2649+
if (!lb && !bq)//mouse is NOT held down, so it is a first click
26502650
{
26512651
if (x>=189 && x<=202 && svf_login && svf_open && svf_myvote==0 && svf_own==0)
26522652
{
@@ -2655,52 +2655,61 @@ int main(int argc, char *argv[])
26552655
svf_myvote = 1;
26562656
}
26572657
}
2658-
if (x>=204 && x<=217 && svf_login && svf_open && svf_myvote==0 && svf_own==0)
2658+
else if (x>=204 && x<=217 && svf_login && svf_open && svf_myvote==0 && svf_own==0)
26592659
{
26602660
if (execute_vote(vid_buf, svf_id, "Down"))
26612661
{
26622662
svf_myvote = -1;
26632663
}
26642664
}
26652665
//tags
2666-
if (x>=219 && x<=(XRES+BARSIZE-(510-333)) && svf_open)
2666+
else if (x>=219 && x<=(XRES+BARSIZE-(510-333)) && svf_open)
26672667
tag_list_ui(vid_buf);
26682668
else if (x>=((XRES+BARSIZE-(510-335))) && x<((XRES+BARSIZE-(510-350))))
26692669
report_ui(vid_buf, NULL, true);
2670-
if (x>=(XRES+BARSIZE-(510-351)) && x<(XRES+BARSIZE-(510-366)) && !bq)
2670+
else if (x>=(XRES+BARSIZE-(510-351)) && x<(XRES+BARSIZE-(510-366)))
26712671
{
26722672
//legacy_enable = !legacy_enable;
26732673
simulation_ui(vid_buf);
26742674
}
2675-
if (x>=(XRES+BARSIZE-(510-367)) && x<=(XRES+BARSIZE-(510-383)) && !bq)
2675+
else if (x>=(XRES+BARSIZE-(510-367)) && x<=(XRES+BARSIZE-(510-383)))
26762676
{
26772677
NewSim();
26782678
for (i=0; i<NPART-1; i++)
26792679
parts[i].life = i+1;
26802680
parts[NPART-1].life = -1;
26812681
globalSim->pfree = 0;
26822682
}
2683-
if (x>=(XRES+BARSIZE-(510-385)) && x<=(XRES+BARSIZE-(510-476)))
2683+
else if (x>=(XRES+BARSIZE-(510-385)) && x<=(XRES+BARSIZE-(510-476)))
26842684
{
26852685
login_ui(vid_buf);
26862686
if (svf_login) {
26872687
save_presets(0);
26882688
http_session_check = NULL;
26892689
}
26902690
}
2691-
if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))
2691+
else if (x >= 1 && x <= 17)
26922692
{
2693-
if (x>=37 && x<=187)
2693+
if (sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))
26942694
{
2695-
save_filename_ui(vid_buf);
2696-
2695+
catalogue_ui(vid_buf);
26972696
}
2698-
if (x>=1 && x<=17)
2697+
else
26992698
{
2700-
catalogue_ui(vid_buf);
2699+
search_ui(vid_buf);
2700+
memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE);
2701+
memset(fire_r, 0, sizeof(fire_r));
2702+
memset(fire_g, 0, sizeof(fire_g));
2703+
memset(fire_b, 0, sizeof(fire_b));
2704+
}
2705+
}
2706+
else if (x >= 37 && x <= 187 && svf_login)
2707+
{
2708+
if (sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))
2709+
{
2710+
save_filename_ui(vid_buf);
27012711
}
2702-
} else {
2703-
if (x>=37 && x<=187 && svf_login)
2712+
else
27042713
{
27052714
if (!svf_open || !svf_own || x>51)
27062715
{
@@ -2718,7 +2727,7 @@ int main(int argc, char *argv[])
27182727
else
27192728
{
27202729
int oldsave_as = save_as;
2721-
int can_publish = check_save(2,0,0,XRES,YRES,0);
2730+
int can_publish = check_save(2, 0, 0, XRES, YRES, 0);
27222731
if (can_publish)
27232732
{
27242733
svf_publish = 0;
@@ -2741,23 +2750,16 @@ int main(int argc, char *argv[])
27412750
strcpy(itc_msg, "Saved Successfully");
27422751
}
27432752
save_as = oldsave_as;
2744-
2753+
27452754
}
27462755
while (!sdl_poll())
27472756
if (!mouse_get_state(&x, &y))
27482757
break;
27492758
b = bq = 0;
27502759
}
2751-
if (x>=1 && x<=17)
2752-
{
2753-
search_ui(vid_buf);
2754-
memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE);
2755-
memset(fire_r, 0, sizeof(fire_r));
2756-
memset(fire_g, 0, sizeof(fire_g));
2757-
memset(fire_b, 0, sizeof(fire_b));
2758-
}
27592760
}
2760-
if (x>=19 && x<=35 && svf_last && !bq) {
2761+
else if (x>=19 && x<=35 && svf_last)
2762+
{
27612763
//int tpval = sys_pause;
27622764
if (b == 1 || !strncmp(svf_id,"",8))
27632765
{
@@ -2768,11 +2770,11 @@ int main(int argc, char *argv[])
27682770
open_ui(vid_buf, svf_id, NULL, 0);
27692771
//sys_pause = tpval;
27702772
}
2771-
if (x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq)
2773+
else if (x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)))
27722774
{
27732775
render_ui(vid_buf, XRES+BARSIZE-(510-491)+1, YRES+22, 3);
27742776
}
2775-
if (x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq)
2777+
else if (x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)))
27762778
sys_pause = !sys_pause;
27772779
lb = 0;
27782780
}

0 commit comments

Comments
 (0)