1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

help formApi

Discussion in 'Help' started by Winchester, Aug 13, 2018.

  1. Winchester

    Winchester Baby Zombie

    Messages:
    133
    how to add a button to go back to the previous window of the ui?

    PHP:
    public $Ferramentas = [
        
    "ICON" => ["Ferramentas",278,0],
        
    "Picareta de Diamante" => [278,0,500,4],
        
    "Diamond Shovel" => [277,0,500,4],
        
    "Diamond Axe" => [279,0,500,4],
        
    "Diamond Hoe" => [293,0,500,4],
     
      ];
     
  2. OnTheVerge

    OnTheVerge Spider Jockey

    Messages:
    46
    Hello there!:)
    Winchester, I'm not quite sure of what you're trying to get across simply because your question overall is too vague...:(

    Im assuming you want to "reopen" a previously opened User Interface after a specific button within it has been pushed and the interface has been closed. I'm not sure if you're using a public plugin or what but I would suggest you create a specific function for said objective, then simply verify if a specific button is selected and you then send the function which reopens the desired interface. I'm sorry its quite difficult to assist you. I have no idea whether you're using the FormAPI plugin or some other unstated method.
     
  3. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    The title does say FormAPI, so it's safe to assume that's the plugin OP is using.
     
  4. OnTheVerge

    OnTheVerge Spider Jockey

    Messages:
    46
    :facepalm:xD im dumb:D
     
  5. Destroyer57

    Destroyer57 Zombie

    Messages:
    275
    I dont know how to code in php but i do understand it when i read it. I think if you want to return to previous you gotta do this:

    switch(selectedbutton){

    case button:

    $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI");
    $form = $api->createSimpleForm(function (Player $sender, $data){
    $result = $data
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.