X-Git-Url: https://deadsoftware.ru/gitweb?p=cavecraft.git;a=blobdiff_plain;f=src%2Finvui.mpsrc;h=0fbac2e77077f4db39fe48f972ad7c4340fc6a11;hp=3b642f53e2aa8df8c132dec823717e04168c8d06;hb=4d7cf2ab1e10d9926d03afb5a3f883bcf5312469;hpb=9115be0a19d5716f33a2e2cba76f3447ce0f4c2f diff --git a/src/invui.mpsrc b/src/invui.mpsrc index 3b642f5..0fbac2e 100644 --- a/src/invui.mpsrc +++ b/src/invui.mpsrc @@ -10,7 +10,7 @@ interface function WindowKeyHanler:boolean; implementation - uses vars, CellUI, console, Canvas, items, utils, craft, furnace, func, items_store, player, keyboard; + uses vars, CellUI, console, Canvas, utils, craft, furnace, func, items_store, player, keyboard, Items; const WINDOW_PLAYER_INV=1; WINDOW_DIV_ITEMS=2; @@ -176,11 +176,11 @@ implementation for i:=0 to 1 do for j:=0 to 1 do begin - drawItem(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true); + Items.Draw(getCraftInItem(craftid, id), getCraftInSum(craftid, id), x+52+j*18, y+17+i*18, true); id:=id+1; end; - drawItem(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true); + Items.Draw(getCraftOutItem(craftid), getCraftOutSum(craftid), x+108, y+27, true); i:=calcScrollBar(52, getImageHeight(fcScrollImg), MAX_FASTCRAFT_OFFSET, getOffset(0)); drawimage(fcScrollImg, x+156, y+66+i); @@ -409,8 +409,8 @@ implementation sum1:=GetWindowInfo(WINDOW_INFO_DIV_SUM1); sum2:=GetWindowInfo(WINDOW_INFO_DIV_SUM2); - drawItem(item, (sum1-sum2), x+8, y+8, true); - drawItem(item, sum2, x+64, y+8, true); + Items.Draw(item, (sum1-sum2), x+8, y+8, true); + Items.Draw(item, sum2, x+64, y+8, true); i:=calcScrollBar(72, getImageWidth(DivScrollImg), sum1, sum2); @@ -566,15 +566,15 @@ implementation fresult:=true; if (tmp_item1=tmp_item2) and (Idx1<>Idx2) then - if tmp_sum2getItemMax(tmp_item2) then + if tmp_sum2 > GetMaximum(tmp_item2) then begin - tmp_sum1:=tmp_sum2-getItemMax(tmp_item2); - tmp_sum2:=tmp_sum2-tmp_sum1; + tmp_sum1 := tmp_sum2 - Items.GetMaximum(tmp_item2); + tmp_sum2 := tmp_sum2 - tmp_sum1; end; if tmp_sum1<=0 then @@ -664,7 +664,7 @@ implementation function CanDivItem:boolean; begin - if getItemDiv(getItem(GetCurIndex(GetCur))) then + if Items.IsDividable(getItem(GetCurIndex(GetCur))) then if (GetCur=CUR_SELECT1) and (getSum(GetCurIndex(GetCur))>0) then CanDivItem:=true; end; @@ -717,7 +717,7 @@ implementation begin if GetTimer(T_KEY_DROPITEM)>TIMER_OK then begin - if getItemDiv(item) then + if Items.IsDividable(item) then begin player.dropItem(item, 1); decItem(curidx);