All Projects → Him188 → GUI

Him188 / GUI

Licence: other
Form Window tools for Nukkit and NukkitX plugin developers

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to GUI

vue-auto-form
A vue2 component that helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
Stars: ✭ 39 (+95%)
Mutual labels:  form
BetterVanillaGenerator
This plugin not only provides better terrain generators for Nukkit, you can also customize your world by modifying the configuration.
Stars: ✭ 26 (+30%)
Mutual labels:  nukkit
v-form
🎉 基于 Vant-UI 进行二次封装动态生成表单,通过 JSON 的形式配置,内部集成繁琐的校验规则,可扩展的校验
Stars: ✭ 57 (+185%)
Mutual labels:  form
EasyForm-Android
该项目是一个android端用于生成复杂表格的库。可以用来做像Excel表格那样的UI界面。
Stars: ✭ 17 (-15%)
Mutual labels:  form
vue-use-form
✅ A Vue.js composition API function to validate forms
Stars: ✭ 97 (+385%)
Mutual labels:  form
onion-form
React Redux form builder with great UX validations
Stars: ✭ 50 (+150%)
Mutual labels:  form
laravel-nova-nested-form
This package allows you to include your nested relationships' forms into a parent form.
Stars: ✭ 225 (+1025%)
Mutual labels:  form
react-native-validator-form
Simple validator for react-native forms.
Stars: ✭ 21 (+5%)
Mutual labels:  form
typo3-formlog
Form log for TYPO3
Stars: ✭ 16 (-20%)
Mutual labels:  form
foect
Simple form validation library for React Native.
Stars: ✭ 39 (+95%)
Mutual labels:  form
SwiftUIFormValidator
Declarative form validator for SwiftUI.
Stars: ✭ 34 (+70%)
Mutual labels:  form
ngx-typed-forms
Extends Angular reactive forms strongly typed
Stars: ✭ 27 (+35%)
Mutual labels:  form
react-final-form-listeners
A collection of components to listen to 🏁 React Final Form fields
Stars: ✭ 91 (+355%)
Mutual labels:  form
form-create-designer
好用的vue可视化表单设计器
Stars: ✭ 634 (+3070%)
Mutual labels:  form
node-input-validator
Validation library for node.js
Stars: ✭ 74 (+270%)
Mutual labels:  form
Rails-4-ElasticSearch-dynamic-facets
Rails 4 ElasticSearch integration with dynamic facets
Stars: ✭ 16 (-20%)
Mutual labels:  form
react-native-paper-form-builder
React Native Paper Form Builder with inbuilt Validation, dropdown, autocomplete, checkbox, switch and radio inputs.
Stars: ✭ 95 (+375%)
Mutual labels:  form
ngx-scroll-to-first-invalid
Directive to scroll to first invalid form control inside an Angular form on submit
Stars: ✭ 27 (+35%)
Mutual labels:  form
react-hubspot
A collection of React hooks for interacting with Hubspot APIs
Stars: ✭ 20 (+0%)
Mutual labels:  form
react-form-base
Base React component for generic forms
Stars: ✭ 18 (-10%)
Mutual labels:  form

GUI - FormWindow tools
(中文版说明)Chinese README

Introduction

This plugin is made for developers.
By using GUI, you can easily create forms.
Contribution is welcomed

Download

Features

Kotlin DSL

Only available in Kotlin
Learn more in
Sample for showing FormSimple

player.showFormSimple() {
  title("Set title here")
  content("Set content here")
  
  buttons("Button1", "Button2", "Vararg buttons")

  onClicked {//it: Int
    player.sendMessage("You clicked a button whose id is $it")
  }
  
  onClosed {//it: Player
    it.sendMessage("You closed the form")
  }
}

ResponseListener

(ResponseListener.java)
Sample:

class A extends ResponsibleFormWindowSimple {
    A() {
        super("Title", "Content");
        addButton(new ElementButton("Say Hi"));
        addButton(new ElementButton("Say Hello"));
    }
    public void onClicked(int id, Player player) {
        switch (id){
            case 0:
                player.sendMessage("Hi");
                break;
            case 1:
                player.sendMessage("Hello");
                break;
        }
    }
    public void onClosed(Player player) {
        player.sendMessage("You Closed");
    }
}

Functional listeners

Functional method(lambda) support

You can send FormWindow and process only in one line
Sample:
player.showFormWindow(new FormModal("Tips", "Hello", "Yes", "No") .onResponded(confirmation -> player.sendMessage("Your choice:"+confirmation)));

ResponsibleFormWindowSimpleAdvanced.java:

Using Listeners

ResponseListener and Functional listeners can be used at the same time
Notice that: ResponseListener will be called before Functional listeners

ResponsibleButton

ResponsibleButton for ResponsibleFormWindowSimple
Sample:

class A extends ResponsibleFormWindowSimple {
    A() {
        super("Title", "Content");
        addButton("Say Hi", player->player.sendMessage("Hi"));//fast addButton
        addButton(new ResponsibleElementButton("Say Hello", player->player.sendMessage("Hello")));//common addButton
    }
    public void onClosed(Player player) {
        player.sendMessage("You Closed");
    }
}

ResponsibleFormWindowSimpleAdvanced

ResponsibleFormWindowSimpleAdvanced
This is a wonderful implement of ResponsibleFormWindowSimple!
(I can't translate this paragraph into English)

高级版无需通过 id 自找数据, 一切的一切都由 GUI 帮你完成. 你只需要实现后续处理即可!
普通版里面, 点击事件函数参数1是 int, 是按钮的 ID.
并且需要使用 Simple 类型表单的情况, 一般是有一组同一类型的数据需要依次显示. 比如传送世界列表, 任务列表
在普通版构造器中, 你需要手动对数据遍历并添加按钮, 在普通版click事件中, 你又需要手动从数据(List,Map等)中取出第 n 项, 再处理.
如果再来一个窗口, 你又要枯燥地重复一切. 那么是时候使用高级版了!

高级版里面, 由java泛型支持, 你在构造器中需要传入一组数据和构造按钮的函数, 然后在点击事件中直接拿到按钮对应的数据进行处理

Please use a minute to check the source code

ResponsibleFormWindowTemplated

extends ResponsibleFormWindow
By using it, you can get responses from your custom key such as enum, String
The template has checkers(parsers) to TemplateElementInput, It can automatically check whether the input is correct.
(I can't translate this paragraph into English)

比如, 你设置ID为"test"的 Input 只能输入整数, 你在收到返回数据时, 可以通过ID "test" 直接获取玩家的输入内容. 而原本NK表单只有整数ID, 对于项目多达十几个的表单很不方便.
当玩家提交表单, 模板会将表单数据按照你预期希望的数据类型转换, 因此你可以直接取到整数型, 日期型, 甚至`Level`, `Player`, `Item`类型的数据!(不然, 试想10个输入框, 你需要花几十行判断和转换类型?)
如果玩家输入数据有误, 你可以选择性地处理错误. 我们提供了 `ExceptionConsumer` 来捕获错误. 也提供了默认的处理方法: 只处理一个错误, 处理每个错误, 集中处理全部https://github.com/Him188/GUI/blob/master/src/main/java/moe/him188/gui/window/ResponsibleFormWindowSimpleAdvanced.java错了一个就全没了?)

Please check the source code
Or fast know hot wo use: template example

Backable

Each ResponsibleFormWindow supports directly back to the window which has been sent before.
And you just need to code one line:

window.goBack(player);

You can also get players' latest windows, please view Backable.java

How to use

Maven repository

  1. Add repository in repositories
    <repository>
        <id>mamoe-repo</id>
        <url>http://mamoe.net:8081/repository/public/</url>
    </repository>
    This repo may permanently work.
  2. Add dependency in build.dependencies
    <dependency>
        <groupId>moe.him188</groupId>
        <artifactId>gui</artifactId>
        <version>LATEST</version>
    </dependency>
    Sometimes the 'LATEST' version signal does not work, in this case, you need to use the latest version, such as 1.14 instead. And, you can get the latest version in pom.xml
  3. Don't forget to add depend into plugin.yml
    depend:
    - GUI

Package JAR file

  1. Run command mvn clean package in project root path

  2. Find JAR in target/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].