X-Git-Url: https://deadsoftware.ru/gitweb?p=cavecraft.git;a=blobdiff_plain;f=src%2Finvui.mpsrc;h=3c4a8f06ed00e4508e00ddb11dfcfd87374c18f3;hp=3b642f53e2aa8df8c132dec823717e04168c8d06;hb=bddd811f24b5890310e09e93a33600a58db39ec9;hpb=1ef13d5bd0592dde48cc837e05b13e93e82db25b diff --git a/src/invui.mpsrc b/src/invui.mpsrc index 3b642f5..3c4a8f0 100644 --- a/src/invui.mpsrc +++ b/src/invui.mpsrc @@ -10,7 +10,9 @@ 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, ItemsLogic; + const WINDOW_PLAYER_INV=1; WINDOW_DIV_ITEMS=2; @@ -176,11 +178,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); + ItemsLogic.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); + ItemsLogic.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 +411,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); + ItemsLogic.Draw(item, (sum1-sum2), x+8, y+8, true); + ItemsLogic.Draw(item, sum2, x+64, y+8, true); i:=calcScrollBar(72, getImageWidth(DivScrollImg), sum1, sum2); @@ -566,15 +568,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 +666,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 +719,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);