OUCH ! I'm so sorry to hear about your accident ! But, that doesn't mean you have to give up your healthy habits. It's not as big a bump in the road as you'd think. When it comes to weight loss, what matters most is what we eat. Good nutrition is what takes the weight off and keeps it off. Exercise is what keeps our bodies fit and healthy.
In short, you can still lose weight even though you can't exercise. Listen to your doctor, if they want you off your feet for a couple of weeks (at least), listen to them. Give your foot time to heal. For now, you just be mindful of what you eat. You really won't derail any of your efforts at good health because you hurt yourself. Top athletes routinely are injured and have to take time off.
So, don't worry ! If you need something to do, ask your doctor if you can do some strength training exercises while sitting in a chair. all you'd need would be some hand weights or resistance bands. Work your upper body muscles while your lower body heals. And if you haven't been doing any strength training, this would be a good opportunity to start.
But once again, ask your doctor, they might want you to take it easy.
Don't worry, everything will be fine !