Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fomo3d): fix owner & add txlinks in render #3734

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion examples/gno.land/r/stefann/fomo3d/fomo3d.gno
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var (
)

func init() {
Ownable = ownable.New()
Ownable = ownable.NewWithAddress(std.Address("g1sd5ezmxt4rwpy52u6wl3l3y085n8x0p6nllxm8"))
players = avl.NewTree()
gameState.Ended = true
hof.Register()
Expand Down
26 changes: 21 additions & 5 deletions examples/gno.land/r/stefann/fomo3d/render.gno
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"gno.land/p/demo/grc/grc721"
"gno.land/p/demo/ufmt"
"gno.land/p/moul/txlink"

"gno.land/r/demo/users"
)
Expand Down Expand Up @@ -34,11 +35,20 @@ func RenderHome() string {

// Play Game section
builder.WriteString("## How to Play\n\n")
builder.WriteString(ufmt.Sprintf("1. **Buy Keys** - Send GNOT to this realm with function [`BuyKeys()`](%s)\n", gameState.BuyKeysLink))
builder.WriteString(ufmt.Sprintf("2. **Collect Dividends** - Call [`ClaimDividends()`](%s) to collect your earnings\n", gameState.ClaimDividendsLink))
builder.WriteString(ufmt.Sprintf("1. **Buy Keys** - Send GNOT to this realm with [`BuyKeys()`](%s) or [click here](%s)\n",
txlink.Call("BuyKeys"),
gameState.BuyKeysLink,
))
builder.WriteString(ufmt.Sprintf("2. **Collect Dividends** - Call [`ClaimDividends()`](%s) or [click here](%s) to collect your earnings\n",
txlink.Call("ClaimDividends"),
gameState.ClaimDividendsLink,
))
builder.WriteString("3. **Check Your Stats** - Append `:player/` followed by your address or namespace to the current URL to view your keys and dividends\n")
if gameState.Ended {
builder.WriteString(ufmt.Sprintf("4. **Start New Round** - Call [`StartGame()`](%s) to begin a new round\n", gameState.StartGameLink))
builder.WriteString(ufmt.Sprintf("4. **Start New Round** - Call [`StartGame()`](%s) or [click here](%s) to begin a new round\n",
txlink.Call("StartGame"),
gameState.StartGameLink,
))
}
builder.WriteString("\n")

Expand Down Expand Up @@ -113,9 +123,15 @@ func RenderPlayer(addr std.Address, keys int64, dividends int64) string {
}

builder.WriteString("## Actions\n\n")
builder.WriteString(ufmt.Sprintf("* To buy more keys, send GNOT to this realm with [`BuyKeys()`](%s)\n", gameState.BuyKeysLink))
builder.WriteString(ufmt.Sprintf("* To buy more keys, send GNOT to this realm with [`BuyKeys()`](%s) or [click here](%s)\n",
txlink.Call("BuyKeys"),
gameState.BuyKeysLink,
))
if dividends > 0 {
builder.WriteString("* You have unclaimed dividends! Call `ClaimDividends()` to collect them\n")
builder.WriteString(ufmt.Sprintf("* You have unclaimed dividends! Call [`ClaimDividends()`](%s) or [click here](%s) to collect them\n",
txlink.Call("ClaimDividends"),
gameState.ClaimDividendsLink,
))
}

return builder.String()
Expand Down
Loading