本文整理汇总了C#中Terraria.Player.toggleInv方法的典型用法代码示例。如果您正苦于以下问题:C# Player.toggleInv方法的具体用法?C# Player.toggleInv怎么用?C# Player.toggleInv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terraria.Player
的用法示例。
在下文中一共展示了Player.toggleInv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreUpdatePlayer
//.........这里部分代码省略.........
int oldSelectionY = chestSelY;
if(stickPoint.X > 0) {
chestSelX++;
}
else if(stickPoint.X < 0) {
chestSelX--;
}
else if (stickPoint.Y > 0) {
chestSelY--;
}
else if (stickPoint.Y < 0) {
chestSelY++;
}
if(chestSelX>5) chestSelX = 5;
if(chestSelX<0) chestSelX = 0;
if(chestSelY>3) chestSelY = 3;
if(chestSelY<0) {
invMenu=ModPlayer.INVENTORY;
chestSelY = 0;
invSelectionY = 3;
invSelectionX = chestSelX+1;
invCool = invCoolAmt;
}
if(oldSelectionX != chestSelX || oldSelectionY != chestSelY) {
invCool = invCoolAmt;
UpdateInvMouse();
}
}
}
/*else if(invMenu==COINS)
{
int prev = coinSel;
if (stickPoint.Y > 0) {
coinSel--;
}
else if (stickPoint.Y < 0) {
coinSel++;
}
if(coinSel!=prev) {
invCool = invCoolAmt;
}
}*/
else if(invMenu==ARMOR) {
//Inventory selection
int oldSelectionX = armorSel;
//int oldSelectionY = invSelectionY;
if(stickPoint.Y > 0) {
armorSel--;
}
else if(stickPoint.Y < 0) {
armorSel++;
}
else if (stickPoint.X > 0 && armorSel>=8) {
armorSel-=8;
}
else if (stickPoint.X < 0 && armorSel<8) {
armorSel+=8;
}
if(armorSel>10) armorSel = 10;
if(armorSel<0) armorSel = 0;
//if(invSelectionY>3) invSelectionY = 3;
//if(invSelectionY<0) invSelectionY = 0;
if(oldSelectionX != armorSel) { // || oldSelectionY != invSelectionY) {
invCool = invCoolAmt;
UpdateInvMouse();
}
}
}
}
}
if (controlInv)
{
if (releaseInventory) {
player.toggleInv();
if(Main.playerInventory) UpdateInvMouse();
}
releaseInventory = false;
}
else releaseInventory = true;
if (player.delayUseItem)
{
if (!player.controlUseItem)
player.delayUseItem = false;
player.controlUseItem = false;
}
if (player.itemAnimation == 0 && player.itemTime == 0)
{
player.dropItemCheck();
}
}
}
//UpdateButtons();
}