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

Right-click #21

Merged
merged 24 commits into from
Jul 3, 2020
Merged

Right-click #21

merged 24 commits into from
Jul 3, 2020

Conversation

Lucke0051
Copy link
Member

@Lucke0051 Lucke0051 commented Jun 30, 2020

I made a feature request regarding this and I decided to make it on my own.
I have added functionality for right-click. It's mobile friendly and follows the Roblox ui scheme too, the dropdown looks very similar to the Playerlist, you can add custom icons and text. I have not added any controller support since my controller I use to test is broken or something.

It adds another module under the icon module. Each icon created gets it's own "option table" if you do icon.interactionMenu.new(), a table with options that will show when you interact (right-click for pc and long press for mobile) with the icon.

I have optimized it and tried to make sure there aren't any memory leaks.

Hopefully this can come to use or maybe give you some ideas. 🤷

Place: https://www.roblox.com/games/5258546945/Topbar-testing (uncopylocked)

(I hope I compared the right branch in here, if I messed something up just find the files in the place)

@Lucke0051 Lucke0051 mentioned this pull request Jun 30, 2020
@1ForeverHD
Copy link
Member

Looking great! Here's a summary of the changes from our discussion:

  1. Change the name 'InteractionMenu' to 'Dropdown' (and for all references within the module)
  2. Simplify method names by removing 'menu', (e.g. :hideMenu to :hide, :menuIsOpen to :isOpen, etc)
  3. Re-parent the Dropdown module to the MainModule (as apposed to Icon)
  4. Make all properties/values/keys camelCase, including 'options' and 'settings.
  5. Utilise the Maid object local Maid = require(HDAdmin:WaitForChild("Maid")) for cleanup (take a look at the Icon module for an example of how this is done. Keep in mind HDAdmin uses Quenty's Maid with some new/modified methods.
  6. To create a dropdown, do icon:createDropdown(options) as apposed to icon.something.new
  7. Remove all that dropdown.options[option].event wibbly wobbly stuff replace it with the key/values mentioned in point 9
  8. When a dropdown option is created, copy the 'notification object' (i.e. icon.objects.notification) and resize/reposition it to fit the dropdown option
  9. Introduce two new descriptions for options, 'clicked' (a function for when the option is clicked), and 'events', which is a table containing events that be used to bind notices created by ``icon:notify(event). For example:
icon:createDropdown{
	name = "Test",
	icon = "http://www.roblox.com/asset/?id=4943948171",
	clicked = function()
		print("🍕+🍍=😍")
	end,
	events = {shopIcon.selected, ...}
}
  1. If 0 images, shift all field text to the left where the field image would be, else everything will be aligned where it currently is
  2. Remove methods such as setTheme, canHidePlayerlist(bool), canHideChat(bool) etc and replace them with one method, dropdown:set(setting, value).
  3. Introduce new settings such as TextColor, BackgroundColor and ImageColor

@1ForeverHD 1ForeverHD merged commit f1a86df into nanoblox:development Jul 3, 2020
@1ForeverHD
Copy link
Member

Brilliant, thanks very much for this feature Lucke!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants