1 -- In this file we define functions that serves for guild windows (info, inv, forum ...)
3 -- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4 -- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
6 -- This file is not used !!! It can be plugged easily but to avoid test we do not plug it !
7 -- When plugged : do not forget to set dynamic_display_size="true" to guild_members container
9 -- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
10 -- WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
13 ------------------------------------------------------------------------------------------------------------
14 -- create the game namespace without reseting if already created in an other file.
19 ------------------------------------------------------------------------------------------------------------
21 function game
:guildIsPresent()
23 local name
= getDbProp('SERVER:GUILD:NAME');
31 ------------------------------------------------------------------------------------------------------------
32 -- called when something change (new player etc...)
33 function game
:guildBuildInterface()
36 -- sort the members in Guild Manager
39 -- update interface with data of Guild Manager
41 -- freeze / unfreeze quit button
42 local uiQuitButton
= getUI('ui:interface:guild:content:quit_guild');
43 uiQuitButton
.frozen
= isGuildQuitAvailable();
46 local nbMember
= getNbGuildMembers();
47 local uiTextCnt
= getUI('ui:interface:guild:content:member_count');
48 uiTextCnt
.hardtext
= nbMember
;
50 -- fill with guild icon : automatically done at draw time of the ctrl sheet
52 -- fill with guild members
53 local sMemberList
= 'ui:interface:guild_members:content';
54 local uiMemberList
= getUI(sMemberList
);
56 for i
= 0,(nbMember
-1) do
58 local sTemplateId
= 'm' .. i
;
59 local uiMember
= createGroupInstance('member_template', sMemberList
, { id
= sTemplateId
});
60 if (uiMember
~= nil) then
61 uiMember
.name
.hardtext
= getGuildMemberName(i
);
62 local memberGrade
= getGuildMemberGrade(i
);
63 if (memberGrade
== 'Leader') then
64 uiMember
.grade
.uc_hardtext
= i18n
.get('uiGuildLeader');
65 elseif (memberGrade
== 'HighOfficer') then
66 uiMember
.grade
.uc_hardtext
= i18n
.get('uiGuildHighOfficer');
67 elseif (memberGrade
== 'Officer') then
68 uiMember
.grade
.uc_hardtext
= i18n
.get('uiGuildOfficer');
70 uiMember
.grade
.uc_hardtext
= i18n
.get('uiGuildMember');
72 uiMemberList
:addChild(uiMember
);
78 ------------------------------------------------------------------------------------------------------------
79 -- called when we open the guild main container
80 function game
:guildActive()
82 setDbProp('UI:VARIABLES:ISACTIVE:GUILD', 1);
84 game
:guildBuildInterface();
86 local ui
= getUI('ui:interface:guild');
87 if (not game
:guildIsPresent()) then
93 ------------------------------------------------------------------------------------------------------------
95 function game
:guildDeactive()
97 setDbProp('UI:VARIABLES:ISACTIVE:GUILD', 0);
101 RYZOM_GUILD_VERSION
= 324