Page 1 of 3
various improvements for ease of empire management
Posted: Tue May 30, 2017 6:04 am
by siyoa
*** FOR LATEST FILES CHECK THIS POST ***
it should now work in Mod folder just fine, also cleaned up PopIcons.lua so that it contains only the function I added
any issue, please let me know
if you want just empty slots showing (and not fancy icons for population), you only need
@PlanetListPane.lua from the zip file
*** 2018-May-05 ***
added race icons and orbital structures to
@PlanetListPane.lua, to enable change following variable to
true, it is at the very beginning of the file
added Population Pane (credit Harpy Eagle, thanks
)
*** known issues ***
sorting doesn't work properly
Code: Select all
--[[ *** Show RACE icons *** ]]--
local eee_show_race_icons=false
--[[ *** END *** ]]--
Re: various improvements for ease of empire management
Posted: Sun Mar 18, 2018 2:27 am
by siyoa
so, I redesigned this ... it no longer shows on planet pane ... it shows on star system overview
the reason I like this, is that it helps me to micro manage the game ... I now can quickly say if I have all races available to me on the particular planet to maximize population cap and to unlock as many improvement slots as I can
I am function over form, so it is ugly, is there anyone willing to help me figure out how to change the text to nice little icons representing races ? I was looking into the code a bit and it goes beyond what I want to spend on it
EDIT: the file doesn't contain all races in the game, just edit as necessary
Re: various improvements for ease of empire management
Posted: Thu Mar 22, 2018 4:38 am
by siyoa
showing amount of available empty improvement slots on Planetary Report
EDIT: renamed the thread, also can it please be moved to mods area ? thanks
Re: various improvements for ease of empire management
Posted: Sat Mar 24, 2018 7:27 pm
by siyoa
siyoa wrote:EDIT: the file doesn't contain all races in the game, just edit as necessary
for adding tinkers (they like to play tricks), the edit needs to look like this
Code: Select all
local raw = remove_race_suffix(race)
if raw == 'tinker' then eee_pop_sum=tostring (eee_pop_sum..'ti.') end
Re: various improvements for ease of empire management
Posted: Sun Mar 25, 2018 10:04 pm
by siyoa
that thing about tinkers got me thinking, my approach is sub-optimal here, not really taking into account unhappy or harmonized type of population, every race should really be stripped of suffix
anyway, I may redo it completely, it seems I figured how to show race icon, all I need now is to make the size smaller and figure were to place it
Re: various improvements for ease of empire management
Posted: Sun Mar 25, 2018 10:31 pm
by siyoa
I think I got it, for now
Re: various improvements for ease of empire management
Posted: Sun Mar 25, 2018 10:35 pm
by siyoa
hmm, I may need a help here from Sven or Arioch
it seems that chibi_draw shows the same icon for human dissidents as it is for regular humans, or quite possibly I am doing something wrong
Re: various improvements for ease of empire management
Posted: Sun Mar 25, 2018 11:02 pm
by siyoa
this maybe a solution, scaling is probably not perfect, you need both files as I had to create new function in PopIcons.lua
Re: various improvements for ease of empire management
Posted: Sun Apr 01, 2018 10:09 pm
by siyoa
trying to add a number for each population (I also added tanks to be displayed here) ... I am failing badly, I just cannot think today
basing my approach as per the picture (in other words, looking into the code of
ShipMidscreenPane.lua) ... do I have to use
add_resize_callback | function () ? or is there a way around ? is it even possible in
PlanetRow.lua ? please help
Re: various improvements for ease of empire management
Posted: Tue Apr 03, 2018 4:53 pm
by siyoa
sven ? arioch ?
Re: various improvements for ease of empire management
Posted: Sat Apr 07, 2018 12:13 pm
by zolobolo
Hi Siyoa
Looks really inserting: displaying icons and troop types/number on planet should be very useful if large amount of planets to keep track of everything without having to browse through a lot of planets
Question: which file should be downloaded for the icons and troop numbers on the planet? You have attached a couple of additions files since the original upload
Also: would you be interested to do a pie-chart based on the cum of all pop types in the diplomacy menu - wherever it can be inserted?
This is nothing important game-play wise but it should look rely cool to see the empire composition. Think Stellaris had something like this, but due to the boring graph elements I don1t think anyone rely looked at it - should not be a problem with these pop icons though
Re: various improvements for ease of empire management
Posted: Sat Apr 07, 2018 9:30 pm
by sven
siyoa wrote:it seems that chibi_draw shows the same icon for human dissidents as it is for regular humans, or quite possibly I am doing something wrong
You're not doing anything wrong -- there is no chibi asset for any of the dissident types. Because they can't be moved, the vanilla version of the game doesn't include any chibi assets for them. The standard fallback behavior when a popicon asset doesn't exist is just to draw the 'vanilla' version of that pop -- and you're hitting that behavior here.
Re: various improvements for ease of empire management
Posted: Sat Apr 07, 2018 9:47 pm
by sven
siyoa wrote:basing my approach as per the picture (in other words, looking into the code of
ShipMidscreenPane.lua) ... do I have to use
add_resize_callback | function () ? or is there a way around ? is it even possible in
PlanetRow.lua ? please help
OK -- I'm back after a bit of a hiatus, and catching up on old messages / bug reports.
Basically, the number in the chibi passenger display is a bit tricky, because it's a pre-rendered asset that needs to be re-rendered anytime the screen resolution changes. The easiest way to get one in PlanetRow.lua would be to render one using the tooltip_text_context, which is a sortof global misc-text render rendering context you can use for this kindof stuff. You don't need to render it inside an add_resize_callback, but, you do need to do something to ensure it gets re-rendered on screen resizes, and, obviously, you don't want to re-render a new asset on each screen refresh. I usually use weak memoization hacks in this kind of situation.
So, putting all that nonense together; I'd suggest writing a helper function that looked kinda like this:
Code: Select all
local shadow_options = {sigma=.8,spread=.5,opacity=.9}
local small_shadowed_word_drawer = weak_memoizeNN | function(text)
local tooltip_text_context in SCOPE._ELEMENT_ENV
local word= tooltip_text_context!.lazy_word_render('vera14',text)
if not word.draw_shadow
shadowed_word(shadow_options,word)
end
return function(cx,cy)
local x=cx-word.w*.5
local y=cy
word.draw_shadow(x,y)
word.draw(x,y)
end
end
Then you can draw your numbers (with back shadow) using something like:
Code: Select all
small_shadowed_word_drawer(format("%d",2))(x,y)
Re: various improvements for ease of empire management
Posted: Mon Apr 09, 2018 4:32 am
by grothmag
siyoa wrote:showing amount of available empty improvement slots on Planetary Report
I hope it's OK to ask a question here - I don't want to add a new topic to Modding overall, though this question might be about how to use mods in general.
I've tried to use this very useful and quite simple mod, but no change to the Planet List is observed.
I've placed the @PlanetListPane.lua file in:
(game directory)\Mods\ShowPlanetSitesAvailable\GUI\~GalaxyMap
...which mirrors the original file location, but with Mods in place of "Lua state". On startup, the game correctly shows ShowPlanetSitesAvailable as an installed mod, so the folder is seen. But the change (just to planet_draw(), I think) does nothing. The same is true for attempting to use the PopIcons/PlanetRow mod.
I apologize for asking a mod user question on a thread meant for mod devs, but I don't see a more appropriate forum. I've read makingmods.txt, and
http://stars-in-shadow.com/modding.html, but as far as I can tell I'm doing as they instruct. Akkamaddi's examples create a "Lua state" folder in the Mod directory, but that contradicts MakingMods.txt and prevents easy uninstall when using multiple mods.
Re: various improvements for ease of empire management
Posted: Mon Apr 09, 2018 4:52 am
by sven
grothmag wrote:siyoa wrote:showing amount of available empty improvement slots on Planetary Report
I hope it's OK to ask a question here - I don't want to add a new topic to Modding overall, though this question might be about how to use mods in general.
I've tried to use this very useful and quite simple mod, but no change to the Planet List is observed.
I've placed the @PlanetListPane.lua file in:
(game directory)\Mods\ShowPlanetSitesAvailable\GUI\~GalaxyMap
I'm afraid this is another instance of the modding bug I was
discussing with harpy eagle earlier today. Long story short, to make the mod work inside the Mods\ subdir, you'll probably need to add the line
Code: Select all
reload_script [[GUI\~GalaxyMap\GalaxyMap.lua]]
To the bottom of the PlanetRow.lua file.
In a perfect world, this wouldn't be necessary; I will see if I can update the way mod loading works under-the-hood so that these kinds of strange reload hints aren't needed.