Saturday, October 24, 2015

7 Hours of hell

This will be story, my story based on true events.

Hour 0

Recently I start using project generator not only to generate makes, projects and solutions but also to generate some code. Because of that from time to time I need to run one python script. This is not big problem but I decided to make my life easier and add button in Visual Studio 2010 (I'm working slowly on progression to new one) which will trigger this task. Sound simple right ? 


Hour 1

I started like each good programmer from project generated from template. I started look around what happening there and slowly understanding how all  this works. Google helping me a lot with this task there are some tutorials how to do plugins. With each minute everything starting make sens I'm optimistic in finishing plugin in next hour.

Hour 2 

I spend some tome on figuring out how to add item to main menu. It's working now and I just need to automatically create toolbar and I will be in sweet spot.

Hour 3

Finished, cleaned up and ready to go. This was nice experience. It took some time but this were new stuff for me so I don't mind. Time to return to game development. Starting project solution and ....

What the heck ? Plugin stopped working. But moment ago it was working :| Well I probably do something wrong. 

Hour 4

Investigation shown me that plugin only works properly when VS is started with : 
/resetaddin WrTools.Connect
Other way it's behave weird. I'm continue looking.

Hour 5

Persistent Mode of plugin is persistent for few starts:
  1. With /resetaddin - Work fine
  2. Without #1 - Work fine
  3. Without #2 - Only one button is in main menu and Toolbar is empty
  4. Without #3 - Nothing works
This is madness how the f*** this work. This not make sense at all.

Hour 6 

Google don't help too much. I cannot find any useful information and make it work. The more I look into it the less sense all this issue have :/

Hour 7

In desperation I looked to Qt plugin source code to figure out how they do it. And surprise the recreate whole UI each time you start VS:/ I will do similar I just want to make it work and forgot about this ;( 

Finished

Right now plugin works but I gave up on toolbar generated from code. It created me so much issue that I created it manually in vs. 

In the end I really doubt that final effect was worth all this time spend on it. Maybe I was doing something wrong and there is magic function that fixed everything. If so then this whole stuff is broken in roots because after all this time I couldn't figure out what I was doing wrong.

I want to believe that in never version of Visual Studio they improved this stuff and made it easier. If not I would really not recommend doing any integration with VS I don't think its worth it.

Greg

2 comments:

  1. Hey, just drop by to comment how awesome your work with LBA Remake is, thanks for keeping us updated. Hope you can use the engine for other of your creations as well!

    ReplyDelete
    Replies
    1. Thanks :] I do my best so this was technology which can be reused :]

      Delete