Jump to content

minipopov

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Community Reputation

16 Good

About minipopov

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well after few comment from @code34 i change the way you call function on dialog. Now it s create public var. Which is shop in our exemple. And now the way to execute funtion form outside is [functionName, _args] call shop.
  2. Hello, OOP macro File : https://github.com/code34/oop.h Today i wanna share with you my gui editor. This is the link https://github.com/minipopov/GuiEditor Why new editor? -Based on layer with ctrlGroup -You could use your own style control directly from mission -You could export HPP (with EVH link for oop user) -You could export OOP file which is load on createDialog and delete variable on closeDialog -OOP file will contain all functions associate with your dialog. You could set from editor a name for each control which is the name of variable inside class and add init function Press F1 in mission you will see all shortcut. Let's talk about other thing. In initPlayerLocal.sqf you could set OOP_GuiEditor_ListControl which is an array of control avaible. You could remove all, add yours. The only thing that you have to do for add your control is to fill the file styles/customStyle.hpp with your style. Let's create together a new simple dialog. I named it shop with idd 8600. I create a simple dialog with 1 layer. Inside my layer i would create 1 LB which i named "itemList" and 2 button btnClose, btnOK. On my LB i check in event "Init" "OnLBSelChanged". Screenshot:http://prntscr.com/i2r1zj Let's look hpp file generated: Have a look for people who doesn't use OOP. All Event call static function to OOP class that you don't have. You need to change the call AND remove onLoad/unLoad event on display. Hpp contain string to reimport later your dialog Now let's generate oop class First there is standard function Init that it executed at openning your display. For ours BUTTONS We have 2 buttons on our hpp, so 2 functions btnAction_btnOK and btnAction_btnClose. They are call on click For Listbox We have Init function that you could call like this ["static",["onLBSelChanged_itemList", _whateveryouwant] call oo_shop. You could passed to the function anything you wan't and do your job... We have this function cause we check Init There is onLBSelChanged_itemList that is called on selected element on LB. EVH functions are auto fill. Now in-game how to use that? Just by using createDialog "shop", this gonna call our constructor function and get/set all controls, exec standard init. How to delete all vars & clear memory? closeDialog 0; Gonna set all variable to nil and clear memory Hope that i don't let but inside my code ^^. We're on beta version but, it's seems work well
  3. Yeah you could do this. It s sad that we couldn't just read the return by ctrlText.... (arma plz, do it)
  4. Hello, Link for OOP:https://github.com/code34/oop.h Link: https://github.com/minipopov/HelperGUI I just release a OOP Class that i use in my GUI Editor to manage control, which it be easier for me cause there is lot of log if you re doing something wrong... This class contain many function that help me to set Listbox, edit text, text... there is also some getter.. AND i use this class also to make some verification on string like "is my string contain space? is it numeric?..." How do i use this class? First of all is instantiate this where you want. Personnaly i add it into initPlayerLocal.sqf HelperGui = "new" call oo_HelperGui; There is a function to set display where you wan't manage control. ["setDisplay", (findDisplay 1500)] call HelperGui; And now many function.. Setter: And Getter: And there is some functions that i use in special case This is not fully optimised but at this the moment it's works well for what i'm doing. May be you should read file one time before use it
  5. Ok, if you arrive to get a return from request, that would be great :)
  6. Arma didn't inplement any function to get text on RscHTML, at least i didn't find any way to do this. Only return that you could have is true when load is success/false when not.
  7. As exemple for this topic:https://forums.bohemia.net/forums/topic/213192-release-oo_webservice-class-using-oop/ I create a bot discord:https://github.com/minipopov/DiscordBotExemple I create BaseFnc class, which have 2 antiflood system, one per user, one per call by everyone. i add a function named "sendGlobal" which send a text main channel on my discord: const globalMessage = new BaseFnc("sendGlobal", 10) // name of my function, time for antiflood globalMessage.setFloodProtection("perUser") // antiflood system perUser/perCall globalMessage.setCallback((params, steamID) => { // My callback chanGeneral.send(params.text) }); Then i import to my mission oo_Webservice and i create a class oo_Discord which use Webservice. You could check my mission:https://github.com/minipopov/Discord oo_Discord have 1 function "sendGlobal" which send httpRequest with those args: action => name of function to exec steamID => Who execute this call text => message to display on discord Now i make call private _discord = ["new", "http://localhost:8080/"] call oo_Discord; ["sendGlobal","Hello world!"] call _discord; I get this on my discord: http://prntscr.com/i1trv6 Make your own function function and imagine may be some new game/ interaction with people.
  8. Hello, I just release one class which use RscHTML to interact with API REST throw GET. You could check my code on: https://github.com/minipopov/WebService Don't forget to add ip from your webservice to in allowedHTMLLoadURIs (inside CfgCommands) like this exemple https://community.bistudio.com/wiki/CfgCommands Don't forget to add oop.h to your mission : https://github.com/code34/oop.h How to use instantiate class? private _webservice = ["new", "http://localhost:8080/"] call oo_WebService; Then put some args : private _arr = [ ["action", "update"], ["table", "users"], ["id", getPlayerUID] ]; ["putParam", _arr] call _webservice; And finally call it: private _index = "call" _webservice; It return index of request. You could get request state from index by getStatus private _data = ["getStatus", _index] call _webservice; Which is an array that contain in 0, the status of request "waiting"/"complete"/"timeout"(if request goes to timeout ofc..)/"undefine" if you give bad index. And at 1 the diag_ticktime when request was executed. So, as you could see there is timeout for request that you could set like this ["setTimeOut", 10] call _webservice; //time in second Old request are delete, you could set default time that script keep in memory request ["setKeepInMemory", 500] call _webservice; //Keep all request 500s after there exec Sadly, i didn't find any way to get the output of RscHTML... If anyone know the way to do it.. Hope it could be done to do something a bit more complex like get something in database or something like that.. Im so sorry for my fucking english.. ^^ Here:Exemple of usage:
  9. Hello, I think i found a bug with callExtension and bug report. Make endl in string and send it throw callExtension make CR CRLF. I make a git where you could find all mission file/dll source and screen from notepad which show you CR CRLF. GIT:https://github.com/minipopov/make_file
  10. Hummm.. that s weird. This is my initPlayerLocal.sqf I always check file.hpp into sublime and it's look like this: http://prntscr.com/ho4f7b We could see that there is 3 lines When i'm openning the same file into block note: http://prntscr.com/ho4gkm We could see that there is 2 lines LearnString.cpp is same function but give me that: http://prntscr.com/ho4hqc Now with this initPlayerLocal.sqf I get the good file.hpp http://prntscr.com/ho4ika Do you have any idea? (i didn't change anything in dll)
  11. I test with endl (https://community.bistudio.com/wiki/endl) too and it skip line. It does something like that I wan't What should i do? Sorry for my shit post.. i don't really know how to explain it
  12. Hey, What i want: I want to generate some file from arma to create hpp file from an editor dialog. I have already test make_file.dll from KillzoneKid but it's doing bullshit when you try to write something inside hpp (it's works with txt) and i can't see the source... so i want to do mine. What i do:I create 2 projects on visual, one for test script on console windows and one for arma, you could check both of them on git : https://github.com/minipopov/make_file. I think that 2 scripts are equal.. and when you execute LearnString, it's write the file outputFromWindowsExec.hpp. End of line '\n' works well, but not in arma. So i try to use endl in sqf => end of line is taken into account but it skip a line between my 2 lines. One solution that i find: my string like this With this one, it s work. Question: Just why the fuck \n or \r\n didn't work? What should i do to do this? Obviously, i'm new at C/C++ script...
  13. Hello, Goal: I want create control to execute local script (same as this one you can find when you spawn on mission with EDEN): Problem: I use keyboard event to break the line by (shift+enter), but i don't find any function to have the position of cursor. This is my script: if (_shift) then { private _ctrl = ((findDisplay 10000) displayCtrl 1401); if (!isNull _ctrl) then { private _s = ctrlText _ctrl; _ctrl ctrlSetText (_s + tostring [13,10]); ctrlSetFocus _ctrl; _noReturn = true; }; }; if (!_shift) then { "OnEnterScript" call Console; }; This one "work" but only add new line at the end of string. Is anyone know how to get cursor position in control? Do you know any trick to place the cursor at the end?
×