Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
48 got some more work done on arena_keeper.

Now, the tools are split into categories that each have their own menu and button to open said menu. Now, I just need make it so only 1 of those menu's can be open (Which will be a new widget in mergui) and I need to increase the size of the buttons. Because the text "Furniture" doesn't really fit.

I also need to think of something to make sure the buttons are always in the same order, because right now that can differ every time you start the game....
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
49. Ah, ok! I thought I’d missed something in the post itself! In that case by “It” I’ll assume you meant a creepy clown in a drain, because I saw a bit of that film yesterday :D
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
52 I... think I found a bug in the rust compiler?
I have the following match statement
Code:
match (on_button, current_active.as_ref()) {
(Some(button), Some(cur)) if button.0 != *cur => {}
(Some(button), Some(cur)) if button.0 == *cur => {}
(Some(button), None) => {}
(None, Some(cur)) => {}
(None, None) => {}
}
Which, as far as I can see covers every combinations that are possible. Yet, it is complaining that I am missing the (Some(button),Some(cur)) case. But.... either button.0 is equal to cur or it isn't. Meaning that if both are a Some it should go to either the first branch (if they are not equal) or the second one (if they are equal). I don't see how a third state can happen.

edit: Apparently it isn't exactly a bug...From the documentation of the unreachable macro
This is useful any time that the compiler can't determine that some code is unreachable. For example:
  • Match arms with guard conditions.