Help! Need to lose weight but can’t exercise

Me

I have a hip condition (waiting for doctor to tell me if I qualify for surgery) and pretty much any kind of exercise hurts my hip too much. This includes sit ups/crunches, walking (I walk with a cane), push ups, planks, jumping, lifting, swimming, etc. I can work my arms if I’m sitting down but I feel like that’s no use without being able to work the rest of my body. This has been ongoing for nearly 4 years but got really bad about a year ago, and at that point I stopped exercising. In that one year I’ve gained about 25 pounds and I feel so disgusted with myself :(. Please help! I have improved my diet but I’m a very picky eater so I can only do so much :/. Are there any good diet pills or something I can take? Or any exercise I can do without putting any weight on my hip? I don’t know what to do. I’m a 23y/o female, 5’2” and ~160lbs (previously ~135lbs). Thank you for any advice. Also, yes I have talked to my doctor. All she’s told me to do is diet

Edit: forgot to include before pic(135lbs, 2016) and current pic (160lbs, 2019)