Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit 6e87474

Browse files
committed
fix #27
1 parent f6ec533 commit 6e87474

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

iland-core.lua

+26-18
Original file line numberDiff line numberDiff line change
@@ -2657,6 +2657,7 @@ OpenGUI = {
26572657
return
26582658
end
26592659
Land.RelationShip.Owner.set(landId,targetXuid)
2660+
MEM[pl.xuid].BackToId = nil
26602661
pl:sendModalForm(
26612662
_Tr('gui.general.complete'),
26622663
_Tr('title.landtransfer.complete','<a>',Land.Options.Nickname.get(landId,3),'<b>',selected[1]),
@@ -2734,23 +2735,27 @@ ItemSelector = {
27342735
]]
27352736

27362737
local function toPages()
2737-
local rtn = {}
2738+
local pages = {}
2739+
local allpair = {}
27382740
for n,item in pairs(payload.list) do
2739-
local num = math.ceil(n/ItemSelector._perpage)
2740-
rtn[num] = rtn[num] or {}
2741-
rtn[num][#rtn[num]+1] = {n,item}
2741+
allpair[#allpair+1] = {n,item}
27422742
end
2743-
return rtn
2743+
for n,pair in pairs(allpair) do
2744+
local pn = math.ceil(n/ItemSelector._perpage)
2745+
pages[pn] = pages[pn] or {}
2746+
pages[pn][#pages[pn]+1] = pair
2747+
end
2748+
return pages,allpair
27442749
end
27452750

2751+
local pages,allpair = toPages()
27462752
local xuid = player.xuid
2747-
local pages = toPages()
27482753
MEM[xuid].isr = {
27492754
payload = payload,
27502755
runtime = {
2751-
origin = pages,
2756+
origin = allpair,
27522757
display = pages,
2753-
page = 1,
2758+
page_num = 1,
27542759
filter = ''
27552760
}
27562761
}
@@ -2775,7 +2780,7 @@ ItemSelector = {
27752780
-- Init.
27762781
local runtime = MEM[xuid].isr.runtime
27772782
local payload = MEM[xuid].isr.payload
2778-
local displayList = runtime.display[runtime.page]
2783+
local displayList = runtime.display[runtime.page_num]
27792784
local pageCount = #runtime.display
27802785

27812786
local function buildPageTurner(pages)
@@ -2786,7 +2791,7 @@ ItemSelector = {
27862791
return rtn
27872792
end
27882793
local function setDisplayPage(pageNum)
2789-
runtime.page = pageNum
2794+
runtime.page_num = pageNum
27902795
displayList = runtime.display[pageNum]
27912796
end
27922797
local function getItemCount()
@@ -2804,7 +2809,7 @@ ItemSelector = {
28042809

28052810
-- Update page if changed.
28062811
local nowPage = res[#res] + 1
2807-
if nowPage ~= runtime.page and nowPage <= pageCount then
2812+
if nowPage ~= runtime.page_num and nowPage <= pageCount then
28082813
setDisplayPage(nowPage)
28092814
goto JUMPOUT_ISR_PARSE
28102815
end
@@ -2814,15 +2819,15 @@ ItemSelector = {
28142819
runtime.display = {}
28152820
local findTarget = string.lower(res[1])
28162821
local count = 0
2817-
for n,str in pairs(payload.list) do
2818-
if string.find(string.lower(str),findTarget) then
2822+
for n,pair in pairs(runtime.origin) do
2823+
if string.find(string.lower(pair[2]),findTarget) then
28192824
count = count + 1
28202825
local num = math.ceil(count/ItemSelector._perpage)
28212826
runtime.display[num] = runtime.display[num] or {}
2822-
runtime.display[num][#runtime.display[num]+1] = {n,str}
2827+
runtime.display[num][#runtime.display[num]+1] = pair
28232828
end
28242829
end
2825-
runtime.page = 1
2830+
runtime.page_num = 1
28262831
displayList = runtime.display[1]
28272832
pageCount = #runtime.display
28282833
runtime.filter = res[1]
@@ -2855,7 +2860,7 @@ ItemSelector = {
28552860
Form:addInput(_Tr('gui.itemselector.search.type'),_Tr('gui.itemselector.search.ph'),runtime.filter)
28562861
Form:addLabel(
28572862
_Tr('gui.itemselector.pages',
2858-
'<a>',runtime.page,
2863+
'<a>',runtime.page_num,
28592864
'<b>',pageCount,
28602865
'<c>',getItemCount()
28612866
)
@@ -2866,7 +2871,7 @@ ItemSelector = {
28662871
Form:addSwitch(pair[2],false)
28672872
end
28682873
end
2869-
Form:addStepSlider(_Tr('gui.itemselector.jumpto'),buildPageTurner(pageCount),runtime.page - 1)
2874+
Form:addStepSlider(_Tr('gui.itemselector.jumpto'),buildPageTurner(pageCount),runtime.page_num - 1)
28702875
player:sendForm(Form,ItemSelector.Callback)
28712876
end
28722877
}
@@ -4029,7 +4034,10 @@ function GetPlayerList(mode,IncAll)
40294034
end
40304035
if mode == 0 then
40314036
for xuid,ex in pairs(base) do
4032-
rtn[#rtn+1] = xuid
4037+
local t = data.xuid2name(xuid)
4038+
if t and t ~= '' then
4039+
rtn[#rtn+1] = xuid
4040+
end
40334041
end
40344042
elseif mode == 1 then
40354043
for xuid,ex in pairs(base) do

0 commit comments

Comments
 (0)