create account

Steemnova - Show current techlevel in the techtree by mwfiae

View this thread on: hive.blogpeakd.comecency.com
· @mwfiae · (edited)
$81.92
Steemnova - Show current techlevel in the techtree
## Bug Fixes
### What was the issue?
In the techtree if a requirement is fulfilled it only shows the required level of the technology instead of the current level.

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519251978/sbzewyoz189xn2rnmkcg.png)
So even though your own shipyard level is way higher, it only displays it as level 1 in the techtree for ships that require only a level 1 shipyard.

This is very confusing for the player as he doesn't see the real level of the technology/building/etc he owns. 

If the requirement is not met it already displays the current level, but in red color.
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519252147/dnhuo8vfg0yvaldeqluc.png)

### What was the solution?
In the techtree template the min function was used to determine what level was lower, the required level (saved in "$NeedLevel.count") or the current level (saved in "$NeedLevel.own"). This level was then displayed. 

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1519252397/st1oyhstfsu4litauinn.png)

To fix this issue, I removed the call to the min function altogether. So now the current level is always displayed independent of the requirement.

### Github-Links
[Repository](https://github.com/steemnova/steemnova)

[Pull Request](https://github.com/steemnova/steemnova/pull/32)

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@mwfiae/steemnova-show-current-techlevel-in-the-techtree">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 201 others
properties (23)
authormwfiae
permlinksteemnova-show-current-techlevel-in-the-techtree
categoryutopian-io
json_metadata{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":118179003,"name":"steemnova","full_name":"steemnova/steemnova","html_url":"https://github.com/steemnova/steemnova","fork":false,"owner":{"login":"steemnova"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","steemnova","bugfix","techtree","level"],"links":["https://github.com/steemnova/steemnova","https://github.com/steemnova/steemnova/pull/32","https://utopian.io/utopian-io/@mwfiae/steemnova-show-current-techlevel-in-the-techtree"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1519251978/sbzewyoz189xn2rnmkcg.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1519252147/dnhuo8vfg0yvaldeqluc.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1519252397/st1oyhstfsu4litauinn.png"],"moderator":{"account":"vladimir-simovic","time":"2018-02-24T13:09:52.837Z","reviewed":true,"pending":false,"flagged":false},"questions":[],"score":0}
created2018-02-21 22:43:21
last_update2018-02-24 13:09:51
depth0
children6
last_payout2018-02-28 22:43:21
cashout_time1969-12-31 23:59:59
total_payout_value58.210 HBD
curator_payout_value23.714 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,532
author_reputation8,649,692,852,318
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id39,453,974
net_rshares18,252,967,795,990
author_curate_reward""
vote details (265)
@harrymansur ·
Your post is very good
properties (22)
authorharrymansur
permlinkre-mwfiae-steemnova-show-current-techlevel-in-the-techtree-20180226t143119006z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-02-26 14:31:24
last_update2018-02-26 14:31:24
depth1
children0
last_payout2018-03-05 14:31:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation24,975,261,340
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,615,300
net_rshares0
@steemitstats ·
@mwfiae, Like your contribution, upvote.
properties (22)
authorsteemitstats
permlink20180221t224541122z-post
categoryutopian-io
json_metadata{"tags":["utopian-io"]}
created2018-02-21 22:45:54
last_update2018-02-21 22:45:54
depth1
children0
last_payout2018-02-28 22:45:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length40
author_reputation351,882,871,185
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id39,454,398
net_rshares0
@utopian-1up ·
<div class="pull-left">

![1UP-Kayrex_tiny.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515383984/ekyf2thxg7j2t0qro1h3.png)

</div>

<div class="text-justify">


### You've got upvoted by <code>Utopian-1UP</code>!
You can give up to ten [1UP](https://steemit.com/utopian-io/@steem-plus/steemplus-2-4-utopian-1up-is-here)'s to Utopian posts every day after they are accepted by a Utopian moderator and before they are upvoted by the official @utopian-io account. Install the @steem-plus browser extension to use 1UP. By following the 1UP-trail using [SteemAuto](https://steemauto.com/) you support great Utopian authors and earn high curation rewards at the same time. 

<hr>

1UP is neither organized nor endorsed by Utopian.io!

</div>
properties (22)
authorutopian-1up
permlink20180224t155851256z
categoryutopian-io
json_metadata{"app":"1up"}
created2018-02-24 15:58:51
last_update2018-02-24 15:58:51
depth1
children0
last_payout2018-03-03 15:58:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length764
author_reputation2,324,758,056,093
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,123,793
net_rshares0
@utopian-io ·
### Hey @mwfiae I am @utopian-io. I have just upvoted you!
#### Achievements
- WOW WOW WOW People loved what you did here. GREAT JOB!
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-mwfiae-steemnova-show-current-techlevel-in-the-techtree-20180225t100633880z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-02-25 10:06:33
last_update2018-02-25 10:06:33
depth1
children0
last_payout2018-03-04 10:06:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,139
author_reputation152,955,367,999,756
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,301,202
net_rshares0
@vladimir-simovic ·
$0.05
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/uTyJkNm).
**[[utopian-moderator]](https://utopian.io/moderators)**
👍  
properties (23)
authorvladimir-simovic
permlinkre-mwfiae-steemnova-show-current-techlevel-in-the-techtree-20180224t130948871z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-02-24 13:09:57
last_update2018-02-24 13:09:57
depth1
children1
last_payout2018-03-03 13:09:57
cashout_time1969-12-31 23:59:59
total_payout_value0.044 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length172
author_reputation56,930,790,558,862
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,089,930
net_rshares10,107,711,970
author_curate_reward""
vote details (1)
@mwfiae ·
Thanks Vlad! :)
properties (22)
authormwfiae
permlinkre-vladimir-simovic-re-mwfiae-steemnova-show-current-techlevel-in-the-techtree-20180224t133003485z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-02-24 13:30:06
last_update2018-02-24 13:30:06
depth2
children0
last_payout2018-03-03 13:30:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation8,649,692,852,318
root_title"Steemnova - Show current techlevel in the techtree"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id40,093,717
net_rshares0