ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   FAQ Discussion (https://www.esoui.com/forums/showthread.php?t=135)

Swarog 02/28/14 11:00 AM

FAQ Discussion
 
I offer to discuss FAQ here for further wiki filling.

First questions:
1. How can I copy some UI text (for example: NPC dialog text) to clipboard?
2. How can I call remote web service (REST for simplicity)?
3. How can I save and restore character settings while its creation?

Wykkyd 02/28/14 11:42 AM

Quote:

Originally Posted by Swarog (Post 671)
1. How can I copy some UI text (for example: NPC dialog text) to clipboard?

I do not think an addon can force anything to the user's local clipboard. I haven't found a functional Lua command to do so within the confines of the API that ZOS has enabled. Someone may have found something, but I wouldn't hold my breath waiting.

Quote:

Originally Posted by Swarog (Post 671)
2. How can I call remote web service (REST for simplicity)?

You can't. The Lua enabled by ZOS's game client API does not allow for interaction with external objects (files, databases, scripts, websites, nothing).

Quote:

Originally Posted by Swarog (Post 671)
3. How can I save and restore character settings while its creation?

Settings for your addon can be stored in any variable that is attached to a SavedVariable that the API recognizes (either through a setting in the addon's .txt file or via calling the ZO_ command (I forget offhand, but you can find plenty of examples in existing addons)). Most in-game settings for keybinds, controls, etc are protected/private and can't be set via an Addon. I think there are some exceptions but not many.

Swarog 02/28/14 12:01 PM

Quote:

Originally Posted by Wykkyd (Post 673)
Settings for your addon can be stored in any variable...

I know about variables stored in the text file. I mean gender, age, skin color, height and etc behind settings. Can I save and restore it within character creation dialog? I can't find any function to get them. I want to use this approach for characters templates.

Errc 02/28/14 12:06 PM

Quote:

Originally Posted by Wykkyd (Post 673)
I do not think an addon can force anything to the user's local clipboard. I haven't found a functional Lua command to do so within the confines of the API that ZOS has enabled. Someone may have found something, but I wouldn't hold my breath waiting.

Edit boxes have a :CopyAllTextToClipboard() function. So you can just create a editbox and put whatever text you want to copy out in it before calling that function.

Wykkyd's is correct about calling any outside Web services. All Lua is sandboxed and can not communicate with any outside services. Some alternatives to communicating with an outside service requires parsing the saved variables file, pulling out the data you want and inserting any new/changed data. So it is possible, but requires an outside application to handle this communication. Saved variable file is only written to every reload so it is not a constant stream of communication.

You can use saved variables to save settings, but I don't think any of these settings are available to be saved during character creation. ZOS has their own SV file, ZO_Ingame.lua, and it has a lot of their saved variables, but I doubt any options for character creation would show up in there.

Edit: Although quick look through some of ZOS's source Lua code, they do handle character creation in Lua/xml so this might be possible to do in the future, if/when they make their source code available publicly. It would require loading an addon prior to entering the game, which is something I suspect they will not allow.

Wykkyd 02/28/14 12:41 PM

Quote:

Originally Posted by Errc (Post 675)
Edit boxes have a :CopyAllTextToClipboard() function. So you can just create a editbox and put whatever text you want to copy out in it before calling that function.

Is there some trick to getting Edit Boxes to show up properly? The few I tried to add didn't even display, let alone allow me to edit text.

Seerah 02/28/14 12:46 PM

You can see how I created edit boxes in LibAddonMenu-1.0

Wykkyd 02/28/14 01:03 PM

Quote:

Originally Posted by Swarog (Post 674)
I know about variables stored in the text file. I mean gender, age, skin color, height and etc behind settings. Can I save and restore it within character creation dialog? I can't find any function to get them. I want to use this approach for characters templates.

I seriously doubt it with today's API.

Wykkyd 02/28/14 01:03 PM

Quote:

Originally Posted by Seerah (Post 677)
You can see how I created edit boxes in LibAddonMenu-1.0

Yeah I'll have to dig into it later. This was a month or two ago when I first tried and it was hokey so I moved on. ;)


All times are GMT -6. The time now is 12:01 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI