Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / C4script menu interface
- - By Newton [de] Date 2011-11-20 22:09 Edited 2011-11-21 22:24
@Maikel:

Close()
Select(int dx, int dy, bool rightmousebutton)
Show()

~CursorUpdatesEnabled()
~UpdateCursor(int dx, int dy)

~ControlLeft(bool release)
~ControlRight(bool release)
~ControlUp(bool release)
~ControlDown(bool release)
Parent - - By Newton [de] Date 2011-11-23 14:20
@Maikel

Menu interface - what I need

IsDragDropMenu() // menu items can only be dragged/dropped if returns true

RemoveItem(object menu_item, bool delete_obj=true) // removes menuitem from list and deletes it by default
AddItem(object menu_item, int pos=nil) // adds a menu item to the next free space in the list, or at pos if specified. Returns false if item slot is not free
GetItem(int pos)

Destruction() // remove all the menu items

OnDrop(object drop, int plr) // check player, forward to controller

OnDrop(object drop, object dropped_onto_menuitem, int plr) // called by menu item, check player, forward to controller
Parent - - By Maikel Date 2011-11-23 14:34 Edited 2011-11-23 14:38
Okay, may have time for that thursday, can you push your progress also in the near-future?

Also, you mentioned including parts of the ringmenu: I am not in favor of that currently, maybe the ringmenu can include parts of this menu later, if that's possible. But let's first just copy paste that stuff, It's only fifty lines of code(Which are already copied from the stackable library and where not anyways).
Parent - By Newton [de] Date 2011-11-23 17:25
dito@thursday

The ringmenu item and the menu item are similar in displaying their object (with extraslot and ), the only difference is that the ringmenu item is limited to that while the menuitem can do more. In my opinion, it makes very much sense to inherit from an adjusted ringmenu item. Anyway, I noted that because I saw that you used the old version of the ringmenu item as a copypasta source. I changed it a bit to make it more readable regarding the layers.
Parent - - By PeterW [gb] Date 2011-11-23 15:16
Hm, just wondering: How does this relate to my Custom GUI proposal? In case you want to be able to support engine-drawn GUIs, keep in mind that some properties will have to be managed by the engine - like whether something is a drag&drop target (the user wouldn't want to wait for a synchronization to happen before dropping something).
Parent - - By Maikel Date 2011-11-23 15:28
There is currently no engine-dev with spare time to work on new menus, on the other hand settlement development depends crucially on content menus. That's why Newton and I decided to implement a C4Script solution to this problem. If in the future someone finds time to implement better(read capable) menus in the engine, someone(probably I or Newton) is of course willing to help adapting the content menus. But at the moment we can't wait anymore for the engine implementation.
Parent - By PeterW [gb] Date 2011-11-23 16:58
Yes, good idea - I was just making the point that it might be a good idea to try to already design them in a way that doesn't hinder them being asynchronous one day. In case I get around actually making an engine implementation (might be a fun OCM activity?) having a well-defined compatible script interface would be a great starting point.
Parent - - By Maikel Date 2011-11-24 20:22
Done, except for the Drop, not sure how to do that currently.
Parent - By Newton [de] Date 2011-11-24 20:45
have a look at the ObjectSelector
Parent - - By Maikel Date 2011-12-30 16:54
So I also implemented the production menu on this menu system, we still need the following:
*A decent way to show the production queue.
*A way to show the production costs.
*A good graphics, depends on design though.
* I need to implement drag and drop in a decent way.
Parent - - By Newton [de] Date 2012-01-03 19:17

> *A decent way to show the production queue.


I think its not too important in which order the production is queued, so a good intermediate solution is to just show how many items of one type are queued (like the amount in contents menus)

> * I need to implement drag and drop in a decent way.


In what problems did you run?
Parent - By Maikel Date 2012-01-03 19:59

>In what problems did you run?


None apart from time, I wanted to get rid off all old menus first (hammer).
- By Maikel Date 2011-12-11 16:00
ck patch
Attachment: repos_3738.patch (3k)
Up Topic Development / Developer's Corner / C4script menu interface

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill