Scrolling Civics Screen

strategyonly

C2C Supreme Commander
Joined
Mar 13, 2006
Messages
20,998
Location
MN
This is a LEFT side Scrolling Civics Screen.

I hope everyone enjoys it, i think it's Great, but that's just my opinion.

Download here: http://forums.civfanatics.com/downloads.php?do=file&id=13457

Credits:

Spoiler :
EmperorFool, The_J, God-Emperor, and xienwolf (for letting me know where to look)


EDIT: This IS included in the NEW version of Next War Advanced. With four other civics screens available also.
 
Looks great!

Something that's always bugged me about Civ is that the effect of changing Civics isn't calculated before hitting the "accept" button, so it's not always obvious what the end result will be. I wonder if there could be a way to incorporate a window listing the gold, science, happiness, health, hammer, prestige (etc) outputs resulting from a change of civics? These could be expressed as an average output per city compared with the current outputs.
 
I like it a lot StrategyOnly, But is there an easy way to make the fonts for the civic effects text smaller? It's too big and cuts off some information.
 
Good to see it released :goodjob:.

I hadn't seen the additional information, but with them, i'll think of incorporating it in my mod :).

Thx;), you were very helpful in incorporating this project, so thx and you can do anything you want.

I like it a lot StrategyOnly, But is there an easy way to make the fonts for the civic effects text smaller? It's too big and cuts off some information.

Take alook at this thread, i had the same problems when i started, but just read through some and experiment like i did. I made it larger cause i have a hard time reading small print.

http://forums.civfanatics.com/showthread.php?t=332846&page=2

You can change alot of what is in this.:p Actually all in all alot is easy to do, just make it the way you like it. And put a copy here, never know someone might like yours better, so have at it, and THX.;)
 
Okay. Well I figured that out, and got it looking pretty good. My only problem is that RoM adds so many Civic changes that one or two options spill way way over the current limit. Is it possible to create a 2nd slider inside of each civic box to show extra details if there are some?
 
My only problem is that RoM adds so many Civic changes that one or two options spill way way over the current limit

I ran into that too in RFRE. I just changed the 5 to a 4 to give enough space.

self.HEADINGS_HEIGHT = (((40 + self.BUTTON_SIZE + self.TEXT_MARGIN) * l/self.CIVICCATEGORIES)/4 * 2) + 35
 
I ran into that too in RFRE. I just changed the 5 to a 4 to give enough space.

self.HEADINGS_HEIGHT = (((40 + self.BUTTON_SIZE + self.TEXT_MARGIN) * l/self.CIVICCATEGORIES)/4 * 2) + 35

Well, I could do that, and what I did was add 200 to it, but they are STILL 2 or 3 civics that just have too many modifiers. And I don't want each civic screen to take up a page...

self.HEADINGS_HEIGHT = (((40 + self.BUTTON_SIZE + self.TEXT_MARGIN) * l/self.CIVICCATEGORIES)/5 * 2) + 200
 
As long as you know the order that the CivicOptions are listed in, and you are building the screen specifically for your own mod, you can make each panel individually as big/small as you need by moving from a loop to a series of commands (or by making a special exception at certain values in the loop)
 
As long as you know the order that the CivicOptions are listed in, and you are building the screen specifically for your own mod, you can make each panel individually as big/small as you need by moving from a loop to a series of commands (or by making a special exception at certain values in the loop)


True. But I still like the idea of having a scroll bar in each civic box, displaying any extra text.

However, I remember Johnny Smith saying that you can't have multiline items inside a scroll screen, or something like that. Would that make my idea impossible?
 
You cannot have a scrollable item in another scrollable item unfortunately. And multiline text is a scrollable item. The trick I learned for this civic screen was a way to break down a multiline item into a series of single lines automatically. Otherwise we'd still have the original version which left out some naturally multi-line fields.
 
You cannot have a scrollable item in another scrollable item unfortunately. And multiline text is a scrollable item. The trick I learned for this civic screen was a way to break down a multiline item into a series of single lines automatically. Otherwise we'd still have the original version which left out some naturally multi-line fields.

Is that some sort of Python rule, or just a limitation of Civ?

Well, I guess the next best option would be to have it dynamically change the size of each box, based on the amount of text shown. Is there an easy way to get a civic box to change size just based on how much info will show up on the screen for that particular civic?
 
Not sure which one the rule belongs to. I would imagine python though, since the complication is likely a failure to understand which container to send scrollwheel events to.

Dynamically changing the box dimensions would require rebuilding the screen whenever you change what you are viewing, which would possibly be quick enough not to be noticed, but you have to be sure that you re-scroll to the previous view, or the user winds up back at the top of the screen every time they mouse over something new.
 
Not sure which one the rule belongs to. I would imagine python though, since the complication is likely a failure to understand which container to send scrollwheel events to.

Dynamically changing the box dimensions would require rebuilding the screen whenever you change what you are viewing, which would possibly be quick enough not to be noticed, but you have to be sure that you re-scroll to the previous view, or the user winds up back at the top of the screen every time they mouse over something new.

Dang. That's worse than having to seperate all the multiline's into single lines.

How exactly does the multiline -> single line conversion work? How hard is it to do?
 
It's just a loop with a standard python command to chunk off a section of a string until a linebreak is found. Loop ends when the string is empty.

I'm no python wiz. Can you upload your CivicScreen.py as an example?
 
I thought that this screen would have already used it. Given strategyonly's aversion to DLL modification, it HAS to use it actually. The original scrolling civic screen had tons of DLL additions to break the normal multi-line parse into a series of single line parses.

Code:
		szHelpText = CyGameTextMgr().parseCivicInfoRequires(iCivic, False, True, True)
		HelpList = szHelpText.splitlines()
		i = 0
		for item in HelpList:
			szPanelIDReqItem = "CivicListReq"+str(iCivicOption)+str(i)
			screen.setTextAt( szPanelIDReqItem, "CivicList", u"<font=2>" + item + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + self.HEADINGS_WIDTH / 4 + 150, fY - self.TEXT_MARGIN / 2, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += self.TEXT_MARGIN
			i += 1

The python command to break up the multiline was just szHelpText.splitlines(). This then provided me with a list of one-line strings.
 
I thought that this screen would have already used it. Given strategyonly's aversion to DLL modification, it HAS to use it actually. The original scrolling civic screen had tons of DLL additions to break the normal multi-line parse into a series of single line parses.

Code:
        szHelpText = CyGameTextMgr().parseCivicInfoRequires(iCivic, False, True, True)
        HelpList = szHelpText.splitlines()
        i = 0
        for item in HelpList:
            szPanelIDReqItem = "CivicListReq"+str(iCivicOption)+str(i)
            screen.setTextAt( szPanelIDReqItem, "CivicList", u"<font=2>" + item + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + self.HEADINGS_WIDTH / 4 + 150, fY - self.TEXT_MARGIN / 2, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
            fY += self.TEXT_MARGIN
            i += 1
The python command to break up the multiline was just szHelpText.splitlines(). This then provided me with a list of one-line strings.

I just searched in the file, it does have that. Does that one line break them all up, or do you need to do it, modifier by modifier?
 
Top Bottom