插件的内存补丁
有些时候插件的原始行为不能让人满意
当然 那完全可以修改原作的代码 对插件进行个性改造
这是最简单也是最有效的办法
但是 如果一旦原作发生改变 那么问题就麻烦起来
你又得重新修改 如果用svn的话 会自动合并 但是这也不能算一个好办法
现在介绍个神奇的一不变应万变的方法 来应对这个问题
[color=Lime]例子 Skinner 不能skin FriendMenuXP[/color]
FriendMenuXP是个伟大的作品
但是与skinner不和谐
我曾经写过这么一个方法来解决这个问题
[url=http://bbs.cwowaddon.com/thread-738-1-1.html]http://bbs.cwowaddon.com/thread-738-1-1.html[/url]
但是这个办法不是很合适 因为skinner的老大 并不知道我国还有这么一个优秀的作品
所以根本不鸟你
如果每次更新都手工添加的话 那就要疯掉了
所以设想编个插件 在wow载入的时候
修改我们预定的插件达到目的
http://www.wowwiki.com/Events_that_fire_during_the_Loading_Process
[quote] Character Login [list=1][*] [url=http://www.wowwiki.com/Events_A-B_%28ActionBar%2C_Auction%2C_AutoEquip%2C_AutoFollow%2C_Bag%2C_BankFrame%2C_BattleFields%2C_Billing%29#ADDON_LOADED##NQQBA_YBNQRQ]ADDON_LOADED[/url][list][*] This event fires whenever an AddOn has finished loading andthe SavedVariables for that AddOn have been loaded from their file.[/list][*] [url=http://www.wowwiki.com/Events_V-Z_%28Variables%2C_Who%2C_World%2C_Zone%29#VARIABLES_LOADED##INEVNOYRF_YBNQRQ]VARIABLES_LOADED[/url][list][*] This event fires when all AddOns that will be loaded duringthe initial loading sequence (ie. all AddOns that will not be loadedOnDemand) have had their related [url=http://www.wowwiki.com/Events_A-B_%28ActionBar%2C_Auction%2C_AutoEquip%2C_AutoFollow%2C_Bag%2C_BankFrame%2C_BattleFields%2C_Billing%29#ADDON_LOADED##NQQBA_YBNQRQ]ADDON_LOADED[/url] event fire.[/list][*] [url=http://www.wowwiki.com/Events_S_%28Screenshot%2C_Select%2C_Send%2C_Show%2C_Skill%2C_SpellsCast%2C_Spell%2C_Stop%2C_Suggest%2C_Sysmsg%29#SPELLS_CHANGED##FCRYYF_PUNATRQ]SPELLS_CHANGED[/url][list][*] This event fires shortly before the [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_LOGIN##CYNLRE_YBTVA]PLAYER_LOGIN[/url] event and signals that information on the user's spells has been loaded and is available to the UI.[/list][*] [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_LOGIN##CYNLRE_YBTVA]PLAYER_LOGIN[/url][list][*] This event fires immediately before [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url].[*] Most information about the game world should now be available to the UI.[*] All Sizing and Positioning of frames is supposed to be completed before this event fires.[*] AddOns that want to do one-time initialization proceduresonce the player has "entered the world" should use this event insteadof [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url].[/list][*] [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url][list][*] This event fires immediately after [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_LOGIN##CYNLRE_YBTVA]PLAYER_LOGIN[/url][*] Most information about the game world should now be available to the UI[*] All Sizing and Positioning of frames is supposed to be completed before this event fires.[*] This event also fires whenever the player enters/leaves an instance and generally whenever the player sees a loading screen[/list][*] [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ALIVE##CYNLRE_NYVIR]PLAYER_ALIVE[/url][list][*] This event fires after [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url][*] Talent information should now be available to the UI[/list][/list] User Interface Reload [list=1][*] [url=http://www.wowwiki.com/Events_A-B_%28ActionBar%2C_Auction%2C_AutoEquip%2C_AutoFollow%2C_Bag%2C_BankFrame%2C_BattleFields%2C_Billing%29#ADDON_LOADED##NQQBA_YBNQRQ]ADDON_LOADED[/url][list][*] This event fires whenever an AddOn has finished loading andthe SavedVariables for that AddOn have been loaded from their file.[/list][*] [url=http://www.wowwiki.com/Events_V-Z_%28Variables%2C_Who%2C_World%2C_Zone%29#VARIABLES_LOADED##INEVNOYRF_YBNQRQ]VARIABLES_LOADED[/url][list][*] This event fires when all AddOns that will be loaded duringthe initial loading sequence (ie. all AddOns that will not be loadedOnDemand) have had their related [url=http://www.wowwiki.com/Events_A-B_%28ActionBar%2C_Auction%2C_AutoEquip%2C_AutoFollow%2C_Bag%2C_BankFrame%2C_BattleFields%2C_Billing%29#ADDON_LOADED##NQQBA_YBNQRQ]ADDON_LOADED[/url] event fire.[/list][*] [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_LOGIN##CYNLRE_YBTVA]PLAYER_LOGIN[/url][list][*] This event fires immediately before [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url][*] Most information about the game world should now be available to the UI[*] All Sizing and Positioning of frames is supposed to be completed before this event fires.[*] AddOns that want to do one-time initialization proceduresonce the player has "entered the world" should use this event insteadof [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url][/list][*] [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_ENTERING_WORLD##CYNLRE_RAGREVAT_JBEYQ]PLAYER_ENTERING_WORLD[/url][list][*] This event fires immediately after [url=http://www.wowwiki.com/Events_P_%28Party%2C_Petition%2C_Pet%2C_PlayerBank%2C_Player%29#PLAYER_LOGIN##CYNLRE_YBTVA]PLAYER_LOGIN[/url][*] Most information about the game world should now be available to the UI[*] All Sizing and Positioning of frames is supposed to be completed before this event fires.[/list][/list][/quote]
这样看来PLAYER_ENTERING_WORLD 的时候是最好的时候
应为这个时候插件基本上都已经把变量装到内存里变了
[code]
function Skinner_Patch()
FriendsMenuXPBackdrop:Hide()
FriendsMenuXPMenuBackdrop:Hide()
FriendsMenuXPSecureBackdrop:Hide()
FriendsMenuXPSecureMenuBackdrop:Hide()
Skinner:applySkin(FriendsMenuXP)
Skinner:applySkin(FriendsMenuXPSecure)
end
function MyPatcher_OnLoad(...)
Skinner_Patch()
--....更多的你的Patch
end
f=CreateFrame("Frame", nil)
f:SetScript("OnEvent",MyPatcher_OnLoad)
f:RegisterEvent("PLAYER_LOGIN")[/code]
这样不管怎么skinner更新你的friendmenuxp都会合skinner保持格调一致了 好想法哦 对于插件的非local 函数也可以这样外挂式patch
页:
[1]