diff --git a/src/invui.mpsrc b/src/invui.mpsrc
index 3b642f53e2aa8df8c132dec823717e04168c8d06..0fbac2e77077f4db39fe48f972ad7c4340fc6a11 100644 (file)
--- a/src/invui.mpsrc
+++ b/src/invui.mpsrc
function WindowKeyHanler:boolean;\r
\r
implementation\r
- uses vars, CellUI, console, Canvas, items, utils, craft, furnace, func, items_store, player, keyboard;\r
+ uses vars, CellUI, console, Canvas, utils, craft, furnace, func, items_store, player, keyboard, Items;\r
const\r
WINDOW_PLAYER_INV=1;\r
WINDOW_DIV_ITEMS=2;\r
for i:=0 to 1 do\r
for j:=0 to 1 do\r
begin\r
- drawItem(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true);\r
+ Items.Draw(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true);\r
id:=id+1;\r
end;\r
\r
- drawItem(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true);\r
+ Items.Draw(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true);\r
\r
i:=calcScrollBar(52, getImageHeight(fcScrollImg), MAX_FASTCRAFT_OFFSET, getOffset(0));\r
drawimage(fcScrollImg, x+156, y+66+i);\r
sum1:=GetWindowInfo(WINDOW_INFO_DIV_SUM1);\r
sum2:=GetWindowInfo(WINDOW_INFO_DIV_SUM2);\r
\r
- drawItem(item, (sum1-sum2), x+8, y+8, true);\r
- drawItem(item, sum2, x+64, y+8, true);\r
+ Items.Draw(item, (sum1-sum2), x+8, y+8, true);\r
+ Items.Draw(item, sum2, x+64, y+8, true);\r
\r
i:=calcScrollBar(72, getImageWidth(DivScrollImg), sum1, sum2);\r
\r
fresult:=true;\r
\r
if (tmp_item1=tmp_item2) and (Idx1<>Idx2) then\r
- if tmp_sum2<getItemMax(tmp_item2) then\r
+ if tmp_sum2 < Items.GetMaximum(tmp_item2) then\r
begin\r
tmp_sum2:=tmp_sum2+tmp_sum1;\r
tmp_sum1:=0;\r
\r
- if tmp_sum2>getItemMax(tmp_item2) then\r
+ if tmp_sum2 > GetMaximum(tmp_item2) then\r
begin\r
- tmp_sum1:=tmp_sum2-getItemMax(tmp_item2);\r
- tmp_sum2:=tmp_sum2-tmp_sum1;\r
+ tmp_sum1 := tmp_sum2 - Items.GetMaximum(tmp_item2);\r
+ tmp_sum2 := tmp_sum2 - tmp_sum1;\r
end;\r
\r
if tmp_sum1<=0 then\r
\r
function CanDivItem:boolean;\r
begin\r
- if getItemDiv(getItem(GetCurIndex(GetCur))) then\r
+ if Items.IsDividable(getItem(GetCurIndex(GetCur))) then\r
if (GetCur=CUR_SELECT1) and (getSum(GetCurIndex(GetCur))>0) then\r
CanDivItem:=true;\r
end;\r
begin\r
if GetTimer(T_KEY_DROPITEM)>TIMER_OK then\r
begin\r
- if getItemDiv(item) then\r
+ if Items.IsDividable(item) then\r
begin\r
player.dropItem(item, 1);\r
decItem(curidx);\r