Thread Tools Display Modes
02/28/14, 11:00 AM   #1
Swarog
 
Swarog's Avatar
Join Date: Feb 2014
Posts: 17
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?
  Reply With Quote
02/28/14, 11:42 AM   #2
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by Swarog View Post
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.

Originally Posted by Swarog View Post
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).

Originally Posted by Swarog View Post
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.
  Reply With Quote
02/28/14, 12:01 PM   #3
Swarog
 
Swarog's Avatar
Join Date: Feb 2014
Posts: 17
Originally Posted by Wykkyd View Post
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.
  Reply With Quote
02/28/14, 12:06 PM   #4
Errc
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 30
Originally Posted by Wykkyd View Post
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.

Last edited by Errc : 02/28/14 at 12:18 PM.
  Reply With Quote
02/28/14, 12:41 PM   #5
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by Errc View Post
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.
  Reply With Quote
02/28/14, 12:46 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
You can see how I created edit boxes in LibAddonMenu-1.0
  Reply With Quote
02/28/14, 01:03 PM   #7
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by Swarog View Post
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.
  Reply With Quote
02/28/14, 01:03 PM   #8
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by Seerah View Post
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.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » FAQ Discussion


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off