-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Gtaray/cards-facedown-in-hand
Cards facedown in hand
- Loading branch information
Showing
20 changed files
with
618 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local bPopped = false; | ||
|
||
function onInit() | ||
-- highlight.setEnabled(false); | ||
|
||
local node = getDatabaseNode(); | ||
DB.addHandler(DB.getPath(node, CardManager.CARD_FACING_PATH), "onUpdate", onFacingChanged) | ||
|
||
onFacingChanged(); | ||
end | ||
|
||
function onClose() | ||
local node = getDatabaseNode(); | ||
DB.removeHandler(DB.getPath(node, CardManager.CARD_FACING_PATH), "onUpdate", onFacingChanged) | ||
end | ||
|
||
function onFacingChanged(nodeUpdated) | ||
local bFaceUp = CardManager.isCardFaceUp(getDatabaseNode()); | ||
image.setVisible(bFaceUp); | ||
image.setEnabled(bFaceUp); | ||
cardback.setVisible(not bFaceUp); | ||
cardback.setEnabled(not bFaceUp); | ||
|
||
end | ||
|
||
function setCardSize(nWidth, nHeight) | ||
image.setAnchoredWidth(nWidth); | ||
image.setAnchoredHeight(nHeight); | ||
cardback.setAnchoredWidth(nWidth); | ||
cardback.setAnchoredHeight(nHeight); | ||
end | ||
|
||
-- function onHover(hover) | ||
-- if hover and not bPopped then | ||
-- highlight.setVisible(true); | ||
-- bPopped = true; | ||
-- elseif not hover and bPopped then | ||
-- highlight.setVisible(false); | ||
-- bPopped = false; | ||
-- end | ||
-- end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.