Go Back   Warhammer Forums > Gameplay Forums > UI Discussion

Reply
 
Thread Tools Display Modes
Old 10-13-2008, 11:03 AM   #1
Doomvortex
WAR Soldier
 
Doomvortex's Avatar
 
Join Date: Sep 2008
Career: A Zealot
Server: Vortex
Guild: Hostile
DEV-THREAD: The Future of any API or UI type libs

This thread is for developers to kibitz on their various and sundry ideas about how to develop any possible API or UI related libraries, and for users to interject and tell them how it really is.

I think I got way ahead of myself with the socalled CustomUI project. It's a bit ahead of its time, as the foundation for it does not exist. Before we can create a custom user interface, we need a standard way to modify the default user interface. The user interface is created through an API. Many addons feel that they must modify this API to get the interface customization they need. This is done in helter-skelter and incompatible, buggy ways. We seriously need a CustomAPI lib that provides a standard way of hooking WAR functions (and tables of functions, which might be loosely considered "classes").

And before we can create a CustomAPI lib specifically for WAR in order to inherit existing functionality of default API interface functions...

We need a Lua-written non-WAR-specific way to specify inheritance of functions and function tables. Something that will modularize the WAR-specific stuff from the stuff that just allows Lua to do what we want.

So, so far the dependencies for projects look like this:
[FONT=Courier New]
LibHook.lua, a general Lua library for hooking functions and "classes" (=tables including other "classes" or functions).
^----|
` ` ` LibCustomAPI.mod, a warhammer-specific library for hooking the functions and classes provided by the default warhammer user interface. Also includes code for detecting addons that roll their own version of API modification, allowing the user to leave them disabled / attempt to run them in compatibility mode / attempt to run them in unsafe mode.
[/FONT]

Addons that do not hook any API functions are NOT affected at all. LibCustomAPI is entirely transparent to them, so long as all the other addons are working correctly.

The rest of the addons are "CustomAPI-enhanced" or "CustomAPI-only" addons. A "CustomAPI-only" addon can inherit all of the classes of the default API if it likes, or some specific subset of classes, or use inheritance of classes already inherited by other CustomAPI addons. The nature of these addons is to be transparent to the user and only modify the API. The "CustomAPI-enhanced" addons can be written in one version to work with both the default api functions entirely or any other set of "CustomAPI-only" addons that have been installed. There will be templates for writing "CustomAPI-enhanced" addons in such a way that if LibCustomAPI.mod has not been loaded, then the addon will run in a manner suitable for an environment in which there is no LibHook managing changes to the API.

Which is to say, there will be a LibCustomCompatible library that is statically linked into projects that want to be able to modify the API, but want to do so regardless of whether the user has the LibCustomAPI installed. If not installed, LibCustomCompatible will just follow best practices for hooking functions as identified by addon authors for the existing environment, where there is no standard way to do so.

[FONT=Courier New]Hook, API, UI... a schema for a WAR library set.

` ` ` ` ` ` LibHook (general lua library for function inheritance)
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` |
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` | static link
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` |
LibCustomAPI (war-specific library for using LibHook against interface/default)

` ` ` ` LibCustomAPI` ` ` LibCustomCompatible*` ` ` LibCustomAPI` modded by
` ` ` ` ` ` ` |` ` ` ` ` ` ` ` ` ` |` ` ` ` ` ` ` ` ` ` |` ` ` \custom-only
(dynamic link) |` ` ` (static link) |` ` ` ` ` ` ` ` ` ` |
` ` ` ` ` ` ` |` ` ` ` ` ` ` ` ` ` |` ` ` ` ` ` ` ` ` ` |
` =any CustomAPI-only addon=` ` =any other addon changing api functions=
` Changes the behavior of` ` ` ` for normal reasons. this is a way to
` the default API or, more` ` ` ` implement new behavior or different
` importantly, the classes` ` ` ` behavior from the default. the user installs
` (function tables), which` ` ` ` to get this new option or changed doodad.
` have no best practices for` ` ` ` ` ` ` ` ` ` ` |
` doing without a Lib. Loaded` ` ` ` ` ` ` ` ` ` ` | (conditional execution)
` by the user and affects all` ` ` ` ` ` ` ` ` ` ` |
` other addons. Most likely` ` ` ` if LibCustomAPI is not detected, it will
` place to find a "skin" mod` ` use a small statically linked lib for code
` or "bugfix" mod, etc.` ` ` ` that simulates what should be done, without it.

` ` addon not using any of these libs are affected as follows:
` ` |
` ` |(happens ONLY on machines where LibCustomAPI is installed)
` ` |
` ` |>if not hooking the WAR api functions: not affected at all, not directly.
` ` |
` ` |>if hooking the api functions: will be disabled on first load, with user
` ` settings to attempt two other modes (besides disabled):
` ` ` ` ` * unsafe mode (enable and let it wreak havoc if it may)
` (user must find the setting "always run in unsafe mode" for state on reload)
` ` ` ` ` * compat mode (enable but take steps to keep it from breaking lib)
` ` (user will hopefully see no CTD's or broken CustomAPI stuff, although
` ` some stuff in the compat mode addon, especially if not cleanly coded,
` ` will possibly degrade or break...user may choose "this session only"
` ` or "all subsequent sessions" when first setting compat mode)
[/FONT]

This is the best DEV-THREAD going right now. I hope to see your replies.
__________________
There is no I in fail.
Doomvortex is offline   Reply With Quote
Reply

Bookmarks

Tags
addons, api, interface, lib, mod

Thread Tools
Display Modes

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

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


All times are GMT -7. The time now is 11:03 AM.