Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings UI #21

Open
jhakonen opened this issue Mar 13, 2016 · 8 comments
Open

Settings UI #21

jhakonen opened this issue Mar 13, 2016 · 8 comments
Milestone

Comments

@jhakonen
Copy link
Owner

Features needed:

  • Show mod settings
  • Modify mod settings
  • Save settings
  • Restore default settings
  • Export settings to a file
  • Import settings from a file
  • Show list of known TeamSpeak users (name + id?)
  • Show list of known players (name + unique id?)
  • Show a link between matched TeamSpeak users and players
  • Show link type (automatic or manually set)
  • Create manual links (manual link removes any automatic links between associated users and players)
  • Remove manual links
  • Any text content translatable to other languages (e.g. Finnish, Russian, etc...)

Ideas how to implement the UI:

  • http server integrated into mod and then displaying html content in in-game web browser
  • Flash based UI
  • Settings in TeamSpeak plugin

Further ideas for Flash based UI:

  • A view for settings
  • A view for linking names
    • Two lists, first has player names, second has TS users
    • Each list is divided to three different sections: already linked and online; not linked and online; offline
    • Each section would be in alphapedical order
    • TS user list would show speech indicator when the user is speaking in TS
    • Player list would show speech indicator when TS user is speaking and that user is linked to player
    • Users and players would be linked somehow between lists visually
    • Linking could be done by dragging e.g. player name to TS name
    • Remove link from a button
@jhakonen
Copy link
Owner Author

jhakonen pushed a commit that referenced this issue Mar 21, 2016
- Window is opened in lobby with F10 key.
@jhakonen
Copy link
Owner Author

For master branch's building instructions see:
https://github.com/jhakonen/wot-teamspeak-mod/wiki/Development-and-tests

In addition you need to install Adobe Flex 4.6 SDK. You can download it from here:
https://www.adobe.com/devnet/flex/flex-sdk-download.html

When done, provide path to Flex SDK's MXMLC compiler:

make.py configure --mxmlc="E:\Programs\FlexSDK\bin\mxmlc.exe"

Adjust the path to match your environment.
Building and testing happens, as always, with e.g. command:

make.py --exclude-tags=tsplugin clean install tail

@jhakonen
Copy link
Owner Author

You can now print debug messages from the ActionScript code to python.log using functions from DebugUtils package:

  • DebugUtils.LOG_DEBUG(msg, arg1, arg2, ...)
  • DebugUtils.LOG_WARNING(msg, arg1, arg2, ...)
  • DebugUtils.LOG_ERROR(msg, arg1, arg2, ...)

There is a few gotchas though:

  • The first 'msg' variable needs to contain 'TESSUMOD' somewhere in it (case-insensitive), it is used to filter out any messages coming from other game UI components.
  • If you use LOG_DEBUG, you need to also change log_level to 0 from res_mods\configs\tessu_mod\tessu_mod.ini.

jhakonen pushed a commit that referenced this issue Mar 23, 2016
 - Added fake modules that enable imports which the new window functionality depends on.
@jhakonen
Copy link
Owner Author

So, I've been lately learning to write ActionScript 3, reading WoT's AS code, reading forums and based on those managed to add a few elements to the settings window:

There is a text label there as well, but the text color is black so it is kinda difficult to see from the dark background.

How to add the buttons I found from ShadowHunterRUS's nice guide:
http://www.koreanrandom.com/forum/topic/25477-как-создать-формуокно-в-ангаре/?p=279913

I also wrote a small test tool which allows previewing the Settings UI's SWF-file in browser:

While it doesn't look the same; no window borders, white background; it does show the same elements at same locations in same style. And it loads up much faster than the game would!

I'll add sources, binaries and instructions how to use use them later.

@jhakonen
Copy link
Owner Author

jhakonen commented Apr 1, 2016

Would be nice to integrate the mod with this:
https://bitbucket.org/P0LIR0ID/modslist/src/

I'm unsure how that is supposed to be distributed. Is it a separate mod? Or is it kind of a library that is supposed to be included in our mod?

If it is a separate mod then we would still need a fallback solution if user don't have that mod installed. That is, our own button in garage.

jhakonen pushed a commit that referenced this issue Apr 2, 2016
 - Providing libraries is not mandatory anymore.
 - Added debug switch.
 - Added static-link-runtime-shared-libraries switch.
 - MXMLC does not accept multiple AS-files, so input file list is not a list anymore.
jhakonen pushed a commit that referenced this issue Apr 2, 2016
jhakonen pushed a commit that referenced this issue Apr 2, 2016
jhakonen pushed a commit that referenced this issue Apr 2, 2016
….py.

For this to work user needs to configure path to web browser, e.g.:
    make.py configure --webbrowser="C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

Then execute:
    make.py preview_settingsui
@jhakonen
Copy link
Owner Author

jhakonen commented Apr 2, 2016

Well, I ended up making the preview tool better :)

Improvements I have done:

  • Visible window borders (it can be even dragged around)
  • Any DebugUtils calls, uncaught exceptions and preview tool's internal logging goes to Javascript's console output
  • Path to the view's SWF-file can be given from the UI, it is not hard coded to "SettingsUI.swf" anymore
  • verbose toggle to reduce logging spam from the tool's internal logging

The tool is integrated also to make.py. Building of the tool is done just like previously with build command:

make.py --exclude-tags=tsplugin build

In order to open the tool to web browser you need to first configure a path to some browser you wish to use, e.g.:

make.py configure --webbrowser="C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

Then execute:

make.py preview_settingsui

This command will open the preview tool to your web browser with the "SWF file path" set to point to the location where the SettingsUI.swf was build to.

jhakonen pushed a commit that referenced this issue Apr 6, 2016
The example contains:
- as_setSettings() method at AS3 side which is called from Python to set initial values to the UI,
- onOkClicked() and onCancelClicked() methods at Python side which are called from AS3 when user clicks buttons in the UI.
@jhakonen
Copy link
Owner Author

jhakonen commented Apr 6, 2016

Got DAAPI communication to work:

That JSON data is created at Python code and then passed through to the AS3 UI.

Clicking the Ok / Cancel buttons cause click handler methods in the Python side to be called.

See the commit for details.

@jhakonen
Copy link
Owner Author

I have merged the issue_21 feature branch to master. Development continues there for now.

@jhakonen jhakonen modified the milestones: Release 0.7, Backlog Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant