jpcsupplies / Economy_mod

Basic Economy System for Space Engineers
13 stars 12 forks source link

plz make a option for lcd to scroll #184

Closed OminiData closed 5 years ago

OminiData commented 5 years ago

can you make an option for the lcd to scroll and or grouping so you can show all the items on the lcd(for example all components can't be showen on 1 screen)

midspace commented 5 years ago

Use the paging functionality. Put P1 in LCD1, P2 in LCD2, et cetera.

jpcsupplies commented 5 years ago

If you want more fine control you can also use # symbol to display from a particular line as well. Example - to display all components that would be off screen (page 2) on an overcrowded LCD LCD Name: [economy] Public Title: components P2

Exmaple - to display all the components from line 20 onwards only: LCD Name: [economy] Public Title: components #20

jpcsupplies commented 5 years ago

Thanks for your suggestion @OminiData I had considered scrolling for the small 1 line lcd displays; like a stock ticker but other than being a gimmick it would not really be useful enough to justify the extra game performance it would consume just to scroll some text on a screen - which players would probably not look at anyway. Particularly when similar functionality can be achieved with the paging or line select tags discussed above. (or even programing a programming block to alter the public title text using the # line option above to scroll it themself using in game scripting if they really wanted.)

If you really have your heart set on using a single LCD to display multiple pages of prices - you could make a programming block script that ran two loops. One waits a second or so, while the second simply changes the Public title text where the # tag or P tag is and increments the number between 1 and 10 or similar and replaces the public title text.

Using the # tag would make the price list scroll up 1 line every second or so, or using the P tag would make it flip pages every second or so.

Chat to some people in the keen programming discord channel they can probably even suggest some simple code to do it since all it needs to do is using a timer to trigger a script which checks the public title of a specific lcd, and then increments one of the # or P fields

Something along these lines: (this wont work but its in the ballpark of what you need to do to make it scroll up 10 lines)

To get the number out of public title - string[] getcount = lcd.GetPublicTitle().Split(new char[] { '#' })

Which would give you a list whose second entry was the current number int count = System.Convert.ToInt(getcount(1));

then something like this to increment it and replace the public text field - if (count<10) { count++; } else { count=1; ) text='components #' . count; lcd.WritePublicTitle(text);

Another approach is simply have it wait a few seconds then change the text between "components" "ore" "tools" etc if you want to flip the information displayed or a combination of the two.

jpcsupplies commented 5 years ago

supercede to #164