Difference between revisions of "Improved UI 2013"

From PSwiki
Jump to navigation Jump to search
Line 25: Line 25:
* General: fixes to the interface (focus issues for example, support for animated textures, render to texture), support to copy constructor in all the classes in order to create duplicate objects in paws easily without parsing again the xml each time, conversion to plugin. (easy to hard depending on the parts which are picked up)
* General: fixes to the interface (focus issues for example, support for animated textures, render to texture), support to copy constructor in all the classes in order to create duplicate objects in paws easily without parsing again the xml each time, conversion to plugin. (easy to hard depending on the parts which are picked up)
* Container System: Generalize the code so it's possible for the client to request to the server to be listening to a set of containers arbitrarily big and allow moving objects from the various open able container windows (medium to hard)
* Container System: Generalize the code so it's possible for the client to request to the server to be listening to a set of containers arbitrarily big and allow moving objects from the various open able container windows (medium to hard)
== Implementation Detail ==
# Help System
#:*The current help system loads help information from “/data/help.xml” and then the content of that is parsed in pawsHelp::PostSetup by using the system’s xml parser. The tree view widget is initialized based on the nodes after parsing. When a tree node in this view is selected, the node’s corresponding help information is retrieved and displayed in the text displaying widget. This widget is a kind of pawsMultiLineTextBox which support display plain multi-lined text.
#:*In order to enable displaying help information with pictures, we could implement a new widget derived from the pawsMultiLineTextBox. Some member functions of pawsMultiLineTextBox will be override and a new function named OrganizeContent should be added in order to manage the positions of lines and pictures correctly. We call the new widget “pawsDocumentView” which will be declared as following:
#:::Struct pictureInfo
#:::{
#::::Unsigned int width, height;
#::::Char * srcstring;
#::::Unsigned int align;
#::::Unsigned int lines;//how many lines this picture spans
#:::};
#:::Class pawsDocumentView: public pawsMultiLineTextBox
#:::{
#::::Public:
#:::::pawsDocumentView();
#:::::virtual ~pawsDocumentView();
#:::::void SetText(const char * text); //override
#:::::void Resize();//override
#:::::void Draw();//override
#:::::bool Setup(iDocumentNode* node);//override
#::::protected:
#:::::void OrganizeContent(const char * text);//this function is a new one
#:::::csArray<pictureInfo> pics;// hold all the information parsed from xml
#:::};
#:*In help.xml, the content in “<topic></topic>” should be defined as following:
#::<Contents>
#:::<Content type=”text”>text text text </Content>
#:::<Content type=”pic” width=”64” height=”64” align=”left” padding=”5 5 5 5” src=”pic source location; pic source location; pic source location;……” />
#:::……
#::</Contents>
#::Note: The pictures “src “ attribute may contains more than one picture source location which means the view widget could display more than one picture in one row with the same scale and align.
#:*The content in <topic> node is sent to the view as plain string. Then we could still use setText method to set the content that will be displayed. In setText, the most important thing is to call the OrganizeContent to manage all the text content and pictures. We don’t override the OrganizeText method because OrganizeContent still needs it to format text contents. The following flow chart shows what will be done in OrganizeContent method.[[File:H1.jpg]]
#::Note: “#pic#1,2,3” means those lines in the “lines” array are pictures. The digitals are indices pointing to the corresponding picture information in the “pics” array. These information is used in Draw method to draw pictures correctly.
#:*After the content is organized, we could then draw all the text and pictures in Draw method. A little changes will be introduced into Draw function in order to draw text content as well as pictures. The following flow chart shows what will Draw do:[[File:H2.jpg]]
#:*After this pawsDocumentView is implemented, a corresponding pawsDocumentViewFactory will be implemented using the macro “CREATE_PAWS_FACTORY” which will enable automatically create this widget by pawsmanager. The GUI definition file for the help system should be modified to load pawsDocumentView instead of pawsMultiLineTextBox. In pawsHelp, almost nothing will be changed and it will work fine if everything has been considered correctly :P.


== Additional ideas ==
== Additional ideas ==

Revision as of 17:28, 4 February 2012

(Go back to the main GSoC 2012 page)

UI In PlaneShift : PAWS

The UI in PlaneShift is managed by a library called PAWS (PlaneShift Alternate Windowing System or PlaneShift Acraig Windowing System), where acraig is the creator of the system.

The library is made of C++ classes to define a widget and an associated XML file which describes the layout and formatting.

Read more about the syntax and usage here.

Skills needed

For this project C++ knowledge is needed, and basic knowledge of XML. No MySQL knowledge is required.

Improvements needed

  • Help system: add capability to incorporate 3d objects in the help widget, make it more configurable, context sensitive and allow links.(easy)
  • Duplicate pawsWidget by copy constructor: During the last year GSOC copy constructors have been added to all classes. Now they will need to be put in use for example in the pawslistbox and be verified to be working correctly (easy)
  • Active magic window: today whenever you cast a buff spell on yourself, or when someone casts a debuff spell on you, the magic window opens showing all the buffs and debuffs, that's very annoying and clutters the screen. We want to remove this window and just have a series of icons on the top right corner with all the active buff and debuffs. This is a kind of toolbar, but just with the icon. Mouse-overing on the icons will tell you the type of spell and the duration.
  • Crafting books: Today the crafting techniques are special items which you can read like a book. Those allow you to complete crafting tasks, so for example to smelt and refine iron you need the "working with stock" crafting book. When you read this special book, the text displayed is the list of all possible combinations and transformations you can do with stocks. Even if it's simple to generate by the code, it's very hard to read and very hard to understand. We should show the books as ordered recipes and not only as a bunch of operations without any connection (needs to resolve a graph, also this needs to be cached somehow)(medium, graph algorithm knowledge is suggested)
  • Chat window: The last GSOC the chat window was improved to allow adding and removing tabs but the style of tabs was forced upon a specific positioning of tabs. It would be good to be able to add more options for positioning or even make it scriptable somehow, so skin makers can decide precisely how they want the tabs to show. An additional idea is to make the tabs configurable at runtime through in game event: For example adding the guilds tab when a player belongs to a guild.(easy)
  • Rendering widget by RTT: It may be a little expensive to render windows by using RTT. But Planeshift will also benefit if we use it at the right place such rendering the paws sketch window. The first step for this idea is to enable drawing windows by RTT. The second step is to make the way of rendering windows configurable. (medium to hard)
  • Hot bar for spells and items, with support for multiple rows, which can be resized and hidden.(medium)
  • General: fixes to the interface (focus issues for example, support for animated textures, render to texture), support to copy constructor in all the classes in order to create duplicate objects in paws easily without parsing again the xml each time, conversion to plugin. (easy to hard depending on the parts which are picked up)
  • Container System: Generalize the code so it's possible for the client to request to the server to be listening to a set of containers arbitrarily big and allow moving objects from the various open able container windows (medium to hard)

Additional ideas

  • Improve NPC Dialogues
  • allow changing of skin from in game
  • allow changing of language from in game
  • New spell casting widget
  • making all windows resizable without glitches, and more configurable
  • Split the items in the options window in game to be divided in basic and advanced. This will simplify readability.

Progress