Tuesday, July 30, 2013

How to copy just the UI from a Dex window

I want ONLY the UI from a Dex window. By copying existing UI from one of my other windows I can save a lot of time.

Attempt 1:
1. Duplicate the form
2. Compile and remove errors.
OMG there are literally thousands of errors. I'll just put #if false then #end if in every script on the form so i can compile.

NOPE. It compiles just fine with no errors, but trying to checkin to the source control? No, it says the form references a "non existant script". Ok buddy, how about giving me something less vague? Grrr

Attempt 2:
I accept that there are no shortcuts in Dex. I'll just create the UI from scratch.

YEAH FREAKING RIGHT. After about 15 minutes of that crap I took a little break and came up with an idea. That leads us to...

Attempt 3:
1. Copy the dictionary and open the copy. This ensures the original source is safe.

2. Duplicate the form.

3. Explorer > Export to Text File

4. Now open up the exported file in a text editor, preferrably one that has regular expressions support, unless you like doing lots of manual labor.

5. If you're using Notepad++ this is exactly what to do, otherwise you can figure it out in your editor, you're smart. Choose Replace, make sure Regular Expressions is checked, then put in EventChange    ".+" and replace with EventChange    ""
Do this for ALL script reference fields, like EventPost etc...

6. Find ~EventScripts, then delete starting from there until the end of the file. Then add a "}" at the end since you just deleted the last one.

7. In Dex Explorer > Import from Text file, and attempt to Import the text file you just modified.

8. If there are any conversion errors they are probably script references you missed. Simply Find and replace them until there's no conversion errors.

TADA you have a copied Dex form with no scripts attached!

No comments:

Post a Comment

There was an error in this gadget