Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ElfenGame/Assets/Scripts/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,17 @@ private void HandlePhaseUpdate()
MainUIManager.manager.hideTokenSelection();
}

if (curPhase == GamePhase.Auction)
{
MainUIManager.manager.ShowAuctionScreen();
}
else
{
MainUIManager.manager.HideAuctionScreen();
}

Player local = Player.GetLocalPlayer();

if (curPhase == GamePhase.SelectTokenToKeep && local.IsMyTurn())
{
if (local.mHiddenTiles.Count == 0 && (local.mVisibleTiles.Count == 0 ||
Expand Down
29 changes: 17 additions & 12 deletions ElfenGame/Assets/Scripts/MainUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,19 +770,30 @@ public void ShowAuctionScreen()
}

// Go to the next item in the auction
private void GoToNextAuctionItem()
private void GoToNextAuctionItem(bool first = false)
{
AuctionItem[] auctionItems = GetActiveAuctionItems();

if (first)
{
currentAuctionItem = auctionItems[0];
return;
}

// get the next item
currentAuctionItem = auctionItems[0];
// remove it from the list
auctionItems.RemoveAt(0);
// update the tile image in the UI
auctionPanel.GetComponent<SpriteRenderer>().sprite = currentAuctionItem.tile.mImage;
currentAuctionItem = auctionItems[1];
// remove current auction item
Destroy(auctionItems[0].gameObject);
// reset the user's bid amount
auctionPanel.GetComponentInChildren<TextMeshPro>().SetText("0");

}

private AuctionItem[] GetActiveAuctionItems()
{
return auctionGroup.GetComponentsInChildren<AuctionItem>();
}

public void HideAuctionScreen()
{
auctionPanel.SetActive(false);
Expand Down Expand Up @@ -862,12 +873,6 @@ private void GoToNextAuctionState()
GoToNextAuctionItem();
}

// Returns true once all items have been auctioned
private bool IsAuctionDone()
{
return auctionItems.Count == 0 && IsAuctionItemDone();
}

// Returns true once every player has bid (note that a pass is equivalent to a bid of 0)
private bool IsAuctionItemDone()
{
Expand Down
3 changes: 2 additions & 1 deletion ElfenGame/Assets/Scripts/TaskRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void Update()
}
catch (Exception e)
{
Debug.LogError(e);
//Debug.LogError(e);
Debug.Log(e);
}
}
toRun.Clear();
Expand Down