Jump to content
Eternal Lands Official Forums
Fedora

Manu & Spell window patch

Recommended Posts

I coded a couple of patches for the GUI.

 

- Manu window with the possibility of saving recipes and recall them later. Here. Users can save up to 10 recipes. Manu window is 12 pixel taller to accomodate a status message, while len_x and buttons are untouched (maybe moved a little to the right, can't remember). Pipeline moved all to the left. Added a small control to switch between recipes and a button (+) to save a recipe without pressing the mix button.

 

- Spell window with the same modifications. Can save up to 10 sigils combinations. Window is 12 pixel taller and buttons slightly nearer each other to accomodate the recipe handling control. Here

 

Feel free to modify the GUI, I'm not very good with layouts ;)

Share this post


Link to post
Share on other sites

I thought there already was a user-defined menu of some kind which allowed for more spells to be saved (I saw a pic from a CVS compiled client).

 

Perhaps there needs to be some sort of client UI orgainzation/strategy/"manager" to make sure that additions are appropriate, legal (from entropy's point-of-view), consistent, and not a duplication of effort. Basically to prevent all the problem that come from a bunch of people running open-loop.

Edited by bkc56

Share this post


Link to post
Share on other sites
It would be nice if you guys consult me before making patches like this that can give people unfair advantages :/

 

Sorry, since it saves the recipes only (you still have to set ingredients or sigils by hand, and they are not linked to any describing text or shortcut key) I thought it wouldn't be harmful. Next time I'll pm you

 

I thought there already was a user-defined menu of some kind which allowed for more spells to be saved (I saw a pic from a CVS compiled client).

 

If it is there, it's not so visible :)

Share this post


Link to post
Share on other sites

The user menu feature is detailed in this thread. These menus are now in CVS but need a #def which is on by default in the Windows and Linux build, mac to I think. There is also a config option to enable these menus.

In that thread Entropy said:

Also, don't add stuff related to harvesting or manufacturing, so it won't be easier for people to macro. More spells, on the other hand, is OK.

So I have stayed clear of harvest/manufacturing related stuff but have added two #commands to CVS "#show_spell" and "#cast_spell" with the intention that they could be used to assign spells to aliases or via the user menus. See here.

 

It's a shame that Entropy is not happy with your patches. From my very limited test, they work nicely and look very neat.

Edited by bluap

Share this post


Link to post
Share on other sites
It's a shame that Entropy is not happy with your patches. From my very limited test, they work nicely and look very neat.

 

After a chat with Ent, he asked me to improve it a bit and then he'll decide. I'm working on a dropdown menu for recipes instead of simple buttons :). I will post patch and screenshots here as soon as ready.

Share this post


Link to post
Share on other sites

Ok, new patch uploaded for the manu window. When and if approved I'll add the same modifications to the spell patch (lazy :))

 

Here are some screenshots:

 

New manu window

el1.jpg

 

Some recipes added with and without opaque windows

el2.jpg

el3.jpg

 

Greyed out recipes when ingredients are missing

el4.jpg

el5.jpg

 

 

Some behaviour notes:

- the dropdown is showed by clicking on the down arrow and hidden by clicking on the same arrow (drawn reversed)

- the current recipe slot is highlighted in red

- clicking on the dropdown selects a recipe slot

- double clicking on it selects a recipe slot and hides the dropdown

- the "+" button save whatever is showed in the 6 production slots in the current recipe slot

- help-text and click sounds are working

- Manu window now supports mouse wheel. Wheel on items moves them up and down. Wheel on the arrow down button scrolls the recipes without showing the dropdown. Wheel on the dropdown circles through. Wheel on the production pipeline moves items if they're present, else it circles through recipes (if by accident you wheel up all the items in a pipeline slot, it gets detected and recipes don't circle).

 

Some programming notes:

- the dropdown is implemented as a child window

- the controls (arrow and "+") are coded manually but would be nicer and cleaner to have them as widgets. However this seems to be impossible, since I can't declare a widget as, for example, a button and then change its drawing function for custom drawing (the WIDGET_INFO structs are const...)

- a note on opaque windows. I had to code a little hack to set both parent and child window opacity when one of them changes. Indeed CTRL+D sets opaque the topmost window only and so when the dropdown is showed, only the dropdown becomes opaque. The cleanest solution I can think of is adding an OnOpaque window function called everytime opacity changes, but I didn't want to mess with other code apart manufacture.c

- When an item from inventory is moved from a slot to another, there is a brief time during which the item is removed from inventory and we are waiting for the server to send us again the inventory list. This causes the recipes using that item to grey out briefly if the time is long enough. This issue needs changes in code I'm afraid of :evilgrin:

Edited by Fedora

Share this post


Link to post
Share on other sites
- the dropdown is showed by clicking on the down arrow and hidden by clicking on the same arrow (drawn reversed)

What happens if the manu window is at the bottom of the screen, does the drop-down then "drop-up"? I don't mind the manu window being obscured by this new window, but I wouldn't want to be forced to have the manu window at the top of the screen.

 

Btw, I like this enhancement.

Share this post


Link to post
Share on other sites
- the dropdown is showed by clicking on the down arrow and hidden by clicking on the same arrow (drawn reversed)

What happens if the manu window is at the bottom of the screen, does the drop-down then "drop-up"? I don't mind the manu window being obscured by this new window, but I wouldn't want to be forced to have the manu window at the top of the screen.

 

Btw, I like this enhancement.

 

No, it doesn't "drop up" :) but you can still circle through recipes with the mouse wheel if you don't have space for the dropdown. Or, we could make the number of recipe slots configurable so you can set it to less than 10 and use less screen space.

Share this post


Link to post
Share on other sites

After another chat with Ent, we came up with a possible redesign of the spell window.

So I coded a patch to add *some* functionalities.

 

First of all, all spells and sigils info are in a spells.xml file updatable by the server to add, for example, new spells.

Each spell is defined in all its relevant attributes (name,desc,id,icon,mana,sigils,reagents,required lvs) and can be assigned to "groups".

Groups are defined in the xml and are used to draw the interface. One spell can be in more than one group. If a group is bigger than a single row of spells (7 at most), it is broken in two or more rows automatically.

 

The old sigil window is replaced by a spell window with icons of spells. A click to select, double click to cast.

Spells without the necessary requirements are grayed-out (well reded-out ;)). Requiremennts are mana, reagents, sigils but also

levels...*every* level. For instance, it is possible to define a spell that requires Magic n, Summoning m and Alchemy s, just modify the xml and the code does the checks.

 

The spell window can be "minimized" to save screen space, but with less textual info.

 

The old sigil window is still accessible (square button under X button) and working. This allows for *secret* spells with undisclosed formulas, checking acquired sigils or for quests (go there and put together sigils x,y and z). Also it can still be used if you don't like the new one B)

 

Last, spells can be added to the quickbar *without* casting them first. Just right-click on the bottom-left spell icon and it goes to the quickbar.

 

 

Here are some screenshots.

 

Spell window

big1.jpg

big2.jpg

big3.jpg

Spell window with a Test group

big4.jpg

 

Mini Spell window

sml1.jpg

ehm...mouse pointer is on radiation shield, it's not a bug :D

sml3.jpg

 

Mini Spell window with a Test group

sml4.jpg

 

And the old Sigil window with a square button to go back to Spells

sigil.jpg

 

 

 

Ok, waiting for feedback on this. Ent if you give the ok, I'll upload the patch on berlios and send you the xml.

Edited by Fedora

Share this post


Link to post
Share on other sites

One question (if I didn't miss it) will a mouse-over a spell icon pop-up the name of the spell? Not everyone has the icons memorized.

 

But otherwise, it looks really good.

Share this post


Link to post
Share on other sites
One question (if I didn't miss it) will a mouse-over a spell icon pop-up the name of the spell? Not everyone has the icons memorized.

 

But otherwise, it looks really good.

 

Yes, sure. In the normal spell window you get the name of the spell in orange, the reason of uncastability in red and the description in white, printed in the bottom line. In the mini spell window you just get the name in white. The name turns to green when the spell is selected.

 

Patch will be posted later today, doing some more tests.

Share this post


Link to post
Share on other sites

Ok, here it is the patch ready to be committed by someone with permission.

It contains both spell and manu window patches since, due to some modifications elsewhere (items.c) they are no more independent.

 

(manu windows scrolldown has been modified and now doesn't have double horizontal lines, as Ent asked)

 

and here it is the spells.xml

<?xml version="1.0" encoding="UTF-8"?>
<Magic>
<Spell_list>
<!-- health group -->
<spell>
	<name>Heal</name>
	<desc>Restores 10 HP</desc>
	<id>0</id>
	<group>0</group>
	<icon>40</icon>
	<mana>5</mana>
	<lvl skill="mag">0</lvl>
	<sigil>3</sigil>	
	<sigil>23</sigil>	
	<reagent id="59">1</reagent>
</spell>
<spell>
	<name>Remote Heal</name>
	<desc>Restores some HP on a remote target</desc>
	<id>1</id>
	<group>0</group>
	<icon>41</icon>
	<mana>8</mana>
	<lvl skill="mag">4</lvl>
	<sigil>9</sigil>	
	<sigil>3</sigil>	
	<sigil>23</sigil>	
	<reagent id="59">2</reagent>
	<reagent id="60">1</reagent>
</spell>
<spell>
	<name>Restoration</name>
	<desc>Restores some of your health</desc>
	<id>7</id>
	<group>0</group>
	<icon>47</icon>
	<mana>25</mana>
	<lvl skill="mag">21</lvl>
	<sigil>1</sigil>	
	<sigil>24</sigil>	
	<reagent id="59">4</reagent>
</spell>
<spell>
	<name>Heal Summoned</name>
	<desc>Restores health to your summoned creatures</desc>
	<id>12</id>
	<group>0</group>
	<icon>52</icon>
	<mana>25</mana>
	<lvl skill="mag">33</lvl>
	<sigil>8</sigil>	
	<sigil>2</sigil>	
	<sigil>23</sigil>	
	<sigil>14</sigil>	
	<reagent id="54">2</reagent>
	<reagent id="57">2</reagent>
	<reagent id="59">2</reagent>
</spell>
<!-- misc group -->
<spell>
	<name>Teleport to Range</name>
	<desc>Allows you to teleport to a nearby location</desc>
	<id>5</id>
	<group>1</group>
	<icon>45</icon>
	<mana>15</mana>
	<lvl skill="mag">15</lvl>
	<sigil>7</sigil>	
	<sigil>0</sigil>	
	<sigil>8</sigil>	
	<sigil>2</sigil>	
	<reagent id="55">1</reagent>
	<reagent id="56">1</reagent>
	<reagent id="54">1</reagent>
</spell>
<spell>
	<name>Bones to Gold</name>
	<desc>Turns all bones in inventory to gold coins</desc>
	<id>8</id>
	<group>1</group>
	<icon>48</icon>
	<mana>30</mana>
	<lvl skill="mag">23</lvl>
	<lvl skill="alc">20</lvl>
	<sigil>6</sigil>	
	<sigil>0</sigil>	
	<sigil>15</sigil>	
	<reagent id="55">2</reagent>
	<reagent id="56">1</reagent>
</spell>
<spell>
	<name>Teleport to Portal Room</name>
	<desc>Teleports to a room where you can access main maps</desc>
	<id>9</id>
	<group>1</group>
	<icon>49</icon>
	<mana>20</mana>
	<lvl skill="mag">24</lvl>
	<sigil>7</sigil>	
	<sigil>0</sigil>	
	<sigil>9</sigil>	
	<sigil>2</sigil>	
	<reagent id="55">1</reagent>
	<reagent id="56">5</reagent>
	<reagent id="54">1</reagent>
</spell>
<spell>
	<name>True Sight</name>
	<desc>Allows you to see invisible characters</desc>
	<id>16</id>
	<group>1</group>
	<icon>39</icon>
	<mana>20</mana>
	<lvl skill="mag">45</lvl>
	<sigil>19</sigil>	
	<sigil>15</sigil>	
	<sigil>20</sigil>	
	<reagent id="56">4</reagent>
	<reagent id="60">4</reagent>
	<reagent id="54">4</reagent>
</spell>
<spell>
	<name>Intercontinental Teleport</name>
	<desc>Teleports to the Portal Room of the other continent</desc>
	<id>20</id>
	<group>1</group>
	<icon>49</icon>
	<mana>40</mana>
	<lvl skill="mag">50</lvl>
	<sigil>0</sigil>	
	<sigil>9</sigil>	
	<sigil>2</sigil>	
	<reagent id="55">4</reagent>
	<reagent id="56">10</reagent>
	<reagent id="54">12</reagent>
</spell>
<spell>
	<name>Invisibility</name>
	<desc>Makes you temporary invisible</desc>
	<id>15</id>
	<group>1</group>
	<icon>43</icon>
	<mana>30</mana>
	<lvl skill="mag">50</lvl>
	<sigil>22</sigil>	
	<sigil>15</sigil>	
	<sigil>20</sigil>	
	<reagent id="53">10</reagent>
	<reagent id="56">10</reagent>
	<reagent id="55">10</reagent>
</spell>
<!-- attack group -->
<spell>
	<name>Poison</name>
	<desc>Poisons the target</desc>
	<id>4</id>
 	<group>2</group>
	<icon>44</icon>
	<mana>14</mana>
	<lvl skill="mag">12</lvl>
	<sigil>5</sigil>	
	<sigil>4</sigil>	
	<sigil>24</sigil>	
	<reagent id="58">2</reagent>
</spell>
<spell>
	<name>Harm</name>
	<desc>Inflicts magic damage on the target</desc>
	<id>6</id>
	<group>2</group>
	<icon>46</icon>
	<mana>25</mana>
	<lvl skill="mag">20</lvl>
	<sigil>22</sigil>	
	<sigil>23</sigil>	
	<reagent id="59">5</reagent>
	<reagent id="58">3</reagent>
</spell>
<spell>
	<name>Life Drain</name>
	<desc>Damages the target and gives you some health back</desc>
	<id>10</id>
	<group>2</group>
	<icon>50</icon>
	<mana>20</mana>
	<lvl skill="mag">27</lvl>
	<sigil>7</sigil>	
	<sigil>0</sigil>	
	<sigil>24</sigil>	
	<reagent id="57">3</reagent>
</spell>
<spell>
	<name>Smite Summoned</name>
	<desc>Inflicts damages to summoned creatures (not yours)</desc>
	<id>13</id>
	<group>2</group>
	<icon>53</icon>
	<mana>30</mana>
	<lvl skill="mag">36</lvl>
	<sigil>8</sigil>	
	<sigil>2</sigil>	
	<sigil>22</sigil>	
	<sigil>24</sigil>	
	<reagent id="54">2</reagent>
	<reagent id="58">3</reagent>
	<reagent id="55">2</reagent>
</spell>
<spell>
	<name>Mana Drain</name>
	<desc>Absorbs mana from the target</desc>
	<id>14</id>
	<group>2</group>
	<icon>54</icon>
	<mana>20</mana>
	<lvl skill="mag">40</lvl>
	<sigil>7</sigil>	
	<sigil>0</sigil>	
	<sigil>17</sigil>	
	<reagent id="53">6</reagent>
</spell>
<!-- defense group -->
<spell>
	<name>Magic Protection</name>
	<desc>Increases your magic protection</desc>
	<id>2</id>
	<group>3</group>
	<icon>42</icon>
	<mana>10</mana>
	<lvl skill="mag">6</lvl>
	<sigil>19</sigil>	
	<sigil>17</sigil>	
	<sigil>21</sigil>	
	<reagent id="60">1</reagent>
	<reagent id="56">1</reagent>
</spell>
<spell>
	<name>Shield</name>
	<desc>Increases your armor</desc>
	<id>3</id>
 	<group>3</group>
	<icon>32</icon>
	<mana>11</mana>
	<lvl skill="mag">9</lvl>
	<sigil>19</sigil>	
	<sigil>15</sigil>	
	<sigil>21</sigil>	
	<reagent id="55">1</reagent>
</spell>
<spell>
	<name>Magic Immunity</name>
	<desc>Makes you immune to negative spells</desc>
	<id>11</id>
 	<group>3</group>
	<icon>51</icon>
	<mana>30</mana>
	<lvl skill="mag">30</lvl>
	<sigil>19</sigil>	
	<sigil>3</sigil>	
	<sigil>17</sigil>	
	<sigil>21</sigil>	
	<reagent id="60">2</reagent>
	<reagent id="56">1</reagent>
</spell>
<spell>
	<name>Heat Shield</name>
	<desc>Protects you from heat damage</desc>
	<id>17</id>
 	<group>3</group>
	<icon>56</icon>
	<mana>25</mana>
	<lvl skill="mag">37</lvl>
	<sigil>19</sigil>	
	<sigil>10</sigil>	
	<sigil>21</sigil>	
	<reagent id="56">3</reagent>
	<reagent id="55">3</reagent>
	<reagent id="51">4</reagent>
</spell>
<spell>
	<name>Cold Shield</name>
	<desc>Protects you from cold damage</desc>
	<id>18</id>
 	<group>3</group>
	<icon>55</icon>
	<mana>27</mana>
	<lvl skill="mag">38</lvl>
	<sigil>19</sigil>	
	<sigil>11</sigil>	
	<sigil>21</sigil>	
	<reagent id="56">3</reagent>
	<reagent id="55">3</reagent>
	<reagent id="50">4</reagent>
</spell>
<spell>
	<name>Radiation Shield</name>
	<desc>Protects you from radiation damage</desc>
	<id>19</id>
 	<group>3</group>
	<icon>57</icon>
	<mana>30</mana>
	<lvl skill="mag">39</lvl>
	<sigil>19</sigil>	
	<sigil>15</sigil>	
	<sigil>16</sigil>	
	<sigil>21</sigil>	
	<reagent id="56">3</reagent>
	<reagent id="55">3</reagent>
	<reagent id="60">4</reagent>
</spell>
</Spell_list>
<Groups>
<group id="0">Health Spells</group>
<group id="1">General Spells</group>
<group id="2">Attack Spells</group>
<group id="3">Defense Spells</group>
</Groups>
<Sigil_list>
<sigil id="0" name="Change">change</sigil>
<sigil id="1" name="Restore">restore</sigil>
<sigil id="2" name="Space">space</sigil>
<sigil id="3" name="Increase">increase</sigil>
<sigil id="4" name="Decrease">decrease</sigil>
<sigil id="5" name="Temporary">temporary</sigil>
<sigil id="6" name="Permanent">permanent</sigil>
<sigil id="7" name="Move">move</sigil>
<sigil id="8" name="Local">local</sigil>
<sigil id="9" name="Global">global</sigil>
<sigil id="10" name="Fire">fire</sigil>
<sigil id="11" name="Water">water</sigil>
<sigil id="12" name="Air">air</sigil>
<sigil id="13" name="Earth">earth</sigil>
<sigil id="14" name="Spirit">spirit</sigil>
<sigil id="15" name="Matter">matter</sigil>
<sigil id="16" name="Energy">energy</sigil>
<sigil id="17" name="Magic">destroy</sigil>
<sigil id="18" name="Destroy">destroy</sigil>
<sigil id="19" name="Create">create</sigil>
<sigil id="20" name="Knowledge">knowledge</sigil>
<sigil id="21" name="Protection">protection</sigil>
<sigil id="22" name="Remove">remove</sigil>
<sigil id="23" name="Health">health</sigil>
<sigil id="24" name="Life">life</sigil>
<sigil id="25" name="Space">death</sigil>
</Sigil_list>
</Magic>

 

EDIT:

xml was wrong, tnx Korrode :whistle:

 

EDIT2:

lol, tnx Korrode and bkc56, there was a wrong radiation spell

Edited by Fedora

Share this post


Link to post
Share on other sites

Both new features looks really nice. I have not been at home for a week so have had very little time to try them out. One issue was that without the new spells.xml file, the old sigils window did not display the sigil icons. IMHO, the old window should work as it did before, with or without the xml file is - may be the new window should not be the default (or could be disabled) if the file is missing. I'm happy to check and commit this patch to CVS but I may not be able to work on it for a couple of days; so shout if someone else is working on it....

Share this post


Link to post
Share on other sites
Both new features looks really nice. I have not been at home for a week so have had very little time to try them out. One issue was that without the new spells.xml file, the old sigils window did not display the sigil icons. IMHO, the old window should work as it did before, with or without the xml file is - may be the new window should not be the default (or could be disabled) if the file is missing. I'm happy to check and commit this patch to CVS but I may not be able to work on it for a couple of days; so shout if someone else is working on it....

 

You're right. I moved sigils to the xml beacuse they were hard coded in the init_spell...so ugly :)

I can easily set sigils if the xml fails to load. Not sure what window is best to show as default...I'm all for the new spell win, but let's hear Ent about this.

 

I'll post the patch with these changes tomorrow at most.

Share this post


Link to post
Share on other sites
You're right. I moved sigils to the xml beacuse they were hard coded in the init_spell...so ugly :)

:)

I can easily set sigils if the xml fails to load. Not sure what window is best to show as default...I'm all for the new spell win, but let's hear Ent about this.

I'm happy with the new being the the default. Just if the new xml is missing, may be for now, default back to the (fixed) old? I assume the old window will eventually get removed.

Edited by bluap

Share this post


Link to post
Share on other sites

Patch updated. If xml fails, loads sigils manually and start the sigil window as default (and doesn't allow to switch to spell window). Otherwise loads sigils from xml and starts the spell window as default.

Share this post


Link to post
Share on other sites

I've worked through the patch changes proving a second pair of eyes and given the new features a shake out. It all looks fine so I've commited the patch to CVS. However, the changes were quite large in a few places so we need more testing to be sure it's all OK. We could of used #defs to give a simple roll-back but I think that would have been very confusing code-wise. The changes are well isolated to a few files and I will take the responsibility to roll-back using CVS in the unlikely event that we need to to that. :lurker:

 

One thing I did notice was that the first line of pixels on the greyed out icons on the spells window is not greyed out. This may be something that varies between different graphics card drivers an so I did not fix it for now. The fix for me is this:

Index: spells.c
===================================================================
RCS file: /cvsroot/elc/elc/spells.c,v
retrieving revision 1.91
diff -a -u -r1.91 spells.c
--- spells.c	23 Sep 2009 17:17:34 -0000	1.91
+++ spells.c	23 Sep 2009 17:27:32 -0000
@@ -601,7 +601,7 @@
		glEnd();
	}

-	if(grayed) gray_out(x_start,y_start+1,gridsize);
+	if(grayed) gray_out(x_start,y_start,gridsize);

}

 

If this is a general problem, I'll make this change.

Share this post


Link to post
Share on other sites
that damned gray_out :lurker:

coding it that way looked weird, but was the only way for me to get the greying drawn properly.

Nvidia GT95000 here, if it helps.

So do you have the same issue as me? That the fist line of pixels is not greyed out?

Share this post


Link to post
Share on other sites

When I'm in the mini-spell window, and have a spell selected (displays the essence and mana needed), if I mouse-over the spell icon (lower left of window) I get red text "(not enough reagents)" when there clearly are enough.

 

I'm not sure what it's suppose to say at that point, but the message I get is not correct.

Share this post


Link to post
Share on other sites
When I'm in the mini-spell window, and have a spell selected (displays the essence and mana needed), if I mouse-over the spell icon (lower left of window) I get red text "(not enough reagents)" when there clearly are enough.

 

I'm not sure what it's suppose to say at that point, but the message I get is not correct.

Odd... doesn't happen for me.

 

The spell window contains a little mistake recipe-wise.

 

Radiation Shield needs 4 Magic Essences instead of 4 Fire Essences.

I'll beat Fedora to it :whistle:

Fixed XML:

http://www.paradoxcomputers.com.au/stuff/spells.xml

Share this post


Link to post
Share on other sites
When I'm in the mini-spell window, and have a spell selected (displays the essence and mana needed), if I mouse-over the spell icon (lower left of window) I get red text "(not enough reagents)" when there clearly are enough.

 

I'm not sure what it's suppose to say at that point, but the message I get is not correct.

Odd... doesn't happen for me.

 

it happens to me as well, but only in small spell window

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×