Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey!

 

I've made a custom GUI for my mod (in 1.8), and wanted to use a TextField with autocompletion. I managed to achieve that by making my Gui class extending GuiChat.

That way, I am now able to use the method "autocompletePlayerNames()" to complete the name that I start to write in the TextField.

 

But, after a bit, I realized that the chat was active when this Gui was open (seems logic). I managed to remove the writing line of the chat so that when I type, the text don't appear in both the Chat box and my own Text box.

I thought it would do the whole job, but it actually leaves the chat history be. All the messages received are constantly rendered, the chat never unfocus...

 

So here is my question: What do I have to do to cancel this focus? Or maybe is there another way to autocomplete ( without having to re-write the whole algorithm that do it )

  • Author

Thing is that I don't want to update to 1.9. I mean... I have my reasons to stay on 1.8 so i asked for a possible solution on that version. (just figured that i didn't mention the version i used ^^)

Still, thank you for the idee

  • Author

Ok, I am currently trying to replicate the CuiChat methods that autocomplete the player name.

Here are the methods in GuiChat I copied:

 

-  setText(String , boolean)

-  autocompletePlayerNames()

-  sendAutocompleteRequest(String , String)

-  onAutocompleteResponse(String[] )

 

I change the differents objects names to mine (like "inputField" into "textBox" which is my textField i want te autocomplete to act)

But now, I think i need to add a Handler for the communications of Packets. autocomplete and sendAutoCompleteRequest are fired when i Tab to complete. But onAutocompleteResponse is never fired...

 

The packets to autocomplete is C14PacketTabComplete (I think, even so there is a BlockPos as argument) and i can't find the packet handler fired on response so I don't know how to fire the last method.

 

Does someone know what i have to do next ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.