vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | path: /PetFeeder/ |
||
3 | filename: PetFeeder_FoodsFrame.lua |
||
4 | author: Jeff Parker <jeff3parker@gmail.com> |
||
5 | created: Tue, 22 Jan 2005 14:15:00 -0800 |
||
6 | updated: Tue, 22 Jan 2005 21:39:00 -0800 |
||
7 | |||
8 | Pet Feeder: a GUI interface allowing you configure happiness level for your pet & |
||
9 | drag/drop foods you wish your pet to eat. When the pet happiness drops below |
||
10 | the selected threshold will automatically feed your pet. |
||
11 | To remove a food from the list, simply click on it. |
||
12 | ]] |
||
13 | |||
14 | --[[ |
||
15 | ============================================================================= |
||
16 | Called when we want to display a list of foods |
||
17 | ============================================================================= |
||
18 | ]] |
||
19 | function PetFeeder_FoodsFrame_OnReceiveDrag() |
||
20 | PetFeeder_DroptheItem( "foods",PETFEEDER_FL_UNKNOWN ); |
||
21 | PetFeeder_Update_Frames(); |
||
22 | end |
||
23 | |||
24 | function PetFeeder_FoodsFrame_OnShow() |
||
25 | if ( PeetFeederPlayer_Config.Level ) then |
||
26 | UIDropDownMenu_SetSelectedID(PetFeederFrameDropDown, PeetFeederPlayer_Config.Level, PETFEEDER_LEVELS_DROPDOWN); |
||
27 | UIDropDownMenu_SetText(PETFEEDER_LEVELS_DROPDOWN[PeetFeederPlayer_Config.Level].name, PetFeederFrameDropDown); |
||
28 | end |
||
29 | PetFeeder_Update_Frames(); |
||
30 | end |
||
31 | |||
32 | |||
33 | --[[ |
||
34 | ============================================================================= |
||
35 | Called when we want to display a list of foods |
||
36 | ============================================================================= |
||
37 | ]] |
||
38 | |||
39 | function PetFeeder_FoodsFrame_Update() |
||
40 | PetFeeder_FoodsFrame_UpdateExt(PETFEEDER_FL_UNKNOWN) |
||
41 | end |
||
42 | |||
43 | --[[ |
||
44 | ============================================================================= |
||
45 | Called when Clear Foods button is clicked |
||
46 | ============================================================================= |
||
47 | ]] |
||
48 | |||
49 | function PetFeeder_FoodsFrameClearFoodsButton_Update() |
||
50 | PetFeeder_ClearFoods(PETFEEDER_FL_UNKNOWN); |
||
51 | end |
||
52 | |||
53 | |||
54 | |||
55 | --[[ |
||
56 | ============================================================================= |
||
57 | Called when Clear Foods button is clicked |
||
58 | ============================================================================= |
||
59 | ]] |
||
60 | |||
61 | function PetFeeder_FoodsFrameUpdateFoodsButton_Update() |
||
62 | if not ( UnitExists("pet") ) then |
||
63 | UIErrorsFrame:AddMessage(PETFEEDER_NEED_PET, 0.8, 0, 0, 1.0, UIERRORS_HOLD_TIME); |
||
64 | return; |
||
65 | end |
||
66 | PetFeeder_PetName = UnitName( "pet" ); |
||
67 | PetFeeder_PopulateFoods(); |
||
68 | PetFeeder_Update_Frames(); |
||
69 | end |
||
70 | |||
71 | --[[ |
||
72 | ============================================================================= |
||
73 | Called when the button item is clicked |
||
74 | ============================================================================= |
||
75 | ]] |
||
76 | |||
77 | function PetFeeder_FoodsFrameItemButton_OnClick(button,name) |
||
78 | if ( button == "LeftButton" ) then |
||
79 | PetFeeder_ApproveFoodItem(name); |
||
80 | end |
||
81 | end |
||
82 | |||
83 | |||
84 |