Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
[+] New Addon: F**k Pets!
Browse files Browse the repository at this point in the history
Hides pet stats and disables the annoying pet ring-menu. No more pets getting in the way of talking to NPCs or accidentally opening their menu in the middle of a fight! Fuck pets!
  • Loading branch information
TehSeph committed May 19, 2016
1 parent ee42124 commit 1eaf866
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
55 changes: 55 additions & 0 deletions addons/fkpets.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
function FKPETS.fkMenus(actor, isOn)
return; -- Do nothing
end

function FKPETS.fkStats(frame, handle)

_G["UPDATE_COMPANION_TITLE_OLD"](frame, handle);

local frame = tolua.cast(frame, "ui::CObject");

local StGauge = GET_CHILD_RECURSIVELY(frame, "StGauge");
local HpGauge = GET_CHILD_RECURSIVELY(frame, "HpGauge");
local pcinfo_bg_L = GET_CHILD_RECURSIVELY(frame, "pcinfo_bg_L");
local pcinfo_bg_R = GET_CHILD_RECURSIVELY(frame, "pcinfo_bg_R");

StGauge:ShowWindow(0);
HpGauge:ShowWindow(0);
pcinfo_bg_L:ShowWindow(0);
pcinfo_bg_R:ShowWindow(0);

frame:Invalidate()

end

function FKPETS.setHooks(newFunction, oldFunction)
-- This is the SET_HOOK function directly from Excrulon's utility.lua

local storedFunction = oldFunction .. "_OLD";

if _G[storedFunction] == nil then
_G[storedFunction] = _G[oldFunction];
_G[oldFunction] = newFunction;
else
_G[oldFunction] = newFunction;
end

end

function FKPETS.init()

if (FKPETS.isLoaded ~= true) then

FKPETS.setHooks(FKPETS.fkMenus, "DIALOG_COMPANION");
FKPETS.setHooks(FKPETS.fkStats, "UPDATE_COMPANION_TITLE");

FKPETS.frame:ShowWindow(1);
FKPETS.isLoaded = true;

ui.SysMsg("[ADDON] F**k Pets loaded!");

end

end

FKPETS.init();
13 changes: 13 additions & 0 deletions data/fkpets.ipf/addon_d.ipf/fkpets/fkpets.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if _G["ADDONS"] == nil then _G["ADDONS"] = {}; end

_G["ADDONS"]["FKPETS"] = {};
FKPETS = _G["ADDONS"]["FKPETS"];

function FKPETS_ON_INIT(addon, frame)

FKPETS.addon = addon;
FKPETS.frame = frame;

dofile("../addons/fkpets.lua");

end
13 changes: 13 additions & 0 deletions data/fkpets.ipf/addon_d.ipf/fkpets/fkpets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<uiframe name="fkpets" x="420" y="30" width="280" height="100" create="open">
<frame title="Reload Addon" snapclient="true" snapframe="true" layout_gravity="top left" margin="420 30 0 0"/>
<option visible="true" closebutton="false" useimageitem="true" piptype="right" autoopen="true" hideable="false"/>
<input hittestframe="true"/>
<layer layerlevel="31"/>
<draw blend="100" drawtitlebar="false" drawframe="false"/>
<controls>
<button name="open_changejobui" rect="0 0 240 80" margin="0 0 0 0" layout_gravity="center center" MouseOffAnim="btn_mouseoff" MouseOnAnim="btn_mouseover" caption="{@st43}Reload Addon" clicksound="button_click_3" oversound="button_cursor_over_2" skin="btn_lv3" LBtnDownScp="dofile(&apos;..\\addons\\fkpets.lua&apos;);">
<uieffect effect="I_screen_button" scale="63" overlab="No" sound="None" offset="0 0" playtime="1" duration="1" conditon="active" event="LBUTTONDOWN"/>
</button>
</controls>
</uiframe>

0 comments on commit 1eaf866

Please sign in to comment.