We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<- forms.ExitConfirmation(ps, nil)
Implement a form submit and close callback system using channel.
package form_api type Form interface { C() (Form, chan Form) } type baseForm struct { c chan Form } func (f baseForm) C() (Form, chan Form) { f.c = make(chan Form) return f, f.c } type closer struct { closed bool baseForm } func (c closer) Closed() bool { return c.closed }
package form_api import ( "github.com/df-mc/dragonfly/server/player/form" ) type Custom struct { closer } func (c Custom) Close(submitter form.Submitter) { c.closed = true c.Submit(submitter) } func (c Custom) Submit(form.Submitter) { select { case c.c <- c: default: } }
package forms import ( form_api "ZSMC-df/api/form-api" "ZSMC-df/api/message" player_session "ZSMC-df/player-session" "github.com/df-mc/dragonfly/server/player/form" ) type ExitConfirmationForm struct { Y form.Button N form.Button form_api.Menu } func ExitConfirmation(ps *player_session.PlayerSession, _ form_api.Form) chan form_api.Form { f, c := ExitConfirmationForm{}.C() ps.P.SendForm(form.NewModal(f.(ExitConfirmationForm), ps.Message(message.New(). FormTitle(). Eng("Exit Confirmation"). Zho("退出確認"). Chs("退出确认"), )).WithBody(ps.Message(message.New(). Text("§e"). Eng("Are you sure to "). Zho("您是否要與伺服器"). Chs(""). Text("§l§6"). Eng("disconnect from the server?"). Zho("中斷連線?"). Chs("中断连线?"), ))) return c }
The text was updated successfully, but these errors were encountered:
Does this happen without your package?
Sorry, something went wrong.
No, I checked out the commit before I create the package, the form was shown.
No branches or pull requests
Reproduce
<- forms.ExitConfirmation(ps, nil)
Error
Form package
Why I create this package
Implement a form submit and close callback system using channel.
Package content
Form
Environment
The text was updated successfully, but these errors were encountered: