05-27-05, 10:40 AM | #21 |
If you are willing to release your source code for us to check, we're always more than willing to host things that are of benefit to the modding community. We have a "general" policy against .exe .vbs, etc in regular mods, but even there, if the author is willing to provide us with their code, we will consider making exceptions to the general rule. Something like this, there is no question of whether we'd allow it, given the stipulation about letting us check your code.
It isn't that we figure most folks would do anything malicious, but the unfortunate reality is that some do. That's why the "general" policy is in place. It's protection for the users of the site, protection for you the mod authors, as we can prove beyond doubt that any thing that goes wrong (virus, key logger, even something like undocumented "easter eggs") with someone computer is not the fault of your mod, and it's protection for ourselves, same idea. And the other reality is that most end-users see a .exe and almost auto-assume that there is going to be a virus or some such and just refuse to use it (which is actually the better choice in most cases). We like to be able to definitely verify for ourselves that anything available from our sites are "clean", and folks know that from having used our sister sites for years, so folks trust that anything coming from here is clean. Trust you can understand that. Having a "Developers' Tools" section is something we've considered before, there just hasn't been a call for it on our site as of yet. We certainly have no objection to adding one. (And yeah, obviously it won't be me checking the code. ) /edit I also want to, personally, say thank you to all of you for the time you are taking to try to help me get my head around this stuff. It is appreciated, I am still reading it, I just have some other things at the moment that are taking up my time and attention (sick daughter, to be exact), so I'm not actually able to start trying to work my way through the info you are providing. I just wanted to add that, so you knew that my lack of responses to the thread all of a sudden wasn't lack of interest or some such. I just don't have the time right now to try practical application. I'll definitely start spamming you guys again though, when I do. Last edited by Cairenn : 05-27-05 at 11:01 AM. |
|
05-27-05, 12:08 PM | #22 |
It isn't an exe, but it does auto-run on clicking of the mxp, so I see your points. Virus spread because people aren't careful of what they click on...
Anyway, I have uploaded a new verison of the zip with a directory called "source" which is a complete snapshot of what the MXP file contains. The file structure of the zip is below, and the files therein are the oens that are used to define the code structures. [LuaScript.zip] LuaScript.mxp readme.txt source/default.lua source/LuaColoring.xml source/LuaColors.xml source/LuaDocumentType.xml source/LuaScript.mxi Hope this helps! I also took the liberty of adding the code changes as they have been reported in the upcoming patch. So this syntax highlighting plugin is up to date with 1.5.0 (unless they sneak in some more last minute functions and stuff that I don't know about yet) http://0ctavius.com/site/download.php?id=2 Last edited by Beladona : 05-27-05 at 12:20 PM. |
|
05-27-05, 12:10 PM | #23 | |||
To quote the person who would be checking the code:
|
||||
05-27-05, 12:21 PM | #24 |
YAY! I think I love you! I will update this thread with more info once I can get it uploaded.
I am having some kind of issue though, as I cannot upload to that category. There isn't a button to upload like there is in the other categories... Will upload as soon as that becomes available... Last edited by Beladona : 05-27-05 at 12:45 PM. |
|
05-27-05, 05:49 PM | #25 |
Crud, I'm sorry, I was trying to get the forum available and your app cleared in a rush while waiting for my daughter to get dressed so I could take her to the hospital. Just got back in now and saw this. In my hurry I had a permission set incorrectly. You should be able to upload with no problem now. Sorry about that. =/
|
|
05-27-05, 07:49 PM | #26 |
no problem. I uploaded it, awaiting approval. Support thread is here:
http://www.wowinterface.com/forums/showthread.php?t=801 One thing I noticed however, I cannot upload updates to the file, or edit it. I do plan to release updated version of it soon that includes code hints, and lua within xml support, so that feature would be useful... Last edited by Beladona : 05-28-05 at 08:57 AM. |
|
05-28-05, 02:09 PM | #27 | |
Sorry, I stumbled onto this thread a bit late I'm afraid.
This quote piqued my interest:
Beladona, could you elaborate at all on what the pitfalls might be associated with utilizing the SetTexture function in an AddOn? As I said, me no speaka da lua so good, but that -seeemed- from my limited knowledge to be a fairly slick little function, depending on the application. What am I missing? |
||
05-28-05, 02:21 PM | #28 | |
*feels like a complete dope* Last edited by Cairenn : 05-28-05 at 02:46 PM. |
||
05-28-05, 03:18 PM | #29 |
sure thing! the SetTexture("texturepath"); function is pretty useful, in that you can change the texture associated with a texture object at will. This is most notable seen in modifications that allow toggle buttons. When you hit the button, and thereby "toggle" it on, or off, the texture can be set to change based on what that value is. I don't have time to go into the specifics right now, but I might be willing to start some discussion threads on it regarding the uses of it.
Basically if you have a texture called "MyTexture" you would do this: MyTexture:SetTexture("Interface\\AddOns\\myAddon\\mytexture01.tga"); (as someone mentioned earlier, you can leave out the .tga here, as the engine sees the graphics file without the trailing file type, however I prefer to use the extension, for practicality sake, as well as the fact I have seen it not work a couple times...) With some coding, you could do something like this: Code:
function onToggle() if (myToggle) then myToggle = false; myTexture:SetTexture("Interface\\AddOns\\myAddon\\ToggleOff.tga"); -- do whatever the toggle is meant to "toggle" off else myToggle = true; myTexture:SetTexture("Interface\\AddOns\myAddon\ToggleOn.tga"); -- do whatever the toggle is meant to "toggle" on end end MyTexture:SetTexCoord(minX, maxX, minY, maxY); so for people like Cairenn who was discussing having a single file with multiple elements, you can leave the texture as is, and just change the Texture Coordinates... |
|
05-28-05, 05:20 PM | #30 |
Aha!
I read the above quote as you saying that you avoided modifying the default textures, partidularly by way of using the SetTexture function. Basically, the complete opposite of what you had actually said. Nevermind me, and thank you for the clarification. While we're at it, would you mind tossing in an event (properly scripted) for the above (myToggle) to fire from. Say for example, I wanted to alter the target frame on gaining a particular target, a mob vs. a player, friendly vs. hostile, or something to that effect. I think I'm seeing a glimmer of clarity peeking through here, I want to keep the irons in the fire while the fire is hot, if you don't mind indulging me. edit: I think you may have done this already earlier in the thread. I'm going back now to read back through, and see if I can't sort that out. Sorry bout that. (PS: Your TextCoord explanation earlier in this thread was golden. I come from DAoC, which I believe was similar to EQ in terms of UI modification scope. TextCoor's had me totally bamboozled. Not any longer! I will have to play around with that more. Thank you!) Last edited by diiverr : 05-28-05 at 05:25 PM. |
|
05-28-05, 06:44 PM | #31 |
OK, in an effort to get around the pesky un-named texture dilemma, I decided to pursue the earlier castbar example.
Sorry for the eyesores, but here is the code of my reconstruction of the castbar: Lua: Code:
CASTING_BAR_ALPHA_STEP = 0.05; CASTING_BAR_FLASH_STEP = 0.2; CASTING_BAR_HOLD_TIME = 1; function DS_CastingBarFrame_OnLoad() this:RegisterEvent("SPELLCAST_START"); this:RegisterEvent("SPELLCAST_STOP"); this:RegisterEvent("SPELLCAST_FAILED"); this:RegisterEvent("SPELLCAST_INTERRUPTED"); this:RegisterEvent("SPELLCAST_DELAYED"); this:RegisterEvent("SPELLCAST_CHANNEL_START"); this:RegisterEvent("SPELLCAST_CHANNEL_UPDATE"); this.casting = nil; this.holdTime = 0; CastingBarFrame_OnEvent = DS_CastingBarFrame_OnEvent CastingBarFrame_OnUpdate = DS_CastingBarFrame_OnUpdate --tried just using CastingBarFrame:Hide(); below too. that didn't work either if DS_CastingBarFrame:IsVisible() then CastingBarFrame:Hide(); end end function DS_CastingBarFrame_OnEvent() if ( event == "SPELLCAST_START" ) then DS_CastingBarFrameStatusBar:SetStatusBarColor(1.0, 0.7, 0.0); DS_CastingBarSpark:Show(); this.startTime = GetTime(); this.maxValue = this.startTime + (arg2 / 1000); DS_CastingBarFrameStatusBar:SetMinMaxValues(this.startTime, this.maxValue); DS_CastingBarFrameStatusBar:SetValue(this.startTime); DS_CastingBarText:SetText(arg1); this:SetAlpha(1.0); this.DS_holdTime = 0; this.DS_casting = 1; this.fadeOut = nil; this:Show(); this.mode = "DS_casting"; elseif ( event == "SPELLCAST_STOP" ) then if ( not this:IsVisible() ) then this:Hide(); end if ( this:IsShown() ) then DS_CastingBarFrameStatusBar:SetValue(this.maxValue); DS_CastingBarFrameStatusBar:SetStatusBarColor(0.0, 1.0, 0.0); DS_CastingBarSpark:Hide(); DS_CastingBarFlash:SetAlpha(0.0); DS_CastingBarFlash:Show(); this.DS_casting = nil; this.flash = 1; this.fadeOut = 1; this.mode = "flash"; end elseif ( event == "SPELLCAST_FAILED" or event == "SPELLCAST_INTERRUPTED" ) then if ( this:IsShown() ) then DS_CastingBarFrameStatusBar:SetValue(this.maxValue); DS_CastingBarFrameStatusBar:SetStatusBarColor(1.0, 0.0, 0.0); DS_CastingBarSpark:Hide(); if ( event == "SPELLCAST_FAILED" ) then DS_CastingBarText:SetText(FAILED); else DS_CastingBarText:SetText(INTERRUPTED); end this.DS_casting = nil; this.fadeOut = 1; this.DS_holdTime = GetTime() + CASTING_BAR_HOLD_TIME; end elseif ( event == "SPELLCAST_DELAYED" ) then if( this:IsShown() ) then this.startTime = this.startTime + (arg1 / 1000); this.maxValue = this.maxValue + (arg1 / 1000); DS_CastingBarFrameStatusBar:SetMinMaxValues(this.startTime, this.maxValue); end elseif ( event == "SPELLCAST_CHANNEL_START" ) then DS_CastingBarFrameStatusBar:SetStatusBarColor(1.0, 0.7, 0.0); DS_CastingBarSpark:Show(); this.maxValue = 1; this.startTime = GetTime(); this.endTime = this.startTime + (arg1 / 1000); this.duration = arg1 / 1000; DS_CastingBarFrameStatusBar:SetMinMaxValues(this.startTime, this.endTime); DS_CastingBarFrameStatusBar:SetValue(this.endTime); DS_CastingBarText:SetText(arg2); this:SetAlpha(1.0); this.DS_holdTime = 0; this.DS_casting = nil; this.channeling = 1; this.fadeOut = nil; this:Show(); elseif ( event == "SPELLCAST_CHANNEL_UPDATE" ) then if ( arg1 == 0 ) then this.channeling = nil; elseif ( this:IsShown() ) then local origDuration = this.endTime - this.startTime this.endTime = GetTime() + (arg1 / 1000) this.startTime = this.endTime - origDuration --this.endTime = this.startTime + (arg1 / 1000); DS_CastingBarFrameStatusBar:SetMinMaxValues(this.startTime, this.endTime); end end end function DS_CastingBarFrame_OnUpdate() if ( this.DS_casting ) then local status = GetTime(); if ( status > this.maxValue ) then status = this.maxValue end DS_CastingBarFrameStatusBar:SetValue(status); DS_CastingBarFlash:Hide(); local sparkPosition = ((status - this.startTime) / (this.maxValue - this.startTime)) * 195; if ( sparkPosition < 0 ) then sparkPosition = 0; end DS_CastingBarSpark:SetPoint("CENTER", "DS_CastingBarFrameStatusBar", "LEFT", sparkPosition, 0); elseif ( this.channeling ) then local time = GetTime(); if ( time > this.endTime ) then time = this.endTime end if ( time == this.endTime ) then this.channeling = nil; this.fadeOut = 1; return; end local barValue = this.startTime + (this.endTime - time); DS_CastingBarFrameStatusBar:SetValue( barValue ); DS_CastingBarFlash:Hide(); local sparkPosition = ((barValue - this.startTime) / (this.endTime - this.startTime)) * 195; DS_CastingBarSpark:SetPoint("CENTER", "DS_CastingBarFrameStatusBar", "LEFT", sparkPosition, 0); elseif ( GetTime() < this.DS_holdTime ) then return; elseif ( this.flash ) then local alpha = DS_CastingBarFlash:GetAlpha() + CASTING_BAR_FLASH_STEP; if ( alpha < 1 ) then DS_CastingBarFlash:SetAlpha(alpha); else this.flash = nil; end elseif ( this.fadeOut ) then local alpha = this:GetAlpha() - CASTING_BAR_ALPHA_STEP; if ( alpha > 0 ) then this:SetAlpha(alpha); else this.fadeOut = nil; this:Hide(); end end end function DS_CastingBarFrame_UpdatePosition() local castingBarPosition = 60; if ( PetActionBarFrame:IsVisible() or ShapeshiftBarFrame:IsVisible() ) then castingBarPosition = castingBarPosition + 40; end if ( MultiBarBottomLeft:IsVisible() ) then castingBarPosition = castingBarPosition + 40; end DS_CastingBarFrame:SetPoint("BOTTOM", "UIParent", "BOTTOM", 0, castingBarPosition); end Code:
<Frame name="DS_CastingBarFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hidden="true"> <Size> <AbsDimension x="206" y="26"/> </Size> <Anchors> <Anchor point="BOTTOM"> <Offset> <AbsDimension x="0" y="60"/> </Offset> </Anchor> </Anchors> <Layers> <Layer level="BACKGROUND"> <Texture> <Size> <AbsDimension x="195" y="13"/> </Size> <Anchors> <Anchor point="TOP"> <Offset> <AbsDimension x="0" y="-2"/> </Offset> </Anchor> </Anchors> <Color r="0" g="0" b="0" a="0.5"/> </Texture> </Layer> <Layer level="OVERLAY"> <FontString name="DS_CastingBarText" inherits="GameFontHighlight"> <Size> <AbsDimension x="185" y="16"/> </Size> <Anchors> <Anchor point="TOP"> <Offset> <AbsDimension x="0" y="0"/> </Offset> </Anchor> </Anchors> </FontString> <Texture file="Interface\AddOns\DiivSkins\Skins\castingbar"> <Size> <AbsDimension x="256" y="64"/> </Size> <Anchors> <Anchor point="TOP"> <Offset> <AbsDimension x="0" y="25"/> </Offset> </Anchor> </Anchors> </Texture> </Layer> </Layers> <Frames> <Frame name="DS_CastingBarFlash" hidden="true"> <Size> <AbsDimension x="256" y="64"/> </Size> <Anchors> <Anchor point="CENTER"> <Offset> <AbsDimension x="0" y="4"/> </Offset> </Anchor> </Anchors> <Layers> <Layer level="BACKGROUND"> <Texture file="Interface\AddOns\DiivSkins\Skins\castingbarflash" alphaMode="ADD"> <Size> <AbsDimension x="256" y="64"/> </Size> </Texture> </Layer> </Layers> </Frame> <StatusBar name="DS_CastingBarFrameStatusBar"> <Size> <AbsDimension x="195" y="13"/> </Size> <Anchors> <Anchor point="TOP"> <Offset> <AbsDimension x="0" y="-2"/> </Offset> </Anchor> </Anchors> <Layers> <Layer level="OVERLAY"> <Texture name="DS_CastingBarSpark" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD"> <Size> <AbsDimension x="32" y="32"/> </Size> <Anchors> <Anchor point="CENTER"> <Offset> <AbsDimension x="0" y="0"/> </Offset> </Anchor> </Anchors> </Texture> </Layer> </Layers> <Scripts> <OnLoad> this:SetFrameLevel(this:GetFrameLevel() - 1) </OnLoad> </Scripts> <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/> <BarColor r="1.0" g="0.7" b="0.0"/> </StatusBar> </Frames> <Scripts> <OnLoad> DS_CastingBarFrame_OnLoad(); </OnLoad> <OnEvent> DS_CastingBarFrame_OnEvent(); </OnEvent> <OnUpdate> DS_CastingBarFrame_OnUpdate(); </OnUpdate> </Scripts> </Frame> Within an AddOn, the above perfectly duplicates the casting bar. However, I can't get the vestiges of the old one to dissappear. It no longer functions, it just sits there, full, with not text, and no "flash" animations, and the "spark" just hanging out dead center. It does still exhibit the behavior of only being present while casting, however. I noted what I tried in the onload function of the lua to get it to hide, but niether of those worked. Oddly enough, the original casting bar would hide and remain hidden using MoveAnything!, but once I reset the MoveAnything! frame, it went back to ghosting my new casting bar. Here's an image of what I get. Note the functioning "flash" in the inset: (don't laugh at the graphics, I just tossed those together quick) : http://img.photobucket.com/albums/v5...stbarsnafu.jpg So... What am I missing? I'm not dying to change the castbar graphics, insomuch as I am dying to find out what I am doing wrong. Last edited by diiverr : 05-30-05 at 02:28 PM. |
|
05-29-05, 01:14 PM | #32 |
try moving CastingBarFrame:Hide(); to your OnUpdate function. It will get fired quite often, and whenever your new casting bar gets updated, so no matter what your old castingbar is doing it will get hidden (or should)
I may try to play with it later. The image you have below? Is that a custom menubar you made, alone with the other graphics? Or is it a mod that already exists? It looks interesting... EDIT: Scratch that, I looked up your released AddOns and saw it, so disregard =P Last edited by Beladona : 05-29-05 at 01:17 PM. |
|
05-29-05, 02:20 PM | #33 |
Bingo!
Thank you Beladona. plopping the hide in the update function, like so, did the trick: Code:
function DS_CastingBarFrame_OnUpdate() CastingBarFrame:Hide(); if ( this.DS_casting ) then yada yada yada.... |
|
05-30-05, 02:27 PM | #34 |
Wheeeeee!
Fiddled some more, using all of the tips put forth in this thread, and wrangled the MiniMap around. Here's a shot of my "new" MiniMap, toggled open and closed: Hovering over the Dragon's head gives you zone info in the tooltip ... (this was an "accidental" feature I ran with): Here's a shot with Tracking/Mail/etc. notification icons displayed: Sorry, trivial I know, but I just wanted to thank you Beladona and everyone else for taking the time to hand-hold some of us newer folks. I know I for one, really appreciate it. I still have a few issues with what I did, namely, getting the original map to hide (again), and getting my map to play nice with other AddOns that want to play with the minimap. I also have my suspicions that the ping, while functioning on my map, may not work right for other people in my group as intended. Time to go outside though now. Challenges for another day. :-) PS: Images include use of smilies, the vB code [img] tag and HTML <img> tags. The use of these is all subject to them being enabled by the administrator. ... I take the limit is four? No emoticons for me! ;-) Last edited by diiverr : 05-30-05 at 03:20 PM. |
|
05-30-05, 02:35 PM | #35 |
Diiver, that looks fantastic! Don't even think about apologizing for it being "trivial", it most assuredly isn't.
This is the other side of UI modding that many folks are still searching for, the graphical changes. A UI can look completely different, just by changing graphics, yet still actually be exactly the same, layout and functionality-wise. I, for one, am very glad to see folks beginning to get into the graphical modding of the UI. That's the area I work with by preference (if I can ever get my head around it all). Now that (more) folks are actually using this area of the forums, (and so far, everyone is being incredibly patient in trying to help others, as we always hope for and expect on our forums), I expect we'll see more and more of this type of modding. It's going to be fun! (PS, I'll look into the whole smilie thing.) |
|
05-30-05, 03:42 PM | #36 |
Good work! I love seeing people take the initiative to design original changes to the ui. No Change is a useless change, as there is always someone that finds it useful or fun.
I enjoy providing what little I know about LUA, XML, and WoW AddOns to anyone that needs or wants my advice. I kind of get pleasure out of helping people in even small ways. So feel free to bounce ideas or questions off me at any time, as that is what I am here for... |
|
05-30-05, 08:02 PM | #37 | |
Just kidding, you rock Bel. OK, in an effort to remedy a problem I'll detail later, I expanded (experimented?) on your earlier "impolite" way to alter my lua. I now have the following for an <OnLoad>: Code:
function DS_Minimap_OnLoad() DS_MiniMapPing.fadeOut = nil; this:SetSequence(0); this:RegisterEvent("MINIMAP_PING"); this:RegisterEvent("MINIMAP_UPDATE_ZOOM"); Minimap_OnLoad = DS_Minimap_OnLoad Minimap_OnEvent = DS_Minimap_OnEvent Minimap_OnUpdate = DS_Minimap_OnUpdate Minimap_Update = DS_Minimap_Update Minimap_SetPing = DS_Minimap_SetPing MiniMapPing_FadeOut = DS_MiniMapPing_FadeOut Minimap_ZoomInClick = DS_Minimap_ZoomInClick Minimap_ZoomOutClick = DS_Minimap_ZoomOutClick Minimap_OnClick = DS_Minimap_OnClick Minimap_ZoomIn = DS_Minimap_ZoomIn Minimap_ZoomOut = DS_Minimap_ZoomOut MinimapCluster:Hide(); end OK, by now, about 95% of the "DS" minimap has been converted to hold my prefix. There are still some globals, and some stuff related mainly to the ZoneText headers that I haven't messed with, but everything relating to the minimap seems to be behaving itself as it should now... except... Other AddOns! Namely, anything that parks a button on the minimap, and <cry> Gatherer. All of that stuff still wants to (understandandably) play with the old minimap, which is of course now hidden. No errors or any other unspeakables, the other addons elements simply hide themselves with the old minimap. So, is there an "easy" way to intercept this sort of stuff from my AddOn's code so that they will display on the "new" minimap? Or a hard way even? Or am I now faced with modifying other AddOns to "support" mine? Might be a toughy, but it can't hurt to ask. |
||
05-30-05, 10:01 PM | #38 |
Now with hawter seggsier round minimize button!
(By the way, that button is kind of troublesome as a toggle. I would like to vary the "states" of the button image depending on whether the map was minimized or not, but that proved more complicated than expected, once I started trying to fool with it.) Seriously though, I see a lot of requests from the minimilast camp for this sort of thing. I would be happy to pass this off to soemone more capable if anyone is interested in finishing this "concept" off, if its even possible? (Obviously, a release would likely need to be sans-dragon for the minimilasts, at the very least, I suppose an option at best..) At this point, other than getting this AddOn to play nice with others, it works really well. It's also really simple to make the map "look" however you want it. ("BlizzardShouldHavedNamedMeAndSavedMeAllThisTrouble" was my favorite texture name in the recode. ) Honestly, giving the map and its various (default) components a sleak "tooltip" border wouldn't be too difficult either. Provided of course, that you don't mind it being round. |
|
05-31-05, 07:00 AM | #39 |
I can try helping.
On a side note, something I have not tried myself, but may be useful in the situation you are in... Every frame element or widget, etc... is given a script instance, just like functions. So in effect, remapping a function to a new function, would theoretically work with elements as well? Example: MinimapCluster = myCustomMapCluster; Provided your custom map cluster has all of the same basic code that allows POI and other stuff to work, I would think this would be ideal for you to effectively replace the default element with your own custom one. Again, I have NOT tried this, so have no idea how the UI will behave, or if it will crash out. If it DOES work, then other addons would work out of the box with yours, as their little buttons should jump onto your custom minimap simply because the MinimapCluster reference is pointing to yours... Be warned, that doing this means that anything that does MinimapCluster:Hide(); will in fact hide your minimap. So doing this means you would need to remove the code that hides the default minimap in favor of yours... Good work so far, it is looking good... Last edited by Beladona : 05-31-05 at 07:16 AM. |
|
05-31-05, 07:34 AM | #40 |
Oooo, that sounds like it might just be the ticket Beladona. Of course, servers are down at the moment, but I will definitely give that a go later this evening.
Thank you. |
|
WoWInterface » Developer Discussions » Lua/XML Help » GUI's |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|