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

Feature request: Customizable Dialog function #1169

Closed
10Dozen opened this issue Jun 24, 2019 · 4 comments
Closed

Feature request: Customizable Dialog function #1169

10Dozen opened this issue Jun 24, 2019 · 4 comments
Labels
Milestone

Comments

@10Dozen
Copy link
Contributor

10Dozen commented Jun 24, 2019

I want to support the idea of some customizible ui that was discussed last week on Slack.

I have a custom made function to generate scripted ui and after several years i can still find use for it, and i am sure CBA should have something like this too.

What it can be used for:

  • Prototopying: Before messing with actual UI classes - make some prototype and try it (from my expirience - 80% of UIs i was needed didn't required more than provided by this function)
  • Simple interactions in mission: sometimes as mission maker i need some special way for players to interact with the mission - type password, make interactive conversation, select right sequence of actions during IED defusing -- using such function will be very time saving and no need to mess with description.ext (sometimes it looks like a mess)
  • Simple UI for simple mods: Some admin/zeus mods can be made by using this function (like first few versions of EJAM were using scripted ui)

Some live examples:
https://www.youtube.com/watch?v=sJ5bSF7TJ8c
https://www.youtube.com/watch?v=ojGpx_VT8Xg
https://www.youtube.com/watch?v=lA5JcqRFUVQ
https://www.youtube.com/watch?v=ZSwf9CgzVy8
https://www.youtube.com/watch?v=FxOdmp91Py0

My variant's syntax (https://github.com/10Dozen/dzn_commonFunctions/blob/master/dzn_commonFunctions/functions/uiFunctions/fn_ShowAdvDialog.sqf):

[
    [0, "HEADER", "Dynamic Advanced Dialog"]
    , [1, "LABEL", "Select teleport position"]
    , [1, "DROPDOWN", ["Airfield", "Mike-26", "Kamino Firing range"], [tp1,tp2,tp3],[[1,0,0,1], "PuristaBold", 0.04],[1,0,1,1]] /* With styling options */
    , [2, "BUTTON", "End mission", {hint _args}, "My string argument"]
    , [2, "INPUT"]
] call dzn_fnc_ShowAdvDialog

It may look a bit tricky (as each element type expects specified parameters at position 2+ in array), but it's mostly intuitve (like button -> text -> code, dropdown -> list elements to display -> list values). Styling options are optional and always in the tail.

Leading numbers (0, 1, 2) - means line number, if several items share same line - element width will be divided equally (so 1 el = 1*width, 2 el = 2 * 1/2 width, 4 el = 4 * 1/4 width, etc.)
Supported controls: RscStructuredText (LABEL and HEADER), RscEdit (INPUT), RscCombo (DROPDOWN), RscXListBox (LISTBOX), RscCheckbox (CHECKBOX), RscSlider (SLIDER), RscButtonMenuOK (BUTTON).
Button control initialized with buttonClick event with added code that reads other inputs values to _this variable (so current values of dialog are accessible).
Styling and structured text compatibility allows some level of customization (colors, images).

UI class itself is just:

{
    idd = 134800;
    movingEnable = false;
    class controls {};
}
@10Dozen 10Dozen changed the title Feature request: Customizible Dialog function Feature request: Customizable Dialog function Jun 24, 2019
@SceptreOfficial
Copy link

I was trying to make my own system for this and wanted to eventually do a pull request when I got it good enough. It's pretty rough as I just started to learn gui stuff: https://github.com/SceptreOfficial/Custom-Dialog-System

Anyways, It would be amazing if this type of function was in CBA.

@veteran29
Copy link
Member

I know you might fear that if you implement that there always can be some use-cases where it can't be used/is not flexible enough and someone will complain, want changes etc. but in my opinion something like this will make creating simple modal inputs and other small dialogs immensely easier to do.

@ygokmen
Copy link

ygokmen commented Jun 25, 2019

I'm all for @SceptreOfficial 's method. It is like eating your cake AND not just having it, but 2 of it (incremented)!

@10Dozen
Copy link
Contributor Author

10Dozen commented Jun 25, 2019

IMHO Achilles-like gui function is a bad idea for CBA. Tried to use it for my purposes, but realized that it can be applied in very few cases only (layout and styling is almost not customzible, so it's like CBA options but displayed in game).

So I prefer to have more flexibility in terms of visualization (like mine, but ofc, my variant is far from ideal and lacks few very useful fixes, just because i am too lazy to add them :D), even if it will require a bit more complex syntax to use or less features available.

@commy2 commy2 added this to the Backlog milestone Jul 25, 2019
@commy2 commy2 mentioned this issue Jan 19, 2020
6 tasks
@commy2 commy2 added the Feature label Jan 19, 2020
@commy2 commy2 closed this as completed Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants