Thread Tools Display Modes
11-30-08, 10:31 PM   #1
phreakintheroom
A Murloc Raider
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 4
Addon for replacing/overwriting WTF files?

OK, let me preface this by saying that I'm not a very good programmer in general and know even less about the WoW API.

Let's say I have two addon compilations that both use the exact same addons, only the addons are configured differently. I want to be able to, instead of having the two different compilations, mash 'em all into one with switchable configurations.

Is it possible to have an addon that does nothing but overwrite the files in the WTF folder with files that it keeps stored inside itself?

Here's a detailed general example of what I mean:

1. I copy both sets of WTF folders and rename them (let's say one is called "CheesecakeUI" and the other "DoofusUI"), and put em aside for a minute.

2. I delete one of these WoW installs entirely. In the other one, I delete the WTF folder and log in so it recreates all the WTF files/folders. All the configuration is left to default.

3. Let's call my fictional little addon here "DaSwitchah". I install DaSwitchah. I copy the CheesecakeUI and DoofusUI folders into its' folder.

4. I fire up the game, and slashcommand DaSwitchah. Its' frame contains two things: a form to put in a path to a saved WTF folder, and a "copy" button.

5. I put in the path to the CheesecakeUI folder, and hit "copy". It overwrites all the current WTF files with what's in the CheesecakeUI folder, and reloads the UI.

6. Bam, CheesecakeUI is up and running. To switch to DoofusUI, I just repeat the process.

Pipe dream, or poor man's Mazzifier?
  Reply With Quote
11-30-08, 10:47 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Pipe dream, sorry. Best you can do is have two separate WTF folders.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-30-08, 11:46 PM   #3
phreakintheroom
A Murloc Raider
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 4
Ok, so much for that plan then. :lol:

Alternatively, would it be possible to have an addon change information in other addons' savedvariable LUAs and/or the AddOns.txt and layout-local.txt files?

I guess what my point is, to what extent can an addon modify stored data?
  Reply With Quote
11-30-08, 11:52 PM   #4
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
I *think* Archiveui may work similarly. If I remember correctly, it was a scripted type setting per class (it's been over a year since I used that ui, so I'm not entirely sure how it works).
  Reply With Quote
12-01-08, 02:05 AM   #5
Raziel08
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
ok im new to the whole addon malling scene :P but, would it not be possible to store the settings in seperate lua files and get the XML sheet to load the specific lua file after all from what i understand the way the code works is it reads from one file what to load, ie .. pitbull_player.lua for example

so cant u save for example

pitbull_Dreadui.lua
and
pitbull_Satrena.lua

then in the code write the mod to call either lua file depending on the slash command given?
i aint no programmer nor have i taken time to study the script so i dont know anything yet but i am starting to learn so this proberly wont work but its all part of the learning curve

but surley there is a way to call a function to load a specific file? like maybe
function load pitbull_Dread.lua
that wont work i know that but u get the idea
u would need to add this function if it is possible to every mods lua / xml etc.. id presume

is that not possible?
  Reply With Quote
12-01-08, 02:24 AM   #6
phreakintheroom
A Murloc Raider
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 4
Originally Posted by Raziel08 View Post
ok im new to the whole addon malling scene :P but, would it not be possible to store the settings in seperate lua files and get the XML sheet to load the specific lua file after all from what i understand the way the code works is it reads from one file what to load, ie .. pitbull_player.lua for example

so cant u save for example

pitbull_Dreadui.lua
and
pitbull_Satrena.lua

then in the code write the mod to call either lua file depending on the slash command given?
i aint no programmer nor have i taken time to study the script so i dont know anything yet but i am starting to learn so this proberly wont work but its all part of the learning curve

but surley there is a way to call a function to load a specific file? like maybe
function load pitbull_Dread.lua
that wont work i know that but u get the idea
So essentially what you're saying is that instead of directly modifying the LUA itself, you'd modify the TOC to select a different LUA on load?

Can that be done in-game?
  Reply With Quote
12-01-08, 02:42 AM   #7
Raziel08
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
Originally Posted by phreakintheroom View Post
So essentially what you're saying is that instead of directly modifying the LUA itself, you'd modify the TOC to select a different LUA on load?

Can that be done in-game?
thats what i want to know but yes exactly
  Reply With Quote
12-01-08, 02:43 AM   #8
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
no that won't work.

the lua filename is always the name of the addon.

the name of the variables in the lua filename has to be the same that is used in the addon.

it's theoretically possible to create an addon that changes the variables of other addons.. and many addons already have a profile system that does what you want.

the last time i tried to create an addon that saves/restores profiles I gave up because of the way acedb3 works... my chatter profiles have over 120 tables *sigh* and I didn't want to mess with that .)
  Reply With Quote
12-01-08, 02:51 AM   #9
Raziel08
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
so its theoreticaly possible just extreemly dificult. ok at least we have gone from been completley imposible to slim chance lol
  Reply With Quote
12-01-08, 05:39 AM   #10
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
As mentioned above your best bet is to use addons that can save profiles that can be changed in game. I had looked for a while for a mod that would enable me to change all the profiles in predetermined addons so i could set up a raid ui and a questing UI on the fly.

Wasnt able to locate one so i just settled for using profiles and made sure to name all the settings for specific ones the same so it was a pretty fast change. Its the only solution ive found to date.
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote
12-01-08, 07:44 AM   #11
Psoewish
A Scalebane Royal Guard
 
Psoewish's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 447
Originally Posted by MidgetMage55 View Post
As mentioned above your best bet is to use addons that can save profiles that can be changed in game. I had looked for a while for a mod that would enable me to change all the profiles in predetermined addons so i could set up a raid ui and a questing UI on the fly.

Wasnt able to locate one so i just settled for using profiles and made sure to name all the settings for specific ones the same so it was a pretty fast change. Its the only solution ive found to date.
And to top it off, you can make a macro that changes the profiles of all the addons that need a switch, and put them on a autohiding actionbar for efficient switching.
  Reply With Quote
12-01-08, 02:35 PM   #12
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
So running a stored script and / or using call handlers wouldn't work? I think Psoewish might have a decent idea along those lines, but I don't know if I'd like them being on a bar. After hanging around this site for so long, one thing I like to think is true that I've seen... if you can describe something in enough detail in words on paper... you can make it into an addon (with enough knowledge).
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Addon for replacing/overwriting WTF files?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off