#arma3_gui

1 messages · Page 3 of 1

unkempt cliff
#

use something like import RscText; before your spectatorSideNumbers

simple bay
#

I see. Thanks for the help!

strange arrow
opaque lynx
opaque lynx
strange arrow
opaque lynx
strange arrow
#

In that case I have to agree 😄

opaque lynx
#

anywho going the RscActivePicture route...

opaque lynx
#

got 'er sorted and starting to see some sensible, if measurable results.
fun fact, one strategy I am using more of is a sort of Occams razor logging approach, documenting config xywh dims. finding that very useful isolating geometry issues.

honest quest
#

Howdy, do I need to convert my mod config from CPP to BIN? Or can I just keep it CPP and if so, will that cause a bunch of issues?

ionic tundra
#

Someone who knows better correct me if I'm wrong, but keeping it as a cpp just makes it slower for the engine to read. It does keep it in an editable format though which can be handy

opaque crag
#

IIRC there are some specific things that need to be binarized (animations? not sure) but it depends what your mod is doing.

#

If you're using __has_include to do runtime dependence on loaded mods then you can't binarize.

#

For most things it doesn't matter other than being slower.

brisk hemlock
#

Hey guys I'm new to GUI editing so bear with me, thanks.
What I'm trying to do is make a "radar screen" that correlates to the entities on the real map but, crucially, does not display an actual map. I've inherited ctrlMapEmpty and set all the colors to transparent which does the trick mostly, however I still get a few very annoying location names like bays, airfields and small towns floating freely in the big void. Anyone got a hot take on how to get rid of these as well?
Thanks in advance!
P.S. please tag me if you respond so I see it

opaque crag
#

@brisk hemlock You can hide locations with the createLocation alt syntax + setType "Invisible", although this would likely hide them on the map as well.

brisk hemlock
#

I find it baffling that I can hide every element of that map except those few location names...

brisk hemlock
#

Edit: I managed to pull it off by simply drawing a rectangle the size of the map over the map itself filled with background color :3

Next question: anybody know how to automatically orientate the map to player dir like the minimap?

opaque lynx
#

Q: is it possible to show a tooltip for idcLeft and idcRight buttons supporting for instance CT_LISTNBOX controls? do I need to not set the tooltip for the row?

unkempt cliff
opaque lynx
#

yeah I ended up going that route, tooltip for the row indicating the overall left/right state, i.e. "local profile", "Shared snapshot", "Shared snapshot by others", along these lines. works decently. along the lines what one might find in an arsenal loadouts list, except for inventory cargo profiles.

opaque lynx
#

Q: working on a UI with some CT_LISTNBOX controls, starting to get some live data in there, so far so good. and it is a long list, as expected. I scroll wheel up and down no problem in and of itself. but I am also engaging a camera view, which I want to prohibit zooming behavior while the lists a responding. so I handle the list and/or mouse scroll wheel events in order to prohibit that from happening?

willow stratus
opaque lynx
opaque lynx
opaque lynx
#

for my edification, trying to understand a bit better, the default camera control is what automatic (?) i.e. "manual 'off'" in terms of camera commands? which would make sense in the scenario above which I solved.

opaque lynx
#

Q: is it possible to gain image resource dimensions from scripting commands or BIS functions? got a scenario in which would be interesting to know aspect ratio in order to potentially gauge CT_LISTNBOX column widths, size to fit, along these lines.

opaque lynx
opaque lynx
#

similarly for the picture right... the challenge in either scenario being, I am also leveraging the idcLeft/idcRight controls, so don't know if there is something latent there that could conflict.

quiet arrow
#

Q: is it possible to gain image resource dimensions from scripting commands or BIS functions? got a scenario in which would be interesting to know aspect ratio in order to potentially gauge CT_LISTNBOX column widths, size to fit, along these lines.
getTextureInfo

opaque lynx
opaque lynx
#

troubleshooting some control dims, left hand sidebar left aligned, right hand sidebar, for the most part right aligned, and as far as I can tell the x coordinates are all correct. But there is this mystery vertical scrollbar gutter which seems to be jutting out to the right, which I rather want it within the bounds of the CT_LISTNBOX. checking the actual dims as the "onLoad" EH are resolved so I can verify I am not lying here, but maybe something will jump out at me there, I dunno.
https://pasteboard.co/SmSvgrM7ew2b.jpg

Simple and lightning fast image sharing. Upload clipboard images with Copy & Paste and image files with Drag & Drop

opaque lynx
opaque lynx
#

wonder if there is some scrollbar attribute, style perhaps, that is smart enough to detect left/right screen edges (?), it is a wild guess.

#

hmm another thought comes to front of mind, I'll check the background...

opaque lynx
opaque lynx
#

Q: about CT_CONTROLS_TABLE, but on closer review, I'm not sure this is quite the right fit, but will see...
I have a case that it does need to behave like a CT_LISTBOX, each row being one distinct element in a rendered view behind.
But further, I have from 2-3 templates that I might like to represent a bit differently for each template.
I may be able to reduce one of the cases from 2 to 1, possibly, but that's TBD.
https://community.bistudio.com/wiki/CT_CONTROLS_TABLE

opaque lynx
# opaque lynx Q: about `CT_CONTROLS_TABLE`, but on closer review, I'm not sure this is quite t...

It's for, inventory manager, the actual inventory control. I think I have at least three row template use cases, if possible:

  1. weapon template, similar to the player inventory, showing the weapon in inventory plus any accessories
  2. containers, such as uniforms, vests, backpacks, the object config picture, with a cargo oriented summary, maybe also object mass subtotals
  3. finally, a simple item template, the item picture, count, etc
    Like I said maybe if I get creative about it I could reduce 2-3 of these to 1-2 template use cases, not sure at this point.
opaque lynx
#

wondering if I pursued the CT_CONTROLS_GROUP path, how is ctrlCreate handled adding a CONTROL to the group dynamically, there is no automatic IDC pooling is there? also how are coordinates and geometry handled? Oh and scrollbars, as I expect the vertical would definitely exceed the geography of the parent control.

opaque crag
#

You just use ctrlSetPosition and ctrlCommit.

#

scrollbars adapt on commit.

#

You can store IDCs with setVariable on the control group or figure things out from position.

opaque lynx
#

yeah, the bookkeeping does not frighten me, especially. and child controls are handled in controls[] order of the parent, I assume?

#

...so IDC has a variable name? or you are saying that is handled apart from the baked in commands. 👀
I think I understand however...

#

how is other intrinsic plumbing handled, EH and such, i.e. "onLoad", also on ctrlCommit?

opaque crag
#

Not sure why you'd put onLoad on a script-created control.

opaque lynx
opaque crag
#

I don't see any scope for doubt with the other EH.

opaque lynx
#

fair enough. thanks for the feedback.

opaque crag
#

I don't think I actually used any event handlers on dynamic controls though. The lnb emulation only had an EH on the parent controlsGroup and the other one didn't need any.

opaque lynx
#

sounds good.

#

how about onUnload? I do foresee that happening, potentially a lot...

#

and besides also the onLoad would be a moment to do the IDC bookkeeping IMO

opaque lynx
#

another question I have about the CT_CONTROLS_GROUP, it emulates a CT_LISTBOX at all? especially in terms of idcLeft and idcRight? or is that something I need to shoe horn in around the custom controls views?

solid gyro
#

Hello,
is there any example to add own item in tools menu to editor?
I do not know how to do it without breaking all.

class MenuStrip: ctrlMenuStrip
    {
      class Items
      {
        items[] += {"ENH_About"};//new main category
        #include "menuStrip_about.hpp"
        #include "menuStrip_tools.hpp"
        #include "menuStrip_help.hpp"
      };
    };
class FunctionsViewer//Overwrites the default function viewer
{
  action = "findDisplay 313 createDisplay 'ENH_FunctionsViewer'";
  data = "";
  opensNewWindow = 1;
  shortCuts[] = {INPUT_ALT_OFFSET + DIK_F};
};

If i want my own

class mySuperDisplay// Dont know is this possible
{
  action = "findDisplay 313 createDisplay 'prisoner_superDispay'";
  data = "";
  opensNewWindow = 1;
  shortCuts[] = {INPUT_SHIFT_OFFSET + DIK_DOWNARROW};
};
solid gyro
#

Figured out. 😄

opaque lynx
#

Q: again about CT_CONTROLS_TABLE, can row template controls be made enabled or disabled? shown or hidden?
thinking this is probably the way to go assuming I can do that.

#

shame though cannot support multiple different kinds of row templates.

solid gyro
#

🤔 is there a possibility to add/ can I add an example of how to add items to the toolbar - tools menu?
Maybe Im not best person to do example, just thought because there is any of example on wiki. Or if there is i did not find that

opaque lynx
#

Q: my recollection is a bit fuzzy, is there a GUI controls z order?

opaque crag
#

I think the only strict rule is that ControlsBackground is rendered underneath Controls

#

otherwise it's generally in definition order but some elements like the map control will break it.

quiet arrow
#

I'd personally avoid touching that toolbar as it might conflict with other mods placing buttons there. Instead use the menu strip.

solid gyro
#

What exactly do you mean?
Could you give example?

solid gyro
#

I got my config work, cannot paste it currently.
But

class Edendisplay {
  ...
....
     MenuStrip: ctrlMenuStrip {
 class Items {
    ...
opaque lynx
#

Q: ctrlDelete automatically removes the deleted control(s) from the parent CT_CONTROLS_GROUP instance?

quiet arrow
solid gyro
quiet arrow
#

Cool, that's why I initially meant. Menu Strip is so much better.

opaque lynx
#

so... question about visibility therein... the class must be visible how, can it be nested? i.e. I have a CONTROL CONFIG in hand, with some item 'templates' which are nested classes within? I can access those? or the classes need to be free standing, i.e. in what scope?

quiet arrow
#

@opaque lynx Yes. You could create a controlsgroup with predefined child controls.

#
_display ctrlCreate ["RscMainMenuSpotlight", IDC_MAIN_SPOTLIGHT_GROUP_1];

For example...

opaque lynx
#

right, but can class RscMainMenuSpotlight {} be nested?
i.e. I have something like this:

class RscMySidebarControlsGroup {
  idc = IDC_MY_SIDEBAR_CONTROLS_GROUP;

  class controls {

    class RscMyInventoryControlsGroup {
      idc - IDC_MY_INVENTORY_CONTROLS_GROUP;

      // TODO: which will be created as a RscMyInventoryControlsGroup controls control
      class RscMainMenuSpotlight {};

      class controls {};
    };
  };
};
quiet arrow
#

I think it only searches main config's root

opaque lynx
#

I see BTW in 2.14+, the semantics potentially change a bit, i.e. given RscMyInventoryControlsGroup CONFIG, could potentially suss one out...

quiet arrow
#

Because there could be multiple classes having the same name

#

Dunno about 2.14 changes. In theory if you provide the path to the config it should be able to create any control, nested or not, as long as it's properly defined.

opaque lynx
#

i.e. capture the _config during the onLoad EH, then know for certain the path to "RscMainMenuSpotlight", changes things significantly. But otherwise needs to be root display class, sounds like, in the interim, and uniquely named.

opaque lynx
#

So in other words, the meanwhile class structure something like this instead:

// TODO: which will be created as a RscMyInventoryControlsGroup controls control
class RscMainMenuSpotlight {};

class RscMySidebarControlsGroup {
  idc = IDC_MY_SIDEBAR_CONTROLS_GROUP;

  class controls {

    class RscMyInventoryControlsGroup {
      idc - IDC_MY_INVENTORY_CONTROLS_GROUP;

      class controls {};
    };
  };
};
#

assuming that sorts it out, the follow on kerfuffle is to see some onLoad = "..." EH happening for the created controls...

#

I guess then question is, how would I provide the path? I'm not sure the syntax or commands to do that. given CONFIG of the would-be parent control, i.e. RscMyInventoryControlsGroup?

opaque lynx
#

not getting any errors, but the control is not being created either, isNull _child yields true. so apparently the "nested path" (loosely) is insufficient. how do I specify something like that?

#

simply like this "class1/class2/class3", seems a bit naive, but maybe I am missing something...

#

anyone at all with any insights here? it's kind of critical because it carries with it a ton of implications, side effects, etc, how I structure the classes throughout.
goal: I'd like to limit the scope of the classes to only those classes that need to see them.
but then, how do I convey a class path for ctrlCreate?
sidebar, 2.14+ couldn't drop quickly enough, IMO, if it carries with it the implications that I think it does, but I could be wrong...

#

okay, so controls are created, onLoad question at least answered, for the moment. positively, yes, EH are happening. the class path issue still a major question for the afore mentioned reasons. would be far cleaner, less clutter, if we can contain these classes in the RscMyInventoryControlsGroup scope.

#

now on to the next interestion question, IDC pooling...

opaque lynx
#

progress update, first of my created controls is theoretically 'in', but I do not see any evidence that it is there. the dims seem okay per my logs. Q: though, when I create it in the controls[] of the target control, I have verification that the IDC took, so I am at least 95 pct sure it is 'there'. what exactly am I committing in order for it to start showing up, that or any of the created control's controls[] themselves? the created control? or the host CT_CONTROLS_GROUP (?).

opaque lynx
#

okay doke, after pouring over some dims and such, starting to come in, very draft form at the moment, but I don't exactly hate it. got some effort remaining there, like what to do about margins, cuz right now seems like it is rather jutted against the host CT_CONTROLS_GROUP left and top, whether idcLeft and idcRight are supported, or a vertical scrollbar, what happens with the controls[] controls. then also what to do about navigation, selection, changes therein, and so forth.
https://pasteboard.co/3CcHyzqZLcex.png (added highlights signaling the progress thus far)

loud flame
#

I'm looking for a nice looking base-game icon for playing a sound effect, something like maybe a stereotypical speaker. I've been looking through some of the base addons and wasn't really finding anything

opaque lynx
#

Q: about configProperties, returning an ARRAY of CONFIG, if I have _config >> "x", to a property, then to get the property name I need to configName (_configProperties select 0), for instance?

opaque crag
#

yes.

opaque lynx
#

Hmm getting errors not finding one of the inventory item picture resources.
It was in there for a moment, but I had errors in another place, so curious why now it is not being found...
In my log,

15:05:32 [1065.79] [INVENTORYMGR] [fn_inventoryMgr_controlsGroupInventoryItem_onRefresh] Entering: [isNull _controlsGroupInventoryItem, isNull _display, count _controls, count _view, ctrlIDC _controlsGroupInventoryItem]: [false,false,6,5,76401]
15:05:32 [1065.79] [COMMONUI] [fn_commonUI_setMeterLevel] Entering: [isNull _controlsGroup, isNull _bg, isNull _fg, _fgRatio, _meterIndices, ctrlIDC _controlsGroup, ctrlIDC _bg, ctrlIDC _fg]: [false,false,false,-1,[1,2],-1,-1,-1]
15:05:32 [1065.79] [COMMONUI] [fn_commonUI_setMeterLevel] Leveling: [_i, isNull _meter, isNull _config, _isFg, _ratio, ctrlIDC _meter]: [0,false,false,false,1,-1]
15:05:32 [1065.79] [COMMONUI] [fn_commonUI_setMeterLevel] Leveling: [_i, isNull _meter, isNull _config, _isFg, _ratio, ctrlIDC _meter]: [1,false,false,true,0,-1]
15:05:32 [1065.79] [COMMONUI] [fn_commonUI_setMeterLevel] Fini: [_enable, _show, _commitTime]: [true,false,-1]
15:05:32 Warning Message: Picture rope 6.2 meters not found
//                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (?)
15:05:32 [1065.79] [INVENTORYMGR] [fn_inventoryMgr_controlsGroupInventoryItem_onRefresh] Fini: [_displayName, count _itemClasses, _picturePath]: ["Rope 6.2 meters",1,"\z\ace\addons\logistics_rope\data\m_rope_ca"]

Do I need to specify something like "\z\ace\addons\logistics_rope\data\m_rope_ca.paa" perhaps?
But like I said, it did show briefly, but I had meter errors that bailed prior to this being the case.
Fixed those errors, now there are no errors, AFAIK, and getting that warning.

#

I wonder does it have anything to do with overlaying images? The meters, for instance, are optional, this is what was failing before, they were showing, but I was also loading (successfully) the inventory item picture, in this case a rope.

However, the correct (expected) behavior is there should be no meter level for this item. So they are being hidden.

https://forums.bohemia.net/forums/topic/197066-picture-not-found-really-odd-issue-any-ideas/

opaque lynx
#

so strange, I have disabled the ctrlSetText now, still receiving the same warning. any ideas? suggestions?

// _pbPicture ctrlSetText _actualPath;
opaque lynx
#

the function is finishing, not getting any other warnings than this one.

15:05:32 [1065.79] [INVENTORYMGR] [fn_inventoryMgr_controlsGroupInventoryItem_onRefresh] Fini: [_displayName, count _itemClasses, _picturePath]: ["Rope 6.2 meters",1,"\z\ace\addons\logistics_rope\data\m_rope_ca"]

the other controls which should be seeing updates, are also not being updated, however. really bizarre.

_lblDisplayName ctrlSetText _displayName;
_lblCount ctrlSetText (str count _itemClasses);
#

if I follow the Occam's razor principle, suggests that perhaps _lblDisplayName is seen as a picture, but I am fairly certain (thought not hundred percent), this should be a CT_LABEL. I can verify that.

_lblDisplayName ctrlSetText _displayName;

Along which lines, allControls returns what from controls[], exactly? In declaration order?

#

💡 okay so allControls is rolling up literally ALL of the controls, including childrens' CT_CONTROLS_GROUP controls (?!?!)... did not expect that, or is there an option I can provide to discourage that?

opaque lynx
#

so... if I've got the following, what would be returned? assuming the following config:

class Base {
  type = CT_CONTROLS_GROUP;
};
class BravoBase : Base {
  class controls {
    class A {};
    class B {};
  };
};
class Alpha : Base {
  class controls {
    class Bravo : BravoBase {};
    class C {};
    class D {};
  };
};

what would allControls _alpha yield, assuming _alpha was in instance of class Alpha {}?
the basic assumption here is that it rolls up the BravoBase classes as well, but does that also include Bravo?

#

I think the choices are maybe these, but could someone confirm, please?

// 1. [Bravo, A, B, C, D]
// 2. [A, B, C, D]
opaque lynx
#

alright, I embedded some UUID throughout my controls, apparently the pattern is (1).
would be great if the docs could reflect that being the case.

opaque lynx
#

would be fantastic, IMO, if you could invoke ctrlCreate with an ARRAY of idcs, not just one, especially for CT_CONTROLS_GROUP. then if they are all used or not, no worries, can follow up and connect the dots through the respective "onLoad" EH, i.e. reporting to allocated [_idc, CONTROL], HASHMAP, or what have you, pooling.
https://community.bistudio.com/wiki/ctrlCreate

opaque lynx
#

looking for some weapon picture accessory overlay guidance if at all possible...

opaque lynx
opaque lynx
opaque lynx
empty mountain
#

there was a website someone made to help you visually adjust and set up those but I forgot it 💀

opaque lynx
# empty mountain ah here it is https://10dozen.github.io/A3_GIPP/

thanks... so maybe my intentions are not clear, although that is an interesting site to visually compare notes, thank you for that.
I am dev'ing an inventory manager, and some of the item templates will be the weapon templates, arrayed in much the same way one would find in the player inventory dialog.
maybe a quick video demo to show progress would make it clearer... currently have simple items, and today sketched in containers, uniforms, vests, backpacks.
https://odysee.com/@givenlibertyor:9/v0.98.dev-s33-draft.1:5

Another short and sweet draft update. This time factoring in inventory containers, uniforms, vests, backpacks. The dream there is to drill down into such containers and be able to manage those invento...

#

so I literally want to design a presentation layer emulating player inventory in the manager inventory control.

#

tomorrow my goal is for at least one of the weapon templates to be presentable. and if I can show also weapon accessory slots, even better.

#

also curious how is the halo effect achieved on the slot images themselves?

opaque lynx
#

but all those elements are config based, so it is a matter of lifting the correct details and doing the appropriate image size, aspect ratio math. is there guidance on how to interpret iconPinpoint?

// top, bottom, left, right, center alignment of the icon on snap point

I'm not sure what "alignment of the icon on snap point" means exactly, taken with iconPosition (x, y), for instance?

opaque lynx
unkempt cliff
#

may depend on what type of icons/buttons they are

opaque lynx
#

ah, I see, I wasn't sure if it was ctrlSetTextColor or not. CT_STATIC, IIRC... meh actually I am about 50/50 on the underlying image fit for this purpose to begin with... going back to the drawing board there a bit to see if I might arrange something a bit nicer looking.

opaque lynx
#

I think we have a winner. Very nice simple effect. Ended up doing this with the base weapon accessory images when a slot is unoccupied:

_control ctrlSetTextColor [0.5, 0.5, 0.5, 0.25];

The 50% gray base, but also the 25% alpha, is key. Suggests enough of a ghost accessory slot, while allowing some transparency to the background through. Subtle, but very nice looking.

broken agate
#

someone have the code or a link to the code that use a mouse EH and display information about the ctrls u hover, like it tells u the idc, idd in a tooltip, i think the code was from Terra or R3vo cant remember, i would appreciate it if someone have it.

opaque lynx
#

Q: about the CT_CONTROLS_GROUP interaction... I gather I need to roll my own keyboard and mouse EH in order to emulate CT_LISTBOX, or the like, behaviors? i.e. things like 'row' selection, scrollbars positioning, things of this nature? so far at least from the bit of exploring I have done, seems like probably, "yes". thanks...

unkempt cliff
opaque crag
#

Makes row selection easier. I did it for a listnbox emulation.

#

Looks like this:

if (_params#1 != 0) exitWith {};       // ignore non-LMB clicks
private _mpos = ctrlMousePosition _listBoxCtrl;
if (_mpos#0 > (ctrlPosition _listBoxCtrl # 2) - 2*GRID_W) exitWith {};      // ignore scroll-bar region
private _rowIndex = floor (_mpos#1 / (4*GRID_H));
#

ctrlMousePosition adjusts for scroll bar positioning.

opaque lynx
opaque lynx
opaque lynx
opaque lynx
#

keyboard EH always confuse me a bit... particularly the modifier keys. these are delivered as a sparse matrix when gauging changes? i.e. because SHIFT was down (or up, i.e. true) does that mean CTRL or ALT should also be interpreted when the thing was not signaled (i.e. false)?

params [
    [Q(_controlsGroupInventory),controlNull, [controlNull]]
    , [Q(_key), -1, [0]]
    , [Q(_shift), false, [false]]
    , [Q(_ctrl), false, [false]]
    , [Q(_alt), false, [false]]
];
opaque lynx
broken agate
#

there its any way to modify the colorDisabled, colorActive of a RscListBox without having to create a class that inherit from this class?

#

like do it directly from SQF im pretty sure its not possible but just in case

distant axle
#

I don't think is possible in scripts

opaque lynx
#

Q: on CT_CONTROLS_GROUP 'list item' colors... realizing there is no intrinsic support for the behavior, looking for the color properties, for background colors, selected background colors, not selected background colors. I think the foreground is fine, no reason to change that. not sure I would need/want to animate any colorSelectBackground`colorSelectBackground2` colors, per se.

opaque lynx
#

Re: onMouseEnter + onMouseExit EH... and assuming the controls in view of these two events are not otherwise overlapping in geography... we should see an onMouseExit for the currently 'focused' control before we see an onMouseEnter for the next control? thanks...

opaque lynx
#

have this in my config this far:

class MY_inventoryMgr_controlsGroupInventoryItemBase : XGUI_PRE_ControlsGroupNoScrollbars {
    onMouseEnter = "systemChat str ['onMouseEnter', ctrlIDC (_this#0)]; _this call MY_fnc_inventoryMgr_controlsGroupInventoryItem_onMouseEnter";
    onMouseExit = "systemChat str ['onMouseExit', ctrlIDC (_this#0)]; _this call MY_fnc_inventoryMgr_controlsGroupInventoryItem_onMouseExit";

    deletable = 1;
};
opaque lynx
#

side question, re: EH consumption, how do I persuade the A3 EH engine that a keyboard event has been consumed, that nothing else needs to process it? assuming I have the events handled.

I am finding that another mod is also responding to HOME key in this instance. How is it possible to tell the A3 EH engine that the key has been handled? Assuming the UI has priority, which I am assuming it does (?).

tranquil iron
#

what EH are you using

#

the UserAction EH cannot block

#

in UI eventhandlers, you can return something to prevent the event from being forwarded further

opaque lynx
#

that's what I need to know, what to return? BOOL, true, false? assuming the 'UI' (or at least the current DISPLAY) has precedence over, in this instance, an ACE Kestrel. HOME key is being greedily consumed by the Kestrel.

tranquil iron
#

the eventhandler wiki page will say

opaque lynx
#

anyway, is one among several keystrokes I'd like to support there...

opaque lynx
#

Q: I am trying to ctrlSetBackgroundColor on CT_CONTROLS_GROUP controls[] controls.

_selectedControl ctrlSetBackgroundColor _colorBackgroundRGBA;

Have verified I have control instances and appropriate background colors, [1, 1, 1, 0.5] for selected, [0, 0, 0, 0] otherwise.
https://community.bistudio.com/wiki/ctrlSetBackgroundColor
However, noticing the documentation, the row 'templates' themselves are CT_CONTROLS_GROUP, which does not appear to be support (yet?).
I'm curious then, how else can I accomplish this?
Short of spinning up a really brain dead of exceptionally verbose CT_LISTBOX or CT_LISTNBOX control...
I mean I don't hate the idea, but geography is finite, especially for weapon cargo listings.
Has been an interesting thought experiment thus far; but right now, starting to gather it is a non-path forward.
Thoughts, suggestions?

#

Plus side I suppose at least there is intrinsic support for scrollbars and arrow idcLeft idcRight buttons. So maybe that's the right answer after all.

#

Also excepting for the observation, I'm not sure how player inventory listings accomplish meter levels for things such as containers (uniforms, vests, backpacks) and magazines are accomplished, excepting perhaps a creative use of an idcLeft control, and a non or idcRight placeholder control, which it could well be.

Although I sort of had in mind arrow buttons reserved for adding to ("+", idcRight) or subtracting from ("-", idcLeft) inventories...

opaque lynx
#

Taking a huge two three steps back considering CT_LISTNBOX idcLeft idcRight arrow buttons ... there is nothing about those contols prohibiting them from being CT_CONTROLS_GROUPS themselves, is there?

opaque lynx
opaque lynx
# opaque lynx or in other words, initially I took the somewhat naive approach with plus (`+`) ...

would someone please clarify this, because I'm not sure whether there are in fact composite CT_CONTROLS_GROUP controls involved. drawing inspiration from player inventory in particular.
The description seems rather general, "The IDC of the control to be used for the left control that shows up in the selected row."
But then the first warning suggests specifically, button, but I have a question whether that is really the case, "Buttons will only be drawn if both idcLeft and idcRight are defined. Furthermore, the position of the first column needs to be adjusted so that the button does not overlap with the text. The button's height will be adjusted to the rowHeight property of the CT_LISTNBOX and the button's x, y, w and h properties can be set to -1."
https://community.bistudio.com/wiki/CT_LISTNBOX#idcLeft
Especially, I want to emulate the meter levels for things such as containers in a CT_LISTNBOX, vests, backpacks, etc. Got to be at least a CT_CONTROLS_GROUP, IMO, but is it in fact?

tranquil iron
opaque lynx
tranquil iron
#

If you cannot find how they do it, then that's likely

opaque lynx
#

I see I see... thanks.

opaque crag
#

You could actually do the bullet meter thing in a listbox with a lot of pictures. Seen that done with a mag reload mod UI.

#

controlsGroup + tiny boxes is also an option.

opaque lynx
# opaque crag controlsGroup + tiny boxes is also an option.

also, already been down the controls group path. that 'would' work were it not for the lack of even extrinsic keyboard mouse EH... saying nothing of the fact, cannot set background colors, also a critical feature. admitedly I just parked that feature branch filed under the 'failed' category, but keeping it as a reference. Git hard reset to the most recent SHA not that effort. Now considering contingencies. But I appreciate the feedback.

opaque crag
#

I don't recognise either of these points.

opaque lynx
#

I am coming at this now with more than an educated, informed notion.

opaque lynx
#

bit of a kludge, but will go the meter image route for now... not a fantastic solution, decided to go with 5% rounded increments, without getting too crazy. vertical alignment only.

solid gyro
#

Hello
How does diag_mergeConfigFile command work.
What file and where and how I can modify without repacking mod and not restart the game.

distant axle
#

Use Diag exe

crude berry
#

and give it full path to the config.cpp. And re-run/re-merge for every config edit

solid gyro
#

Thanks guys. I will test it out.

solid gyro
#

Yeah, it works .
Thank you.

oak nimbus
#

I have a problem with CT_LISTBOX and CT_LISTNBOX, they seem to not be able to contain 500 items at once? is there a limit to how much items they can contain? whenever I run the GUI creation and run the lbadd and lnbAddRow commands from the 500 item array they sometimes list 200 items or 190 or 300 or 350 (basically they fail to list every item) is there a workaround or fix for this?

#
{
    _displayName = [configFile >> "CfgVehicles" >> _x] call BIS_fnc_displayName;
    _list lbAdd _displayName;
    _list lbSetTooltip [_foreachindex, _displayName];
} forEach _500ItemArray;

this is how I'm adding items to CT_LISTBOX

hoary estuary
#

Sounds like you're doing something wrong, I don't think there is a limit

#

Log everything you add, maybe count of list items each time you add something

oak nimbus
oak nimbus
hoary estuary
oak nimbus
# hoary estuary ```sqf { _displayName = [configFile >> "CfgVehicles" >> _x] call BIS_fnc_dis...
13:49:21 "[Player Spawn Jet Menu] Added: A-10C, lbSize = 1"
13:49:21 "[Player Spawn Jet Menu] Added: To-199 Neophron (CAS), lbSize = 2"
13:49:21 "[Player Spawn Jet Menu] Added: MiG-29, lbSize = 3"
13:49:21 "[Player Spawn Jet Menu] Added: MiG-29, lbSize = scalar"
13:49:21 Error in expression <icles" >> _x] call BIS_fnc_displayName;
Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error position: <Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error Undefined variable in expression: tro_startgui_list
13:49:21 File mpmissions\__cur_mp.Altis\Functions\Player Jet Spawn\fn_PJetGUI.sqf..., line 72
13:49:21 "[Player Spawn Jet Menu] Added: MiG-29, lbSize = scalar"
13:49:21 Error in expression <icles" >> _x] call BIS_fnc_displayName;
Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error position: <Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error Undefined variable in expression: tro_startgui_list
13:49:21 File mpmissions\__cur_mp.Altis\Functions\Player Jet Spawn\fn_PJetGUI.sqf..., line 72
13:49:21 "[Player Spawn Jet Menu] Added: MiG-29, lbSize = scalar"
13:49:21 Error in expression <icles" >> _x] call BIS_fnc_displayName;
Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error position: <Tro_StartGUI_List lbAdd _displayName;
Tr>
13:49:21   Error Undefined variable in expression: tro_startgui_list
#

Tro_StartGUI_List is the RscList
this only happens when I have Firewill mod loaded? (basically when list size goes from 100 to 600)

#

I will try to see log without firewill

hoary estuary
#

Post your code

#

to see which variable is which

#

Looks like you nil Tro_StartGUI_List at some point

#

probably by reassigning something that has a nil in expression so you end up with another nil

#

Either way its not RscList issue, you have bugs in your scripts

oak nimbus
hoary estuary
#

Looks like you encountered that unintended namespace switching

#

It switches back to mission namespace where Tro_StartGUI_List is nil, thus the error

#

Get rid of with blocks, always work in mission namespace

#

Instead of

    Tro_StartGUI_Display = (findDisplay 46) createDisplay 'RscDisplayEmpty';
```do
```sqf
    private _display = findDisplay 46 createDisplay 'RscDisplayEmpty';
    uiNamespace setVariable ["Tro_StartGUI_Display", _display];
#

without with uiNamespace stuff at all, of course

#

Then get it with something like this:

    private _display = uiNamespace getVariable ["Tro_StartGUI_Display", displayNull];
    if(isNull _display) exitWith {};
#

Same with other controls

#

Put them into private variables inside unscheduled code

oak nimbus
#

Are you referring to it taking longer in scheduled to list stuff so list appears incomplete, or does namespace switching occur more frequently in scheduled?

hoary estuary
#

There is a bug in the game which randomly switches namespace, described here

hoary estuary
#

I think that's what happens there

#

Read the article

oak nimbus
#

Thanks a lot, I should have focused on the article beforehand

pearl yarrow
lone orbit
#

Can I do new lines in tooltips

#

ok, so lets see where I messed up! :P
Trying to make a new toolbar item in 3den interface that shows syst-

#

As I was typing, an error occured, but since I was typing, it dismissed it weee

#

doh /Display3DEN/Controls.Toolbar: Undefined base class 'ctrlControlsGroupNoScrollbars'

#

horray main menu start up x3
But, anyway, want a thing that shows computer time.

#

I could just use shift+tab for steam overlay, but- eh, why not

quiet arrow
#

Can I do new lines in tooltips
\n

lone orbit
#

x = "safezoneW - 4 * ( 5 * (pixelW * pixelGrid * 0.50)) - (pixelW * pixelGrid * 0.50)"; if I'm correct, that should put x as 4 grid tiles from the right on the eden toolbar?

quiet arrow
#

16 grids

#

If
#define GRID_W (pixelW * pixelGrid * pixelScale)

lone orbit
#

16?

#

oh, yea, it works. :P

#

ok, now it's code time x3

quiet arrow
#

Just make sure that there is not another button next to the far right one

#

I remember there was a "What's new" button of some sort, not sure if it's permanently disabled

lone orbit
#

How would I check that? Although, maybe having a bit of space anyway would look nice. Make the 4 by a 5 instead

quiet arrow
#

Nevermind. This button doesn't exist anymore.

lone orbit
#

Do I need to have tooltip defined in the config file or can I have it undefined and still use ctrlSetTooltip on it?

quiet arrow
#

Both works

lone orbit
#

Ok, and will tooltips break if given [394,392,432] (example numbers)

quiet arrow
#

tooltips only take STRING

#

You need to convert the array to string

lone orbit
#

yea, used str

mental trench
#

question does a command saying that it doesn't work in dedicated servers im guessing by definition that means in local host it will work?

quiet arrow
#

Which command?

mental trench
#

specifically addweaponglobal gimme a sec to get a biki page 4 u

#

just realized this was completely the wrong chat

quiet arrow
#

Dunno what is broken with this command, but should be fine when executed on a client or host

lone orbit
#

Heh- so looking at RscTitle stuff. If I play for long enough, eventually all my HUD will disappear? ;P

distant axle
#

Eventually. But nobody is going to play the session for more than 10e30 seconds

lone orbit
#

oh what about 1e6 seconds? D: (heh xD)

lone orbit
#

Wait, what is GUI_GRID_WAbs? it seems to be ((safezoneW / safezoneH) min 1.2) but- why? What is this doing?

#

this confuses me

#

wait- oh?

quiet arrow
#

it basically make sure that you controls don#t get streched on very wide aspect actions

#

it limits it to a ratio of 1.2

lone orbit
#

but why is it using safezoneH?

#

wait- ok, so that's b/c ratio

#

So, new question, why is GUI_GRID_CENTER_X or GUI_GRID_CENTER_W not in the center of my screen?

quiet arrow
#

What's in the macros?

lone orbit
#

it's from a3\ui_f\hpp\definecommongrids.inc

#
//--- New grid for new A3 displays
#define GUI_GRID_WAbs            ((safezoneW / safezoneH) min 1.2)
#define GUI_GRID_HAbs            (GUI_GRID_WAbs / 1.2)
#define GUI_GRID_W            (GUI_GRID_WAbs / 40)
#define GUI_GRID_H            (GUI_GRID_HAbs / 25)
#define GUI_GRID_X            (safezoneX)
#define GUI_GRID_Y            (safezoneY + safezoneH - GUI_GRID_HAbs)

//--- MUF - Test grid used in MP
#define GUI_GRID_MP_WAbs    GUI_GRID_WAbs
#define GUI_GRID_MP_HAbs    GUI_GRID_HAbs
#define GUI_GRID_MP_W        GUI_GRID_W
#define GUI_GRID_MP_H        GUI_GRID_H
#define GUI_GRID_MP_X        (SafezoneX)
#define GUI_GRID_MP_Y        (safezoneY)

//--- Screen Center
#define GUI_GRID_CENTER_WAbs        GUI_GRID_WAbs
#define GUI_GRID_CENTER_HAbs        GUI_GRID_HAbs
#define GUI_GRID_CENTER_W        GUI_GRID_W
#define GUI_GRID_CENTER_H        GUI_GRID_H
#define GUI_GRID_CENTER_X        (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2)
#define GUI_GRID_CENTER_Y        (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2)
quiet arrow
#

Have to checked the biki?

lone orbit
#

what sorry?

quiet arrow
#

This one might help you understand the different UI systems

lone orbit
#

wait- is grid center the center portion of my screen?

#

not dead center, but the central area when broken into 3x3 grid?

strange arrow
#

Looking at the green box labeled GUI_GRID_CENTER in https://community.bistudio.com/wiki/File:GUI_GRID_defines.png I'd say that the coordinates work like this ...

//Top left of green box:
x = GUI_GRID_CENTER_X;
y = GUI_GRID_CENTER_Y;
//Bottom right of green box:
x = GUI_GRID_CENTER_X + 40 * GUI_GRID_CENTER_W;
y = GUI_GRID_CENTER_Y + 25 * GUI_GRID_CENTER_H;
```... while the size of the green box is ...
```cpp
w = 40 * GUI_GRID_CENTER_W;
h = 25 * GUI_GRID_CENTER_H;
#

Could be wrong though, I've never actually used GUI_GRID 🤷‍♂️

lone orbit
#

What would you think this means

#

oh wait-

#

ok, now what do you think this means x3

quiet arrow
#

Computer Time?😬

unkempt cliff
#

secret countdown?

lone orbit
quiet arrow
#

What did I win?

lone orbit
quiet arrow
#

Meh 😢

lone orbit
#

How might I check if the arma 3 main menu is visible? x3

#

specifically the logos at the top of the screen

lone orbit
#

Yea but display 0 is always present

#

Ohhhh! 1, that's super super cool!
2: darn it, it's cool but it was messing me up xD

#

Arma Invaders

#

so that explains why I was getting weird values for shown on all the controls I could see with arma 3 logos. (Logo, LogoApex and the AI special logo)
Also, if ya go to campaign tab/window on the menu, and then back to main menu, it shows the standard logos and not the AI logo :P

lone orbit
#

I decided to just say heck it. If there's more then 1 display, itwill assume the center top of the screen is free.
Is there a way to make it appear on top of other things? Like, dialog box appears, then put the thing above the dialog box

lone orbit
livid sable
#
[100, ["RscTitle","PLAIN"]] remoteExec ["cutRsc", _target];
#

using this command with ace interaction which is why the _target.

When I do this on local machine, it applies the UI affect to my screen, im assuming because its still running on my machine right.

This means that there won't be an issue on local machine, correct?

willow stratus
#

your remoteExec is doing nothing remotely

#

it's the same as using the command without the remoteExec

crude berry
#

_target is the object being interacted with;
though? So _target can be used as remoteExec target to show stuff on somebody else's machine if used on another player?

livid sable
willow stratus
#

in that case it's fine

#

I assumed _target was the player

crude berry
#

on wherever _target is local then. Possibly on the dedicated server, if, say, you target AI or vehicle that was created there (or in mission and never changed locality after that) blobdoggoshruggoogly

opaque lynx
solid gyro
#

And steps and range
sliderRange
Type
Array
Description
Slider range in format {min,max}.

sliderRange[] = {0,100};

sliderStep
Type
Number
Description
Size of the steps when slider is dragged, eg if sliderStep is 1 only integers are possible for the slider value.

sliderStep = 1;

Don't know what your question was, it is about how to set the size of the slider ? And how it works or something else

opaque lynx
#

one moment, I'll illustrate

solid gyro
#

Aaa

#

Now I get it

opaque lynx
#

I mean all the rest I get... wondering if we needed to do any other properties gymnastics to achieve those, or they could be customized or what not.

opaque lynx
#

it works... turns out I think we're using the CT_XSLIDER anyway...

lone orbit
#

how do I add to an existing display?

#

wait, do I just define it again, without referencing the old one?

class RscDisplayCurator;
class Display3DEN
{ ...
class RscDisplayCurator
{ ...

Display3DEN exists, but I can add stuff to it. I copied code from another addon, but didn't really understand what was happening. Now I wanna do the same thing again with the curator display. Would I want to remove the importing on the first line of the code segment?

#

actually, it probably wont hurt, so I'll just try that xD

#

that seems to be a yes

lone orbit
#

nvm

#

I am confused xD

willow river
#

hey anyone know change the name of point on the maps for A3 such as citys and airfields

opaque crag
#

Theoretically, createLocation alt syntax.

#

Assuming that you're not making a mod and mangling CfgWorlds.

ionic tundra
#

Does anyone know of a way to set a ui elements image (ex. background image) through script?
I want to provide it a new paa path when conditions are met

opaque crag
#

For stuff like CT_STATIC or CT_BUTTON you just put the image path into ctrlSetText.

#

Not sure if I've done live image switching but it'll probably work.

#

I'm not sure exactly how it tells whether to use the text as a path or actual text.

ionic tundra
#

I was messing with trying to do it through structured text but wasnt having any luck, I can try the crtlSetText thing though

zinc oriole
#

What exactly do you mean by dynamic?

ionic tundra
#

I want to be able to determine the paa path with script during runtime, not have a bunch of presets that I flip between

#

I thought it would be possible with structured text, or as John points out, with just ctrlSetText. But I cant seem to get the structured text option to work

ionic tundra
#

I've got it working, and I want to use the ui with the new "UI on Texture" stuff, was hoping to be able to use ctrlSetText during runtime and then push that to the texture, but it looks like it just pushes whatever the ui images originally were. It doesnt reflect that changes made

tranquil iron
ionic tundra
tranquil iron
#

yes thats what i mean

ionic tundra
#

Perhaps im using it wrong?

#

I tried both 'displayUpdate (findDisplay *name of ui2texture generated display string)' and with the display idd of the gui

ionic tundra
#

Hold on, should I be somehow using ctrlsettext on the ui that was generated from the uiontexture function and not using it on the original ui element?

crude berry
#

define "original"

#
this setObjectTexture [0, '#(rgb,1024,1024,1)ui("DefaultDialog","abc")']; 
this setObjectTexture [1, '#(rgb,1024,1024,1)ui("DefaultDialog","abc")']; 
 
addMissionEventHandler ["EachFrame", {  
  private _display = findDisplay "abc";  
  private _kek = _display displayCtrl 1; // < this being the RscPicture
  _kek ctrlSetPosition [  
    -0.5 + (sin (time * 5)) * 0.5,   
    -0.5 + (cos (time * 5)) * 0.5,   
    2,   
    2  
  ];  
  _kek ctrlCommit 0;  
  displayUpdate _display;  
}];``` example of code that definitely worked ![blobdoggoshruggoogly](https://cdn.discordapp.com/emojis/748124048025714758.webp?size=128 "blobdoggoshruggoogly")
ionic tundra
#

@crude berry Does displayupdate need to be used on everyframe for a single image change? Not an animation like you have

#

I'm trying it with this code, to no avail:

wb1 setObjectTexture [0, '#(rgb,1024,1024,1)ui("OverlayTest","abc")']; 

private _display = findDisplay "abc";
private _kek = _display displayCtrl 1200;

_kek ctrlSetText "UionTextureTest\data\Image2_ca.paa";
displayUpdate _display;
crude berry
#

waiting for a frame after creating a display seems to help tanking

ionic tundra
#

tried throwing a sleep in, nothin

#

oop wait

#

hold on

#

woo I think it worked

crude berry
ionic tundra
#

Thankyou for your help, I got it working with the sleep, id forgot to switch the idc back

ionic tundra
#

hey @crude berry Have you ever used a variable for the uniqueName portion? I cant get it to accept it

crude berry
#

format? blobdoggoshruggoogly

ionic tundra
#

Thats what I thought too, findDisplay doesnt seem to work when given a variable thats any string, even a format created one

crude berry
#

it worked for me... but only once, it seems 🤔 let me dig a bit

ionic tundra
#

When I do it with a preset string, it gives me a display number of #-1, which the wiki implies is not good

crude berry
#

and now it stopped misbehaving with me changing literally nothing

ionic tundra
#

soo... its working for you?

crude berry
#

and shows display id as -1 while working, so that's likely to not be a problem

ionic tundra
#

your code actually give me a really random error referencing like 255 which you dont have lol

#

I was trying with a local variable, I guess I could with a global one

crude berry
#

local at which scope?

ionic tundra
#

It never leaves the scope of the code block

#

but perhaps uiontexture is part of a different scope then the code around it?

crude berry
#

EH is different scope. uiontexture is no code blobdoggoshruggoogly Can you show what code is misbehaving for you?

ionic tundra
#

yup hold on

#

im not using a eh btw

#

Ok it works now

#

it does not work with a local variable though

#

here is a snippet:

uniqueName2 = format["%1_%2",getObjectID wb3, _forEachIndex];

wb3 setObjectTexture [_forEachIndex, format ['#(rgb,1024,1024,1)ui("RscDisplayEmpty","%1")', uniqueName2]]; 
            
sleep 0.001;
_display = findDisplay uniqueName2;
#

if I change "uniqueName2" to "_uniqueName2" then it just doesnt work

#

oo but defining it as a private variable does seem to work

opaque crag
#

So we have two separate dialogs, both created with createDialog. One of them is always drawn in front of hint, the other behind it. Any idea why?

crude berry
opaque crag
#

The createDialog's just the first-syntax version.

#

Not sure if there's something similar in the config...

#

hmm, the one drawn in front does have movingEnable = false

opaque crag
#

not that though, apparently.

willow stratus
broken agate
#

tried also BIS_fnc_ctrlFitToTextHeight func but doesnt seems to change anything

quiet arrow
#

As far as I remember some fonts are not really supposed. Not sure if that has been fixed at some point though.

#

Try with the default arma font and see if that works

broken agate
#

tried also using ctrlSetText without structured text and nothing same result

#

soo.. i guess structured text its not supported

#

even though the wiki says yes

crude berry
#

seems to work alright with structured text on my end, though blobdoggoshruggoogly

broken agate
crude berry
broken agate
#

ye im using ctrlCreate also

crude berry
#

i suspect some shenanigans with default control width or something blobdoggoshruggoogly

broken agate
#

so i first have to set a default width and then update it again..

#

weird

crude berry
#

i mean, default width of 0.1

#

naturally the code text would take more lines with that 🙃

broken agate
#

ty for the help @crude berry meowheart

crude berry
#

just for a sanity check

opaque crag
carmine mica
#

Just trying to understand this GUI stuff, now the wiki say I can use RscText for "backgrounds and text labels." and that ctrlSetText can be used for "...active texts as well as for images"
So how come if I do something like this ```hpp
class laptopBackground: RscText
{
idc = 1000;
x = 0.298907 * safezoneW + safezoneX;
y = 0.401 * safezoneH + safezoneY;
w = 0.402187 * safezoneW;
h = 0.363 * safezoneH;
text = "laptopPassword\laptop.paa";
};

distant axle
#

RscText apparently shows a text as is

#

RscPicture instead

carmine mica
#

So the wiki is wrong? Or am I not reading it right?
I initially wanted to use RscPicture, but in the GUI editor it seems to sit on top of everything which makes laying everything out painful

distant axle
#

What wiki?

distant axle
#

And what part you're referring?

#

I actually have nearly zero experience with GUI Editor, it is simply useless and painful so I'm just doing my GUI on my text editor

carmine mica
#

Under Handling Controls it say

RscText - Very simple control. Can be used for backgrounds and text labels.

distant axle
#

It doesn't say it can show image

carmine mica
#

I assumed that's what backgrounds referred to. Especially when ctrlSetText says

This command can be used for static texts, buttons, edit lines and active texts as well as for images, where you can use it to set the image path.

distant axle
#

ctrlSetText can set image too

carmine mica
#

I tried doing it that way and still no joy

quiet arrow
#

You need to set the style first to ST_PICTURE

distant axle
quiet arrow
#

Or use RscPicture instead

carmine mica
#

Thank you both for you help and patience

lone orbit
#

Anyone happen to have a link to how to make custom controls in eden attribute window, for objects? :P

#

examples and such

lone orbit
lone orbit
#

oh, does attributeLoad run before or after onLoad

quiet arrow
#

After

quiet arrow
lone orbit
#

oh huh- how do I do this then x3
I guess instead of onLoad I will have to call the 'onLoad' function from the attribute load? 🤷‍♂️
(_this controlsGroupCtrl 100) setVariable ['RCHT_LIGHT_COLOR',_value]; [(_this controlsGroupCtrl 100)] call ratchet_LightMod_fnc_onColorPrevLoad

#

(The function is also being used for initial set up of other things)

quiet arrow
#

Not sure what you want to do really

lone orbit
#

Can onEditChanged or onChar br called for attribute controls?

lone orbit
#

If that makes sense

quiet arrow
#

Use a sliders instead from 0 -255

lone orbit
#

ok, so its being called now! I did forget to do something, but now atleast I'm seeing my "every new scope, diag_log" xD

lone orbit
quiet arrow
#

You can have slider + edit boxes quite easly. Check one of the vanilla controls

opaque lynx
#

Q: about CT_CONTROLS_GROUP, class controls { ... };, does not permit defining grouped controls in base class? i.e. class controls : ControlsBase { ... };, apparently (?).

strange arrow
#

It does, the inheritance syntax is just unusual (see https://community.bistudio.com/wiki/Class_Inheritance#Inheritance_of_Child_Classes):

class Parent {
  type = CT_CONTROLS_GROUP;

  class Controls {
    class MyControl1 { ... };
    class MyControl2 { ... };
  };
};
``````cpp
class Child: Parent {
  class Controls: Controls {
    class MyControl1: MyControl1 {}; //Inherited
    class MyControl2: MyControl2 { ... }; //Inherited and modified
    class MyNewControl { ... }; //Not inherited
  };
};
opaque lynx
#

hmm so the class needs to be Controls then, no room for ControlsBase or other custom naming. hence "unusual".

#

what I want to do is more like... (wait one)

#
class Parent {
  type = CT_CONTROLS_GROUP;

  class baseA {};
  class baseB {};
  class baseC {};
  class baseD {};

  class controls {
    class A : baseA {};
    class B : baseB {};
  };
};

class Child : Parent {
  class controls : controls {
    class C : baseC {};
    class D : baseD {};
  };
};

but I am finding that allControls _ctrlGrp is showing me only the C and D instances. i.e. does not show the A or B instances, or was not rolled up in the defined inheritance.

#

which is sad because I have a use case where that would be fantastic, could potentially leverage commonalities in the extreme.
anyway, defining class controls {...} explicitly in Child not the end of the world, just a bit more repetition.

#

huh, or are you saying I would need to derive class childA : A {} and class childB : B {} for that to be inherited? i.e.

class Child : Parent {
  class controls : controls {
    class childA : A {};
    class childB : B {};
    class C : baseC {};
    class D : baseD {};
  };
};
#

still a bit verbose for my tastes, but that is more acceptable than repeating myself.

opaque lynx
opaque lynx
#

Q: hmm, is a _display displayCtrl _idc available prior to finding its onLoad EH having been raised? have a use case indicating that maybe not... can anyone confirm?

opaque crag
#

IIRC the onLoad handlers are fired sequentially as the controls are created.

#

So it's common to spawn rather than call them, so that the whole dialog is loaded.

opaque lynx
#

ah okay I see...

#

suppose I knew that, but it makes sense

#

nice... did that, was not the worst response, not terribly cattywampus comparing contrasting _this call versus _this spawn...

astral gulch
#

Is there any better version of the GUI designer that actually has all of the control types?

#

I noticed the normal one doesn't have progress bars

quiet arrow
#

Not really. Better do it in text file instead

strange arrow
opaque lynx
# strange arrow Just pasted the `Parent` and `Child` classes from my original message into a `de...

I did test it, thank you, in the pattern described, and it was not inheriting whatsoever, complained of the base class being missing, IIRC. do not have the failure point in front of me, and since fixed it.

anyway, I have a path forward at any rate, which turns out, class controls {} children need to be IDC'ed anyway, if I read the messages correctly, so turns out I needed to specify them explicitly.

not the end of the world, and works out rather nicely, as a matter of fact. the tricky part is that the grouping needs to be a certain order, i.e. allControls indexes are well defined, so the declarations need to be consistent, or perhaps I could also look them up by UUID, so there's that, also.

cheers 🍻

loud flame
#

I'm currently working on making a custom ui element to display some info, and was setting up the IGUI values to let players move it around.
I'm looking at another mod as a reference, since I couldn't find a config reference for CfgUIGrids.

Which brings to me my question, what does saveToProfile do in CfgUIGrids >> IGUI >> Variables >> MyVariable?
I tried google searching for the name and couldn't find anything explaining what it does. The reference I'm using has saveToProfile[]={0,1};, but I also found that the TFAR mod uses saveToProfile[]={0,1,2,3,4}; in one example

#

Is it like specifying what data to save to the user's profile? Like 0 and 1 are the element's position in the "Customize Layout" menu?

#

There's also a Presets class in IGUI, which I assume is like setting the default settings for variables?

quiet arrow
loud flame
#

It doesn't really explain what the properties do, it just has the same kind of values as the other mod I was looking at:

class spe_vehicle {
    description = "Vehicle status displayed for Spearhead 1944 tanks.";
    displayName = "Spearhead 1944 tank info";
    preview = QPATHTOF(data\spe_vehicle_ca.paa);
    saveToProfile[] = {0,1};
};
quiet arrow
#

Perhaps @burnt token can help

loud flame
#

Another thing, how can you reset the position of a display?
I dragged it around for testing purposes to make sure it actually was draggable and that it would persist when relaunching, but how can I put it back to my default values?
Remembered you can just set them to nil:

profileNamespace setVariable ['IGUI_VarName_X', nil];
profileNamespace setVariable ['IGUI_VarName_Y', nil];
loud flame
#

I've been struggling to center this control inside of another element (acting as a background for the whole display). I had it centered the way I wanted it, but it had some odd spacing above and below the center bar; so I changed the sizing and position to update it but now it no longer fits correctly.

I'm using macros to reduce the "magic numbers" in the code.

controls[] =
{
    "background",
    "fuel"
};

// Window sizes, measured in % of screen size
#define WINDOW_WIDTH 0.025
#define WINDOW_HEIGHT 0.3

#define WINDOW_X 0.9
#define WINDOW_Y 0.5

// See https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Controls
class background: RscPicture
{
    text = "#(argb,8,8,3)color(0,0,0,0.7)"; // Procedural texture - https://community.bistudio.com/wiki/Procedural_Textures

    // Control size
    w = WINDOW_WIDTH;
    h = WINDOW_HEIGHT;

    // Control position
    x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", WINDOW_X * safeZoneW]); // Right side of screen
    y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)]); // Centers the bar vertically
};

class fuel: RscPicture
{
    text = "#(argb,8,8,3)color(1,1,1,0.7)"; // White bar
    
    #define FUEL_WIDTH WINDOW_WIDTH * 0.5// 50% the width of the background
    #define FUEL_HEIGHT WINDOW_HEIGHT * 0.95// 95% the height of the background

    // Control size
    w = FUEL_WIDTH;
    h = FUEL_HEIGHT;

    // Control position
    x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", (WINDOW_X * safeZoneW) - (FUEL_WIDTH / 2)]) + (FUEL_WIDTH / 2); // Center fuel bar in background
    y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (FUEL_HEIGHT / 2)]) + ((FUEL_HEIGHT) / 9.5); // Vertically center
};
#

Here's also a full screenshot, in case that helps visualize it better

#

TL;DR, centered bar is 6 pixels off, but math seems to check out so not sure why

#

This is a screenshot of it perfectly centered at 80% the height, so I'm not sure why it's suddenly not at 95% with the offset also updated

quasi granite
# loud flame I've been struggling to center this control inside of another element (acting as...
class GUI
{
  idd = -1;

  // Window sizes, measured in % of screen size
#define WINDOW_WIDTH 0.025
#define WINDOW_HEIGHT 0.3

#define WINDOW_X 0.9
#define WINDOW_Y 0.5
  controls[] = {
    "background",
    "fuel"
  };
  class Test: RscText
  {
    x = 0;
    y = 0;
    w = 1;
    h = 1;
    colorBackground[] = {1,0,0,0.2};
  };
  // See https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Controls
  class background: RscPicture
  {
    text = "#(argb,8,8,3)color(0,0,0,0.7)"; // Procedural texture - https://community.bistudio.com/wiki/Procedural_Textures

    // Control size
    w = WINDOW_WIDTH;
    h = WINDOW_HEIGHT;
    //
    // // Control position
    x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]); // Right side of screen
    y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)]); // Centers the bar vertically
  };

  class fuel: RscPicture
  {
    text = "#(argb,8,8,3)color(1,1,1,0.7)"; // White bar

#define FUEL_WIDTH WINDOW_WIDTH * 0.5// 50% the width of the background
#define FUEL_HEIGHT WINDOW_HEIGHT * 0.95// 95% the height of the background

    // Control size
    w = FUEL_WIDTH;
    h = FUEL_HEIGHT;

    // Control position
    x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]) + 0.5 * FUEL_WIDTH;
    y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", safeZoneY + WINDOW_Y * safeZoneH]) - 0.5 * FUEL_HEIGHT;
  };
};
#

Explanation:

  1. Your default values for the x coordinates were offscreen. You forgot to add the anchor (safeZoneX).
  2. I redid the calculations my way. I always trace the path that the controls would travel, so step by step to get to the final x coordinate (safeZoneX + WINDOW_X * safeZoneW + 0.5 * FUEL_WIDTH):
safeZoneX // start at left edge of screen
safeZoneX + WINDOW_X * safeZoneW // Move to the same coordinate as the background
safeZoneX + WINDOW_X * safeZoneW + 0.5 * FUEL_WIDTH // leave some space to the left edge of the background
``` repeat for y coordinate. It is important to note that these calculations only work with the given definitions (`#define FUEL_WIDTH WINDOW_WIDTH * 0.5` and `#define WINDOW_Y 0.5`). Otherwise the calucations become a bit more complicated
crude berry
#

aaand only having any calculations inside the default value of getVariable would break stuff as soon as custom anchor coordinates get saved

#

you want to get the same anchor value everywhere and apply different offsets for different controls. If you want the anchor to be center, offset would be -width/2 for x and -height/2 for y

#

but even more sane solution would be to create a control group and work in local/relative coordinates of that blobdoggoshruggoogly

quasi granite
burnt token
#

Bear in mind vanilla supports only 22 CfgUIGrid elements. CBA expands it to 100.

loud flame
loud flame
loud flame
crude berry
crude berry
loud flame
#

(profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW **]** ) + (FUEL_WIDTH / 2)

crude berry
#

if defaults are different - it will either only work with no variable set or only with variable set blobdoggoshruggoogly

loud flame
#

The defaults are the same

crude berry
loud flame
#

Might've just been a weird thing from when I copy/pasted and then removed some unneeded elements

crude berry
#

with that fixed you need to make centers match. So
a) take top-left corner of "background" control (its x/y)
b) add half of its width/height - that would give you its center
c) subtract half of "foreground" control width/height to get its top-left corner for x/y
so x = (getVariable blahblahblah) + WINDOW_WIDTH / 2 - FUEL_WIDTH / 2; and so on blobdoggoshruggoogly

loud flame
#

Yeah, I already had it centered but the formula only worked because it was 1/2 the width

crude berry
#

then are there any problems left?

loud flame
#

Terra's values for centering it vertically did work, but like they said, only for 50% the height, so I'm still working on that

crude berry
#

y = (getVariable blahblahblah) + WINDOW_HEIGHT / 2 - FUEL_HEIGHT / 2; blobdoggoshruggoogly

loud flame
#

Yeah I was just launching arma to try that, it's even more off than my previous offset of + ((FUEL_HEIGHT) / 9.5)

crude berry
#

give full running config, please blobdoggoshruggoogly

loud flame
#
y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (FUEL_HEIGHT / 2)]) + ((WINDOW_HEIGHT / 2) - (FUEL_HEIGHT / 2));
#

Copied the wrong formula

crude berry
#

full config, please

loud flame
#
// Window sizes, measured in % of screen size
#define WINDOW_WIDTH 0.025
#define WINDOW_HEIGHT 0.3

#define WINDOW_X 0.95
#define WINDOW_Y 0.5

class BNA_KC_Jet_Dialog
{
    // See https://community.bistudio.com/wiki/Arma:_GUI_Configuration#HUDs

    // Custom HUD element for jetpack fuel
    idd = 8000; // Custom id, should be unique
    // enableSimulation = 1; // ?
    movingEnable = 1; // Allow the player to move the display in the "Customize Layout" menu
    duration = 9.9999998e+010; // Make menu last "forever", will be closed if jetpack is removed

    // 0.5 second fate in/out
    fadeIn = 0.5;
    fadeOut = 0.5;

    // onLoad = "[_this] call BNAKC_fnc_jetpackDisplayOnLoad;"; // Code to run when loaded
    onUnload = ""; // Same thing but when unloaded

    // List of all the UI elements
    controls[] =
    {
        "background",
        "fuel"
    };

    // See https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Controls
    class background: RscPicture
    {
        idc = 9000; // Id for this control
        moving = 1; // Control will be moved when the display is dragged
        
        text = "#(argb,8,8,3)color(0,0,0,0.7)"; // Procedural texture - https://community.bistudio.com/wiki/Procedural_Textures

        // Control size
        w = WINDOW_WIDTH;
        h = WINDOW_HEIGHT;

        // Control position
        x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]); // Near the right side of the screen
        y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)]); // Centers the bar vertically
    };

    class fuel: RscPicture
    {
        idc = 9001; // Id for this control
        moving = 1; // Control will be moved when the display is dragged
        
        text = "#(argb,8,8,3)color(1,1,1,0.7)";
        
        #define FUEL_WIDTH WINDOW_WIDTH * 0.5// 50% width of background
        #define FUEL_HEIGHT WINDOW_HEIGHT * 0.95// 95% height of background

        // Control size
        w = FUEL_WIDTH;
        h = FUEL_HEIGHT;

        // Control position
        x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]) + ((WINDOW_WIDTH / 2) - (FUEL_WIDTH / 2));
        y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (FUEL_HEIGHT / 2)]) + ((WINDOW_HEIGHT / 2) - (FUEL_HEIGHT / 2));
    };
};
crude berry
#

getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)] vs getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (FUEL_HEIGHT / 2)] - different defaults 🍿

loud flame
#

I guess I never fixed it for the y position

#

Yep, that's what was causing the 6 pixels offset
Thanks a ton thumbsup

#

Now to make it actually do something and not just look there and be pretty lol

loud flame
#

Just need to fix it showing up for every player when just one person activates it
It was because I copy/pasted a function call for CBA_fnc_globalEvent but forgot to change it to local

loud flame
#

How can I hide a display without closing it?

#

I saw that someone was using <layer> cutRsc ["default", "PLAIN", 0.5]; to hide an element, but that still seems to "delete" it

#

Actually I think it might have just been because of how I was creating it Nope, I had the display saved to a mission namespace variable and thought that since I wasn't setting the variable to the new display, that's why it wasn't showing up.

loud flame
#

What do the last two values in CfgUIGrids >> IGUI >> Presets >> Arma3 >> Variables >> variableName mean?

#define WINDOW_WIDTH 0.025
#define WINDOW_HEIGHT 0.3
...
class Variables
{
    // Default values (roughly on the right side of the screen)
    BNA_KC_Jet_Grid_jetpackFuel[]=
    {
        
        {
            safeZoneX + WINDOW_X * safeZoneW, // Default X pos
            (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2), // Default Y pos
            WINDOW_WIDTH, // Width
            WINDOW_HEIGHT // Height
        },
        "(((safezoneW / safezoneH) min 1.2) / 40)", // ?
        "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)" // ?
    };
};
loud flame
#

I thought it might have been the sizes for the preview in the "Customize Layout" menu, but after swapping the values as a test, nothing changed

loud flame
#

Asking since I'm trying to figure out why my texture (32px x 256px) is appearing distorted

crude berry
#

distorted?

loud flame
#

The height and width are swapped, second attachment is the image file

loud flame
#

I tried deleting the values, just to see if anything changed but there wasn't anything that I noticed

crude berry
#

this texture doesn't look distorted, though?

loud flame
#

Yeah, it's just the preview that's distorted

crude berry
#

i mean the stuff on the screen is preview

loud flame
crude berry
#

if you mean this - it kinda looks like you have extra class or something with similar popup hint blobdoggoshruggoogly

loud flame
#

Had to omit some code from the beginning of BNA_KC_Jet_Dialog to make it all fit

class RscTitles
{
    class RscPicture;
    class BNA_KC_Jet_Dialog
    {
        ...
        controls[] =
        {
            "background",
            "fuel"
        };

        // See https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Controls
        class background: RscPicture
        {
            idc = 9000; // Id for this control
            moving = 1; // Control will be moved when the display is dragged
            
            text = "#(argb,8,8,3)color(0,0,0,0.7)"; // Procedural texture - https://community.bistudio.com/wiki/Procedural_Textures

            // Control size
            w = WINDOW_WIDTH;
            h = WINDOW_HEIGHT;

            // Control position
            x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]); // Near the right side of the screen
            y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)]); // Centers the bar vertically
        };

        class fuel: RscPicture
        {
            idc = 9001; // Id for this control
            moving = 1; // Control will be moved when the display is dragged
            
            text = "#(argb,8,8,3)color(1,1,1,0.7)";
            
            #define FUEL_WIDTH WINDOW_WIDTH * 0.5// 50% width of background
            #define FUEL_HEIGHT WINDOW_HEIGHT * 0.95// 95% height of background

            // Control size
            w = FUEL_WIDTH;
            h = FUEL_HEIGHT;

            // Control position
            x = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_X", safeZoneX + WINDOW_X * safeZoneW]) + ((WINDOW_WIDTH / 2) - (FUEL_WIDTH / 2));
            y = (profileNamespace getVariable ["IGUI_BNA_KC_Jet_Grid_jetpackFuel_Y", (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2)]) + ((WINDOW_HEIGHT / 2) - (FUEL_HEIGHT / 2));
        };
    };
};


// UI Grids, used to let the player move the jetpack hud element
class CfgUIGrids
{
    class IGUI
    {
        class Variables
        {
            class BNA_KC_Jet_Grid_jetpackFuel
            {
                // Variable for saving the position of the UI control
                displayName = "Jetpack Fuel";
                description = "Fuel display for jetpacks";
                preview = "\BNA_KC_Gear\Jetpacks\Data\Textures\UI\BNA_KC_Jet_Dialog_Preview.paa";
                saveToProfile[] = {0, 1};
                /*
                0: Save X coordinate
                1: Save Y coordinate
                2: Save width (if resizing is allowed)
                3: Save height (if resizing is allowed)
                */
            };
        };

        class Presets
        {
            class Arma3
            {
                class Variables
                {
                    // Default values (roughly on the right side of the screen)
                    BNA_KC_Jet_Grid_jetpackFuel[]=
                    {
                        
                        {
                            safeZoneX + WINDOW_X * safeZoneW, // Default X pos
                            (safeZoneY + (safeZoneH / 2)) - (WINDOW_HEIGHT / 2), // Default Y pos
                            WINDOW_WIDTH, // Width
                            WINDOW_HEIGHT // Height
                        },
                        "(((safezoneW / safezoneH) min 1.2) / 40)", // ???
                        "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)" // ???
                    };
                };
            };
        };
    };
};
#

But that's the whole config for my display and the variable for the placement of it

crude berry
#

still wut

#

there are two supposed "Jetpack Fuel" indicator previews on the screenshot. One looks alright. Other doesn't. If you only have one instance in the mod you're loading right now - where does the second come from? Maybe actually checking classes in-game with config viewer can show something blobdoggoshruggoogly

loud flame
#

There's only one preview, the actual display just doesn't dissapear when pressing escape (not 100% sure why, haven't looked into it yet)

#

If I drop it, so that the hud goes away, there's just the one

crude berry
#

so now it's only the red one with seemingly correct x/y coords? Cute

loud flame
#

It's just red because I highlighted it
It does use the correct coords, if I move the preview around and then re-open the display, it starts at the top left corner of the preview

#

Also I just moved the preview around so that it wasn't off-screen

crude berry
#

and what are actual values of the variables in profileNamespace if you nil them and restart the game?

opaque crag
#

Nothing, it deletes the data.

#

nil enough vars and the file should get smaller.

crude berry
#

restarting the game after nil-ing should populate them with default values, though? At least it does for ["igui_grid_custominforight_w", "igui_grid_custominforight_h", "igui_grid_custominforight_x", "igui_grid_custominforight_y"] on my machine?

opaque crag
#

oh, those variables

crude berry
#

yeah, that can of worms

loud flame
crude berry
#

and _w/_h?

#

because game seems to save them even for the vars that only have {0,1} to save meowsweats

loud flame
#

Seems odd that it would save it, I'll check it though, re-opening arma

crude berry
#

like here's left custom info panel after manually increasing its _w variable:

#

even when it has saveToProfile[]={0,1}; canResize=0; and can't be resized back by hand 🙃

#

(although i needed to try it for width change to take effect)

loud flame
#

I don't get any kind of output when trying to check "IGUI_BNA_KC_Jet_Grid_jetpackFuel_w / _h

#

Not even checking with isNil

crude berry
#

can you please check on a separate/new profile then?

loud flame
#

Still no output, but it does seem to have just been a weird issue on my profile, because it displays correctly on the new one

#

So I guess somehow I saved those variables to my profile while working on it?

crude berry
#

should still be workable as all you really care for are the coordinates of top left corner 🙃

loud flame
#

Yeah, I might try and go digging around to fix them manually for my profile

#

Not a huge deal though, although I did also realize that my math for the default X coordinate is off

crude berry
#

i mean "5% left from the right screen border" sounds like a pretty workable default for a bar that should be "somewhere right-ish"

loud flame
crude berry
#

turbowut

loud flame
#

WINDOW_X is 0.95 and safeZoneX + WINDOW_X * safeZoneW is used for the x position in every case

crude berry
#

well, the values worked alright to display the actual GUI

loud flame
#

Yeah, should be like -safeZoneX right?
At least based off this reference I found on the forums

crude berry
#

safezoneX = left side of the screen (and it should already be negative); safezoneX + safezoneW = right side of the screen.

#

like ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40)) is one of the default values

#

last 🧠 move i can think of would be to manually replace all macro entries in the config with their proper values and get them in double quotes, as all vanilla definitions seem to do that (i.e. https://sqfbin.com/uyuxukocaweruqomucuq) meowsweats

loud flame
#

Wouldn't they always just be replaced with the values, unless you were looking at the raw .cpp files?

crude berry
#

yeah, that's probably a brainfart of mine

rose wadi
#

is there a way to modify this message

#

to tell the user what to do

unkempt cliff
verbal mauve
# unkempt cliff this comes a bit late but I would make my own check to see if the addon is prope...
#

If yes, mind if I use your script in a mod I'm developing?

unkempt cliff
opaque lynx
#

Q: I have a scenario in which, some CT_LISTNBOX vertical scrollbar width are edging into the x coordinates of some neighboring controls.
I wonder, what is the 'default' width and height for scrollbars, and how best to accommodate this scenario so that I do not lose the left edges of neighboring controls.
thanks...

quiet arrow
#

Isn't there a width defined in Class Scrollbar {};

opaque lynx
#

well, there "is" but most of them appear to be 0. so hence what is the default A3 minimum width?

#

but moreover, how come the scrollbar geometry leaks over the w of the control? interferes with neighboring x dimensions.

#

or at the very least I need some comprehension defining what that leakage is in order to make appropriate adjustments on my part.

opaque lynx
loud flame
#

Not sure where my post that I made earlier went but:

How can I make my UI element get hidden when the user presses backspace in zeus, camera, etc. when all of the other elements are?

outer oar
#

henlo my guys i am searching for an arrow without a tail (facing preferably right) image in the base game files would anybody happen to have the magical file path to this

#

surprised theres not a list of commonly used base game images tbh

quiet arrow
#

Use 3den Enhanced Texture Finder or a similar mod to search for icons and images.

outer oar
#

ah roger doger thanku

fast prism
#

What is the syntax to pass a variable into a script-created GUI event handler such as:

_testVar = "Yadda yadda";
(_myCtrlVar displayCtrl 4321) ctrlSetText "Ok";
(_myCtrlVar displayCtrl 4321) ctrlRemoveAllEventHandlers "MouseButtonClick";
(_myCtrlVar displayCtrl 4321) ctrlAddEventHandler ["ButtonClick","[_testVar] call fnc_myFancyFunction;"];

In the target function I just get any. I'm assuming that it has to do with proper use of quotation and have tried various versions.

quiet arrow
#

Set the variable in the control's or display's namespace instead

fast prism
#

Ah, thanks.

quasi granite
# fast prism What is the syntax to pass a variable into a script-created GUI event handler su...

for numbers and strings there is also the solution to use format:

_testVar = "Yadda yadda";
(_myCtrlVar displayCtrl 4321) ctrlSetText "Ok";
(_myCtrlVar displayCtrl 4321) ctrlRemoveAllEventHandlers "MouseButtonClick";
(_myCtrlVar displayCtrl 4321) ctrlAddEventHandler ["ButtonClick", format ["[%1] call fnc_myFancyFunction;", _testVar]];
``` but my personal opinion on that is somewhere between 🤨 and 🤮
fast prism
fast prism
#

When looking at various dialog structures, I see that sometimes background elements are in

class controlsBackground {};
``` and sometimes they're lumped into 
```sqf
class controls {};
``` Is there a compelling reason to have them in `controlsBackground`?  They seem to function the same either way.
quiet arrow
#

Background controls are in the background, that's the difference.

#

If you have problems with static texts being drawn in front of controls the user interacs with, then move them to controlsBackground.

fast prism
#

Ok, so it's more of a layer control issue.

tight flare
#

Does anyone know where the RotorLib gauges are stored within the arma code?

tight flare
#

I’ve been searching through PBOs and I’m so lost

tight flare
#

I made some progress, but now I’m at another block.

#
                {
                    idc=147;
                    x="29.5 *                     (            ((safezoneW / safezoneH) min 1.2) / 40)";
                    y="2.5 *                     (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
                    w="8 *                     (            ((safezoneW / safezoneH) min 1.2) / 40)";
                    h="1 *                     (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
                    tooltip="$STR_A3_RSCDISPLAYGAMEOPTIONS_RTDTEXTSHOWGAUGES_TOOLTIP";
                };```
#

I’m trying to find the code within GUI that toggles the “show gauges” option from grey to the normal menu color.

#

I specifically want to re-write the code so that the “show gauges” option is not affected by the code that greys out all of the advanced flight options.

loud flame
quiet arrow
#

I depends how you UI elements are added and how the original functions hides the controls

#

usually it's something like

#

allControls _display apply {_ctrl ctrlShow false;}

#

If you controls are part of the display that calls that function they will automatically get hidden.

#

What you could do is add another keyDown EH and when it's pressed, check if controls are visible and if not, hide yours als well

static stone
#

Hello! Does anyone happen to know what IDD the weapon cursor belongs to? I'm trying to write a function that will edit the control, but am having a difficult time locating it.

distant axle
#

I don't think a cursor is a regular GUI element

loud flame
#

Or could I just check if the whole display is hidden?

quiet arrow
#

The display won't be hidden. Its the control's.

#

I check a control that cannot be hidden except with backspace.

spice drift
#

Anyone have any idea where I might find the watch UI in the Config Viewer?

burnt token
#

It's an animated object.

#

IIRC it's RscWatch in config root.

mental trench
#

is there any template for a simple mod?
I would for exapmle activate some pp effects to the night vision... And i just dont know how to make it to a mod file

static stone
opaque lynx
opaque lynx
quiet arrow
#

You are right. It's path in both cases and the examples don't make that clearer. Will fix that when I am back home

distant axle
#

Sanity check, we have no way to adjust Z position of a 2D control?

burnt steeple
#

I mean kinda. If x is left,right and y is up and down. Then z would be forward and back. Basicly what pice of ui element would be in front of another ui element.

quiet arrow
#

The order of creation is what defines that I believe. Perhaps something like ctrlShow /ctrlSetFade 1 changes it?

loud flame
distant axle
#

allControls

loud flame
#

I just mean all of the ones showing on the screen, not just a given display

#

I know I could just loop over allDisplays and then allControls _x, but doesn't that also give controls that are hidden?

distant axle
loud flame
#

Oh it quite literally gives the exact layers I was going to check for, "3DENDisplays_displays" and "CuratorDisplays_displays"

#

I'd need the camera one as well, but if I had to guess it'd just be under "GUI_displays"

opaque lynx
#

Q: the URL escapes me, but I am pretty sure there is a BIS wiki page for keyboard definitions and such. and/or maybe it was a CBA thing that the definitions were made, I'm not positive that much. just looking for the definitions, better yet an actual .hpp I may consider utilizing. thanks...

opaque lynx
opaque lynx
#

Q: about EH such as onKeyDown+onKeyUp, whether I process the key event, then the function should return what? true? false? thanks...

quasi granite
quasi granite
opaque lynx
opaque lynx
#

got it. thanks...

opaque lynx
#

also need a bit of guidance... I have some 4 or so different CT_EDIT controls, each of which can 'see' a DIK_NUMPADENTER key event. but I do not want for the key states to get out of sync necessarily, especially over the whole display...

actually, delay that... onSetFocus+onKillFocus should clear the EH slate for each of the controls. perhaps seems like the better thing to do, as opposed to, for instance, keeping a DISPLAY state.

vale geode
#

Anyone able to point me in the direction of how to 'scroll down' the ST_Multi with a button press rather than a keyDown?
I have a UI where the text is multiline and it seems counter intuitive to have to click into the box and press the down arrow to read it all. I've got 2 buttons for up and down I'd like to use but not sure how to actually move the focus down

opaque crag
#

ctrlSetScrollValues

#

I'm not sure if other controls than those listed can have scrollbars. If that's an issue then you could just wrap them in a ControlsGroup.

sullen locust
#

I'm looking for a modder who's willing (commisioned) and able to make a small mod that overhauls the ace medical unconscious screen. I've tried doing it myself but no luck unfortunately. Not sure if this is the right place btw. meowsweats Just trying to find the right ppl.

mental trench
#

Anyone know how I can define my own grid using Pixel Grid System?

#

I want to create dialogs that can look and stay the same across all aspect ratios.

mental trench
unkempt cliff
mental trench
cunning arrow
#

onEditChanged is a welcome surprise in 2.14

quiet arrow
#

Yep, very nice one

cunning arrow
#

Always had to use onKeyUp but this has certainly helped out for updating edits

hoary estuary
#

How do I edit RscEdit border color? Can't seem to figure it out looking at config.

#

I actually need to edit caret color, it seems to use border color.

tranquil iron
#

Same as the border

hoary estuary
#

Seeing this right now

blazing yacht
#

How i can custom sroll action menu. I want to move position, can you tell me how. Sorry, I'm not good at English.

tranquil iron
#

Options -> Gameplay -> Layout

blazing yacht
#

I want like this

tranquil iron
#

yeah you can do that

blazing yacht
#

Preset Arma?

tranquil iron
#

you can drag it from the left

blazing yacht
#

How to export for sqf file?

#

I want to use for my altis life server

#

I want like same exile

#

@tranquil iron

tranquil iron
#

@blazing yacht

blazing yacht
#

What do I have to do to use it in the server?

tranquil iron
blazing yacht
#

How i can move a position of scroll menu in Altis life to be like exile , Sorry if reading this is confusing, I'm not good at English. @tranquil iron

outer oar
#

does config hierarchy matter for gui elements? i.e if i have an arm and then icons on that arm that i show/hide by idc, can i have those icons nested within the arm's class for organisation's sake? no

mental trench
#

How do I get the control of a dialog that has no IDC?

        class BLUFOR_Picture : RscPicture 
        {
            text = "a3\ui_f_orange\data\displays\rscdisplayorangechoice\faction_nato_ca.paa";
            x = HORZ_CENTER - GRID_W( 15 / 2 );
            y = VERT_CENTER - GRID_H( 15 / 2 );
            w = GRID_W( 15 );
            h = GRID_H( 15 );           
            onLoad = "(_this # 0) ctrlSetTooltipColorShade [0,0,0,1];";
            tooltip = "Play as west faction";
        };
tranquil iron
hoary estuary
#

How does Debug console do it? Can't seem to make border and caret to be full color.

#

Tried ctrlSetPixelPrecision but no luck

#

Pictured is colorText[] = {1,0,0,1}; yet border and caret are half transparent

#

Also tried shadow = 2;, no result

#

Is there some hardcoded magic going on for Debug console fields?

hoary estuary
#

Noticed that one of my RscEdits also has full border and caret color and I have no idea how its done thonk

opaque crag
#

If you change the colour of that one to red, how does it look?

hoary estuary
#

Noticed that border becomes thinner depending on Y position (have several RscEdit elements and they're inside controls group)

opaque crag
#

The upper and lower borders there are a different colour from the left border and the caret.

hoary estuary
#

Yeah, top and bottom are full color on other elements or depending on scroll position

#

Tried adding some numbers to original problematic RscEdit's x and y and there seem to be no change

#

Bigger font too, still half-transparent

#

Tried x=0; y=0;, same picture

#

All possible combinations of colors, copied stuff line by line from my other control, still no idea what's going on

opaque crag
#

Are you running any FSAA or display scaling?

hoary estuary
#

No FSAA

#

If you mean Windows UI scaling, then yes. Still, all these example are under same environment

opaque crag
#

Nah, that thing where you render at a different resolution to the display resolution. I think it's rarely used for Arma.

hoary estuary
#

Its at 100%

opaque crag
#

I guess the UI might actually have subpixel blending and things aren't properly aligned here.

#

Not sure exactly how wide those hairlines are supposed to be.

#

but then the colour difference is still crazy :P

hoary estuary
#

Did ctrlSetPosition with long and slow ctrlCommit, control moves yet looks the same

#

It is indeed seems to be an issue of lines being drawn sub-pixel, but I can't figure how why other controls are fine and this one isnt

#

No luck with ctrlSetScale and weird values

outer oar
#

is there any way to change order of controls in the gui editor or do i be out of luck

outer oar
#

didnt see that one, thanks 😄

#

ah rscpicture still hides it anyway

outer oar
#

Can't seem to display my rsctitle, anyone mind giving it a look?
Config: https://pastebin.com/jmGAehym

What I'm doing:

("KJW_Sticker" call BIS_fnc_rscLayer) cutRsc ["KJW_MedicalExpansion_Core_bagSticker", "PLAIN"];

private _display = uiNamespace getVariable ["KJW_Sticker", displayNull];
if (isNull _display) exitWith {systemChat "Doesn't exist."};

{
    private _control = _display displayCtrl _x;
    _control ctrlSetText "HELLO";
} forEach [2120,2121,2122,2123];```

Image to show it's the right classname:
solid gyro
outer oar
#

ah, thx

#

still doesnt show but now complains of this which makes sense

#

oh probably because of duplicate classes

#

nope, still doesnt show after fixing that

solid gyro
#

So its waiting .paa, not text for that

#

take 2123 away from array and test again

outer oar
#

yeah i know that part

#

it just doesnt show at all even when i note out the settext stuff

solid gyro
#

Aa

#

Okey

outer oar
#

is the attributes class required inside each gui element?

#

(and adding a duration with cutrsc doesnt work)

solid gyro
#

Did you change that and that works?

outer oar
#

no its still not showing

outer oar
#

even with a duration in the cutrsc line

#

importing into gui editor returns this error too

#

except all the elements are there

#

though are all the same huge size

#

nvm thats because i forgot to set the params properly in the thingy bob

outer oar
#

still stuck on this, current config version:
https://pastebin.com/zHE29sBf

current code:

disableSerialization;

("KJW_MedicalExpansion_Core_bagSticker" call BIS_fnc_rscLayer) cutRsc ["KJW_MedicalExpansion_Core_bagSticker", "PLAIN", 1, true];

private _display = uiNamespace getVariable ["KJW_MedicalExpansion_Core_bagSticker", displayNull];
if (isNull _display) exitWith {systemChat "Doesn't exist."};

{
    private _control = _display displayCtrl _x;
    _control ctrlSetText "HELLO";
} forEach [2120, 2121, 2122];```
#

holy fuck im such a goober i forgot to include the base game defines

#

however... rscpicture is hiding rsctext stuff, how 2 fix

burnt steeple
outer oar
#

i have done it its just ordering them with idc/config entry

#

one of the two

quasi granite
#

the order of the entries in the config determines the layer

#

also interactible elements will always be moved to the front when interacted with

outer oar
#

is there any way to make rscpicture go behind rsctext in the gui editor or am i just going to have to lump it there

#

it is quite annoying because im just trial and erroring rn

#

(shifting the order in the list dont work)

outer oar
manic flame
#

Hi, I am trying to make a custom leaflet to show at players. Arma 3 leaflets are 722 x 1024,but thats not a size compatible with .paa files, or atleast not the gruppe adler converter.

Any ideas on how can I get around this?

#

I tried using the ArmA tools "imageToPAA" but its erroring.

outer oar
#

needs to be power of 2

#

are you sure arma leaflet textures are in paa format

manic flame
#

Yes! That's what the official biki says.

outer oar
#

that doesnt mean theyre in that format

opaque crag
#

CO10 Escape does this. I checked their leaflet file and it's 1024x1024 PAA with horizontal centering

manic flame
#

By the way I figured it out, If I used TexView2 i can export it as .paa without issues.

tranquil iron
#

you can make it 512x1024 or 1024x1024

tranquil iron
#

If you do wrong size it'll be broken, most likely wrong color mess

manic flame
#

1024 x 1024?

#

If I make a transparent background it'll still look good right?

tranquil iron
#

I think the edges will be cut off, so you can hide some easter eggs there

opaque crag
#

I think it just only renders the middle pixels.

outer oar
#

just make sure it is _ca

#

no wait

#

ignore me there

#

edges being cut off anyways

tranquil iron
#

leaflets aren't transparent 😄

manic flame
outer oar
#

they are if you can see through them

#

yes you can have transparent edges

opaque crag
#

Although in this example the borders are zero alpha I think.

outer oar
#

this is the icon i use for my mod, note its 1024x1024 but is not 1024 vertically

manic flame
#

mk that works

hoary estuary
# hoary estuary

Getting back to this issue, is it possible to make ctrlSetPixelPrecision affect border and caret drawing? Don't think it will break much and I'm pretty sure having constantly solid border and caret is a good thing in all cases. @tranquil iron

#

If this is feasible, I'll make a ticket

polar bronze
#

Are we able to color the perlin noise, or use colormap such as rainbow to the 2d perlin noise? I'm just wondering if we will be able to mimic the weather radar based on weather values we can get.

#

So that we can make weather radar image and use it as UI texture on screen

#

Since it is gui, pixel by pixel computation would also work, but I'm worried that the computation will take a lot of time even it is run occasionally.

tranquil iron
#

Or well, it should draw a 3pixel wide line. I could make it 4 pixel?
The border itself has pixelPrecision on by default, but the border could potentially be clipped because the clipping of outer bounds is not pixel precise

tranquil iron
ocean terrace
#

Is it possible to format a rsctext? I'm looking to format it at least on opening with something displaying the number of magazines in a players inventory.

quiet arrow
#

Use RscStructureText.

crude berry
#

or is it about "can i do something like format ["Hello %1!", "World"]; with Structured Text"?

ocean terrace
#

Hoping to get the title of a listbox display this stuff.

 format["[%1 Wood, %2 Scrap, %3 Nails, %4 Concrete]",({_x == "NMIB_WoodPlanks_Itm"} count (items player)),({_x == "NMIB_ScrapMetal_Itm"} count (items player)),({_x == "NMIB_WoodNails_Itm"} count (items player)),({_x == "SLAY_concrete"} count (items player))]
#

But I don't know jack about UI, and my buddy who made the listbox for me several years ago is MIA to assist me.

quiet arrow
#

A listbox has no title, it only has text per entry. And these are just stupid text which cannot be formatted.

#

Can you share a screenshot of the UI?

ocean terrace
#

yep 1 min

#

How can I share the image here?

quiet arrow
#

use imgur or so

ocean terrace
#

Messy I know, I don't know how to make columns either.

quiet arrow
#

Looks like a RscEdit control to me

ocean terrace
#

Like the title part does?

#
    class RscText_1000: RscText
    {
        idc = -1;
        text = "Furnishing Menu"; //--- ToDo: Localize;
      x = 0.314375 * safezoneW + safezoneX;
        y = 0.302 * safezoneH + safezoneY;
        w = 0.37125 * safezoneW;
        h = 0.033 * safezoneH;
    };

I got this in the .hpp, but again all this is above me skill set, a buddy assembled this for me a long while ago, I'm getting around to changing it to material cost instead of money so I'm dusting it off to modify it lol.

quiet arrow
#

This is the window Title.

#

This is what you wanna format?

ocean terrace
#

Ye, hoping to make it have the numeric amount of materials on the player to the right of the title

#

"Furnishing Menu - [15 Wood, 0 Scrap, 0 Nails, 0 Concrete]"

quiet arrow
#

I see

#

you just need to change the text of the control when the display is loaded.

#

_ctrlTitle ctrlSetText format ["Furnishing Menu - [%1 Wood, %2 Scrap, %3 Nail, %4 Concrete]", _wood, _scrap, _nails, _concrete];

#

Do you know how to get the amount of the materials?

ocean terrace
#

I'm using this, but I don't know if its the best possible method to do so.

({_x == "NMIB_WoodPlanks_Itm"} count (items player)),
({_x == "NMIB_ScrapMetal_Itm"} count (items player)),
({_x == "NMIB_WoodNails_Itm"} count (items player)),
({_x == "SLAY_concrete"} count (items player))
#

it returns right in the debug console

#
 format["[%1 Wood, %2 Scrap, %3 Nails, %4 Concrete]",({_x == "NMIB_WoodPlanks_Itm"} count (items player)),({_x == "NMIB_ScrapMetal_Itm"} count (items player)),({_x == "NMIB_WoodNails_Itm"} count (items player)),({_x == "SLAY_concrete"} count (items player))]
#

prints: "[15 Wood, 0 Scrap, 0 Nails, 0 Concrete]"

quiet arrow
#

Looks good.

#
_ctrlTitle ctrlSetText format["Furnishing Menu - [%1 Wood, %2 Scrap, %3 Nails, %4 Concrete]",({_x == "NMIB_WoodPlanks_Itm"} count (items player)),({_x == "NMIB_ScrapMetal_Itm"} count (items player)),({_x == "NMIB_WoodNails_Itm"} count (items player)),({_x == "SLAY_concrete"} count (items player))]
#

so now your title control just needs an idc

#

idc = -1;

#

Change -1 to a unique number.

#

does the display have an IDD?

ocean terrace
#

Gonna go with 133702 since the UI has 1337

quiet arrow
#

What else 🤣

#
findDisplay 1337 displayCtrl 133702 ctrlSetText format["Furnishing Menu - [%1 Wood, %2 Scrap, %3 Nails, %4 Concrete]",({_x == "NMIB_WoodPlanks_Itm"} count (items player)),({_x == "NMIB_ScrapMetal_Itm"} count (items player)),({_x == "NMIB_WoodNails_Itm"} count (items player)),({_x == "SLAY_concrete"} count (items player))];

Execute this in the script where you also fill the edit control.

#

Should work if I didn't do some typo.

ocean terrace
#

Think i got it in the right spot, gonna try

#

😄

#

Ty m8.

quiet arrow
#

First try. Nice one.

#

Yw

ocean terrace
#

Would you happen to know if its possible to split the lines of the listbox? Sorry to jump to the next thing lmao.

quiet arrow
#

There is no listbox

#

It's just a simple input box from what I can tell.

ocean terrace
#
    class RscListbox_1500: RscListbox
    {
        idc = 1;
        x = 0.319531 * safezoneW + safezoneX;
        y = 0.346 * safezoneH + safezoneY;
        w = 0.360937 * safezoneW;
        h = 0.374 * safezoneH;
      onLBDblClick = "execVM 'scripts\Damian\buyObject.sqf';";
      class ListScrollBar
      {
        color[] = {1,1,1,1};
        thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
        arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
        arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
        border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";

      };
    };
#

got this in the .hpp

quiet arrow
#

Oh

#

So that's how it's done

#

You can't add a line break there if that's what you mean.

ocean terrace
#

I'm hoping to maybe split them in half left to right so I can make the title of the actual object appear maybe aligned to the right and the recipe text to the left

#

idk if thats possible tho

#

right about where the --- is on the screenshot

quiet arrow
#

That's not as easy

#

Imho a tree view or listNBox would be the way to got.

ocean terrace
#

I glanced the listnbox wiki page but I was looking at it like a unthawed caveman seeing a piece of technology for the first time

#

I tried to swap the above listbox to "listnbox" at the end of the class name but i didn't get off so lucky.

quiet arrow
#

The entire code would need to get rewritten for it.

ocean terrace
#

Oooff.. Yeah it likely won't happen then, I'm already messing with things above my skillset.

#

If my buddy didn't hook me up with this years ago i wouldn't even have this much

#

I'm surprised I managed to get the lines to appear differently in the list vs the actual craftable stuff, that was like a nasa probe landing successfully to me

quiet arrow
#

Just try it and post here if you need help.

ocean terrace
#

Thanks for the help m8 with the title stuff, I'll try the listnbox eventually, I tried swapping the current one over to it but yeah it gave me errors.

ocean terrace
#

Hey @quiet arrow, regarding that menu you assisted me with last night.

Do you think its possible to change indiviual line colors on the interface?

I'm considering making ones that the player can't afford turn red and the ones they can as green.

quiet arrow
#

That's possible

#

LbSetColor iirc

hoary estuary
hoary estuary
#

In my problematic control both border and caret are always drawn sub-pixel

#

This RscEdit is not scrollable though, but it will probably change to full pixel if scrolled

#

Can't see it being 3 pixel wide, feels like 1 pixel wide line that turns into opaque 2 pixel line depending on sub-pixel position

hoary estuary
ocean terrace
#

like you taught me last night

quiet arrow
#

Shouldn't it already have one?

ocean terrace
#

Hmm.. leme see

tranquil iron
hoary estuary
# tranquil iron I don't think I can solve that.

This behaviour is expected and fine, I was just pointing that borders are still sub-pixel in that exe you linked, and that maybe ctrlSetPixelPrecision should be taken into account when drawing these

#

Or at least for caret, because its really hard to see in some font and size combinations

tranquil iron
#

" should be taken into account when drawing these" it already is.
Or rather, its forced on and you can't turn it off

hoary estuary
#

Unless forced on means no rounding

exotic blade
#

Anyone has ever tried using onMouseButtonClick for example on an CT_BUTTON control? I can't seem to make it work 🤔

#

onButtonClick works fine, but it doesn't give me the extra modifiers 🙃

unkempt cliff
exotic blade
#

This is in config, so it should be there.

exotic blade
# quiet arrow Works fine

hmm... might be because I'm using it as part of CT_LISTNBOX then 🤔
thx for testing it, ill try something else then.

keen wyvern
#

so where are the modding tools for gui i cant find them in the pinned links perhaps i just didnt notice it?

quiet arrow
#

Modding tool?

distant axle
#

I bet everyone who does UI just writes in text editor

zinc oriole
#

you can see when that first dialog opens after pressing the close button all the contents just load really slow

quiet arrow
#

Some bad scripting

zinc oriole
#

where can i find sqfbin again so i can post the code that behind that main first screen

quiet arrow
zinc oriole
quiet arrow
#

Are you sure this is only executed once?

#

put some diag_logs to see whats going on

zinc oriole
#

thats one other thing i was thinking abt

quiet arrow
#

if (profileNamespace getVariable ["MRTM_smallAnnouncerText", false]) then {
((findDisplay 8000) displayCtrl 2806) cbSetChecked true;
} else {
((findDisplay 8000) displayCtrl 2806) cbSetChecked false;
};

Why so complicated?

#

That whole script can be reduced to half its size

zinc oriole
#

? how come

quiet arrow
#

use the profileNamespace variable on the right side of cbSetChecked

zinc oriole
#

ah damn, thats indeeed a smart solution

quiet arrow
#

if ((getMissionConfigValue ["MRTM_enableGroups", 1]) != 1) then {
ctrlEnable [1605, false];
};
Same here

#

onKeyUp = "[_this select 0, _this select 1, 'drones',true] call MRTM_fnc_onChar;";

#

This could also be an issue. Does this change the view distance?

zinc oriole
#

yep the drone slider you see on that first gui is for that

quiet arrow
#

Check with some diag_log that this is not executed multiple times when the UI is opened.

#

Also, instead of onChar you might wanna consider the new EditChanged Event Handler. Much better

zinc oriole
#

hm seems i foudn the issue somewhere, the logging on whe the menu opens logged almost 18000 times in less ythen 3 seconds meowsweats

quiet arrow
#

🤣

#

Which brings us back to

Some bad scripting

zinc oriole
#

yep

#

i must ve left it in a loop somewhere

quiet arrow
#

First I'd make sure to add the Event Handlers to the controls after the UI was set up.

#

Because adding text to edit boxes for example, triggers their EH.

#

Same for checkboxes, so you might already run into a loop there.

zinc oriole
#

im just gonna add debugs so i know from where the call of the script is done

shell acorn
#

I'm returning to GUI design after a number of years and I'm getting resource openRscAssetIdentificationDialog not found
Description.ext

#include "\a3\ui_f\hpp\definecommoncolors.inc"
#include "\a3\ui_f\hpp\definecommongrids.inc"
#include "\a3\ui_f\hpp\defineresincl.inc"

#include "include\defines.hpp"
#include "include\RscAssetIdentificationDialog.hpp"```
RscAssetIdentificationDialog.hpp

class RscAssetIdentificationDialog
{
idd = 1337;
class controls
{
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by J. Hachi, v1.063, #Zediwu)
////////////////////////////////////////////////////////

    class baseFrame: RscFrame
    {
        idc = 1800;
        x = 0 * GUI_GRID_W + GUI_GRID_X;
        y = 0 * GUI_GRID_H + GUI_GRID_Y;
        w = 40 * GUI_GRID_W;
        h = 25 * GUI_GRID_H;
    };
    class vehicleTypePicture: RscPicture
    {
        idc = 1200;
        text = "#(argb,8,8,3)color(1,1,1,1)";
        x = 8 * GUI_GRID_W + GUI_GRID_X;
        y = 3.5 * GUI_GRID_H + GUI_GRID_Y;
        w = 31.5 * GUI_GRID_W;
        h = 21 * GUI_GRID_H;
    };
    class vehicleGroupComboBox: RscCombo
    {
        idc = 2100;
        x = 0.5 * GUI_GRID_W + GUI_GRID_X;
        y = 3.5 * GUI_GRID_H + GUI_GRID_Y;
        w = 7 * GUI_GRID_W;
        h = 1 * GUI_GRID_H;
    };
    class titleStructuredText: RscStructuredText
    {
        idc = 1100;
        x = 0.5 * GUI_GRID_W + GUI_GRID_X;
        y = 0.5 * GUI_GRID_H + GUI_GRID_Y;
        w = 39 * GUI_GRID_W;
        h = 2.5 * GUI_GRID_H;
    };
    class vehicleClassComboBox: RscCombo
    {
        idc = 2101;
        x = 0.5 * GUI_GRID_W + GUI_GRID_X;
        y = 5 * GUI_GRID_H + GUI_GRID_Y;
        w = 7 * GUI_GRID_W;
        h = 19.5 * GUI_GRID_H;
    };
    ////////////////////////////////////////////////////////
    // GUI EDITOR OUTPUT END
    ////////////////////////////////////////////////////////
};

};```

#

do I need to have

#include "include\RscAssetIdentificationDialog.hpp"``` inside a config class in the description.ext? RscTitles maybe?
distant axle
#

#include does only “dumb” copy and paste - which means where you do #include is important

#

AKA, if you have #include in your included file, it may do a double-declaration which is illegal

#

And, how do you try to open that?

shell acorn
#

createDialog "RscAssetIdentificationDialog";

#

I originally had #include "include\defines.hpp" inside RscAssetIdentificationDialog.hpp but moved it out to resolve an undefined class error

distant axle
#

Does your Config Viewer tells your mission's config?

#

If not, your config has an error so failed to compile/include into the mission

#

If yes, something else is broken... maybe

shell acorn
#

Just reopened it and it works

#

However its no longer at the center of the screen like it was showin in the GUI Editor

distant axle
#

Okay, it sounds like you forgot to Ctrl+S

#

Description.ext only reloads whenever it saves/loads

shell acorn
#

and I am unsure how to load my code back into the gui editor to edit further

shell acorn
quasi granite
shell acorn
#

Thank you @quasi granite

shell acorn
#

How do I go about setting a scrollbar's width so that I can choose the number of times it can scroll across? I'm trying to emulate a set number of pages

shell acorn
#

ah, yeah for sure

#

actually, the scrollbar is a slider

finite stratus
#

Hello community, I hope this is the right channel. In our group, we are experiementing with integrating Jeroen's Limited Arsenal into Liberation RX mod. That is basically original version from the github of the arsenal crate used in Antistasi where you can transfer from / transfer into stuff. Now, see bellow screenshot, the arsenal has ui issue, but only when it is opened with "transfer to" command...all other uses of this arsenal addon do not have the issue. Basically, we are seeing these white icons and as you move mouse, each one is individually revealed and hidden again. I guess it may have to do with this code from githug being out of date with someARMA ui changes. Anyone has any suggestion or had seen smth similar around? The functionality is however NOT affected. Thanks!

idle spruce
#

Can I add a PPEffect to a display itself? Say if I wanted to change the effects on the map display only.

distant axle
#

PPEffect does not do anything with a GUI

idle spruce
#

😦

opaque crag
#

@finite stratus Yeah I remember fixing that bug at some point after an Arma update.

#

I would strongly recommend starting from the Antistasi version because it has dozens of bugfixes. Should only be a couple of globals to fill in.

finite stratus
#

Thanks man, appreciate!

idle spruce
#

anyone have a script already to display the class name && idd/idc of displays/ctrls as they are created? Want to grab some menu displays.

quiet arrow
#

Just add mouseEnter EH to all controls of the display and print idc and classname.

solid gyro
# quiet arrow use pixelGridNoUIScale

Hello,
How do i use this to get correct position my gui.
its working correclty with 16:9 aspect ratio , but with all aspect rations.
(dont know yet what is screen resolutuin/ ascpect ration in picture because some of user just send bug report)
it should look like this.

distant axle
#

How did you defined them?

solid gyro
# distant axle How did you defined them?
        class GVAR(back): RscPicture {    
            idc = 120;
            style = 48;
            type = CT_STATIC;
            x = safeZoneX + safeZoneW - 2.8 * 3 / 4; 
            y = safeZoneY + safeZoneH - 1.6;
            w = 60 * GUI_GRID_CENTER_W;        
            h = 30 * GUI_GRID_CENTER_H;        
        };

picture (notebook)

//arrow right
            idc = 122;
            style = 48;
            text = QPATHTOF(images\brside\next.paa);
            tooltip = "Next";
            onButtonClick = QUOTE([1] call FUNC(browse));
            color[] = {0.9,0.9,0.9,0.9};
            colorActive[] = {0.2,0.2,0.2,0.2};
            colorDisabled[] = {1,1,1,1};
            x = GUI_GRID_CENTER_X + 37 * GUI_GRID_CENTER_W;    
            y = GUI_GRID_CENTER_Y + 24 * GUI_GRID_CENTER_H;         
            w = 4 * GUI_GRID_CENTER_W;            
            h = 1 * GUI_GRID_CENTER_H;    
//tabs right side
        class GVAR(home): RscActiveText {

            idc = 201;
            style = 48;
            text = QPATHTOF(images\brside\h.paa);
            tooltip = "Introduction";
            onButtonClick = QUOTE(['home'] call FUNC(tabs));
            color[] = {1,1,1,1};
            colorActive[] = {0.2,0.2,0.2,0.2};
            colorDisabled[] = {1,1,1,1};
            x = GUI_GRID_CENTER_X + 41.3 * GUI_GRID_CENTER_W ;    
            y = GUI_GRID_CENTER_Y + -3.5 * GUI_GRID_CENTER_H;         
            w = 1.5 * GUI_GRID_CENTER_W;            
            h = 1.5 * GUI_GRID_CENTER_H;        
        };
---> // rest just changhin 
            x = GUI_GRID_CENTER_X + 41.35 * GUI_GRID_CENTER_W ;    
            y = GUI_GRID_CENTER_Y + 14.5 * GUI_GRID_CENTER_H; 
distant axle
#

What is back? Why it uses safeZones instead of macro?

solid gyro
quiet arrow
#

You should use RscPictureKeepAspect or resize the image via script to correct aspect ratio

solid gyro
#

Hmm 🤔 how would I do that?

#

These are parts that I don't understand how to setup correctly

distant axle
#

Just inherit it instead of RscPicture

crude berry
#

given that image is used as a background for other UI elements - i'd say it's better to inherit basic RscPicture and tie its size to grid as well tanking

solid gyro
#

Hmm, seems it works when i use marcos , need test with 2k/4k and others too. Dont have all options on current pc.

        class GVAR(back): RscPicture {    
            idc = 120;
            style = 48;
            type = CT_STATIC;
            x = GUI_GRID_CENTER_X + -9.5 * GUI_GRID_CENTER_W ;    
            y = GUI_GRID_CENTER_Y + -4.7 * GUI_GRID_CENTER_H; 
            //x = safeZoneX + safeZoneW - 2.8 * 3 / 4; 
            //y = safeZoneY + safeZoneH - 1.6;
            w = 60 * GUI_GRID_CENTER_W;        
            h = 30 * GUI_GRID_CENTER_H;        
        };
distant axle
#

You actually can have multiple resolution/ratio only in your computer - it's called “windowed”

solid gyro
#

aaa

#

Thanks

#

Yeh, old in left corner and new center.
Thank you guys.
But do i need for future add some functio/ or something else to get picture always been correct position with tabs

opaque crag
#

Actual effect seems to be that regardless of where the mouse cursor currently is, pressing space on the keyboard refires the onButtonDown event for the previous control you clicked on?

#

Is this really intentional?

quiet arrow
#

I guess because it's still focused. Doesn't make sense though.imho

fallow raft
#

having some trouble coloring some HUD elements, probably a quick solution I'm missing as I'm very new to GUI. Trying to color this icon, however it doesn't seem like _TAG_Picture ctrlSetTextColor [57, 255, 255, 1]; does anything to the color

_TAG_Picture = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", 04102002];
_TAG_Picture ctrlSetPosition [(0.83 * safezoneW + safezoneX) - _ImageSize, (safeZoneY + safeZoneH * 0.95) - _ImageSize, safeZoneW * _ImageSize, safeZoneH * _ImageSize];
_TAG_Picture ctrlSetTextColor [57, 255, 255, 1];
_TAG_Picture ctrlSetAngle [0, 0.5, 0.5, false];
_TAG_Picture ctrlCommit 0;
hoary estuary
#

If you want it in 0-255 range in your code, do 57/255, 255/255, 255/255

fallow raft
#

oh I see

#

I knew it had to be something simple I was missing; I will try this

#

that worked! thank you

teal wraith
#

Hello, I'm trying to make a dialog that shows player profiles and I'd like it to include their character mugshots in a RscPicture. Can anyone help me with this?
I tried loading the images from CfgFaces /Man_A3, but that just shows textures.

ionic tundra
#

@teal wraith I don't believe there is are mugshot images that exist for every face option. You could create them yourself, or create a live camera looking at the players face

hoary estuary
#

Yeah, there are no mugshots in the game, you'll need to make it yourself.

#

ui2texture is powerful enough to do it, but it requires fairly advanced scripting

#
  1. Position player(s) you want to mugshot before a scripted camera
  2. Have a display with RscTexture that shows render2texture view of the camera
  3. ui2texture draw this display into a texture to use later elsewhere
#

Not sure about having proper mugshots of players with their custom faces and such, don't think you can replicate their head exactly with createSimpleObject, maybe you'll need to photo a real player unit

#

You probably can do some hacky stuff like local attachTo to pull them out of the game world for a mugshot

#

Since all this stuff is local client side each client will have to do it, so local attachTo hack might be problematic for local units

#

There is also a problem of resource streaming so you don't take mugshot too early and it doesn't turn out without a texture or in lower LOD\MIP

#

Welcome to Arma modding, enjoy the pain

#

publicTexture "#(rgb,1024,1024,1)ui('SomeProceduralTexture','asddsa','ca')" scripting command to broadcast a texture when?

#

inb4 there is much easier solution and I'm just overthinking it

#

Or you just prepare a mugshot for each CfgFaces that you'll need beforehand and store it in your mission

burnt token
#

Spawn a clone up in the sky and show them via PIP

hoary estuary
burnt token
#

You can setFace the custom face model but idk how to find the texture and it you can set it.

#

It's an edge case tho.

hoary estuary
#

I meant to broadcast whatever is stored by that texture path locally to other clients

#

So say client can render some texture and then send it to others exactly as they have it

tranquil iron
#

The texture only lives on the GPU

#

If you want to implement streaming texture from GPU back down to CPU/RAM, encoding that and sending it over network and then doing the reverse, then have fun.
But I won't be doing that

ionic tundra
#

Omg is that what might cause ui2texture to render the target black?

tranquil iron
#

What is what?

tranquil iron
ionic tundra
#

If the textures for ui2texture are stored on the gpu, are they just temporarily stored? Is there a limit or other restrictions on how many can be stored? My issue was over time and with a large number of ui2texture executions, that those displays eventually end up showing as black

tranquil iron
#

They can be thrown out of GPU if it needs more free memory.
But if the texture is on-screen it should just re-render again. (Though that is hard to test, that might not work right)

ionic tundra
#

I think thats exactly whats happening...

#

They would never turn black on screen, just offscreen. No matter how many safety nets or recalls to try and switch it back worked either, it would remain black

#

Also, idk if its related, but I found if you use ui2texture on something thats outside of the screen bounds or behind terrain, then it would be black too. Presumably because the object isnt being rendered I guess

tranquil iron
#

It is only initialized on first render