IRC logs for #openttd.dev on OFTC at 2013-05-29
⏴ go to previous day
06:24:39 *** Supercheese_ has joined #openttd.dev
06:49:23 *** Supercheese_ has left #openttd.dev
06:49:49 *** Supercheese_ has joined #openttd.dev
06:50:07 *** Supercheese_ has left #openttd.dev
06:51:00 *** Zuu has joined #openttd.dev
10:17:35 *** Ristovski has joined #openttd.dev
13:51:58 *** ntoskrnl has joined #openttd.dev
16:42:03 *** frosch123 has joined #openttd.dev
16:42:03 *** ChanServ sets mode: +v frosch123
18:30:52 *** Zuu has joined #openttd.dev
18:34:55 <frosch123> and hide it, if no gs is running
18:35:01 <frosch123> (string rename pending)
18:35:58 <frosch123> Zuu: where were you planning to put the storybook? :)
18:35:59 *** LordAro has joined #openttd.dev
18:35:59 *** ChanServ sets mode: +v LordAro
18:36:17 <frosch123> resp. are we planning a gs-controlled company league table?
18:37:31 <Zuu> frosch123: The final location would be eithere there or with a new button.
18:37:54 <frosch123> should we add a complete new gs button instead?
18:38:02 <frosch123> gs button with goals, story, highscore?
18:38:15 <planetmaker> would then open it automatically in the presence of a GS?
18:38:41 <planetmaker> I don't think it needs a new button. After all the company league table *is* the goal for TTD in some terms
18:38:47 <frosch123> planetmaker: question is whether the current league/detailed rating shuold be kept when a gs is active
18:38:57 <frosch123> ah, well, i think we just put them all in the same menu
18:39:08 <frosch123> and graudally disable the defualt stuff when gs provides a replacement
18:39:43 <Zuu> Sounds as a good idea, and save us from designing a new button icon. :-)
18:39:45 <planetmaker> yes... I think that's a good approach
18:40:19 <frosch123> so, above patch + string rename?
18:41:14 <Zuu> Displaying the goals and/or story book window for the user if there is a goal/story is a good idea. In the StoryBook API there is a method to display a specific page. If the book is hidden/not open, it will be opened.
18:42:41 <Zuu> But perhaps it is a good idea that OpenTTD displays one/both of them when a company is created and there is a goal/story page or when the first goal/story page is created. (in some cases the player joins first and the goals come a few moments later)
19:19:11 <LordAro> Zuu: i'm gonna guess it's nothing to do with SQL, as i keep reading that as the name of your patch file :)
19:19:44 <LordAro> look kinda similar though :)
19:19:58 <Zuu> Its a squirrel fix, solution #1, version 3 :-)
19:20:49 <LordAro> i have since guessed that, after bothering to look inside the file :)
20:02:55 <Zuu> I see the story book as the overall objectives of a game. Thus I place it above goals in the league menu. Does that sound reasonable, or should it go below the goal window?
20:03:56 <frosch123> the one which you need to open more often should be top
20:04:13 <frosch123> because yuo get it with the direct click instead of via the menu
20:04:20 <frosch123> i would think you need the goals more often
20:04:40 <Zuu> Maybe a GS with a story will show the story book automagically when you reach a new chapter. Thus goals are more often viewed manually.
20:05:11 <frosch123> maybe we can also let the gs decide the order :p
20:41:36 <Zuu> What may still be remaining is to get an artist to make icons for the location and goal page element.
20:42:01 <Zuu> Which means that I should ask in the graphics forum for some help with that. :-)
20:44:47 <Zuu> Also, clicking on a goal reference now only opens the goal window. Perhaps it should scroll to the clicked goal.
20:47:43 <frosch123> +extern const ChunkHandler _story_page_element_chunk_handlers[] = { <- isn't there usually only one of those ChunkHandler array per file?
20:49:01 <Zuu> Maybe. I think I used goals as role model and it didn't show how to do it in the case of many saved elements in the same file. I'll have a look.
20:50:33 <Zuu> You are right, eg. CargoMonitor uses one chunk handler for multiple chunks.
20:51:41 <Zuu> Also, I made the mistake to use the same code for both chucks. I'll correct that.
20:52:27 <frosch123> + StoryPageElementType type = (StoryPageElementType) (CompanyID)GB(p1, 16, 16); <- the CompanyID is too much there
20:53:57 <frosch123> + StoryPageElementID page_element_id = (CompanyID)GB(p1, 0, 16); <- some c&p :)
20:54:52 <frosch123> + if (!StoryPageElement::CanAllocateItem()) return CMD_ERROR; <- that is not needed in CmdUpdateStoryPageElement, is it?
20:55:57 <frosch123> + if (!StoryPage::IsValidID(p1)) return CMD_ERROR; <- always assign the parameters first to some variable of the correct type, i.e. StoryPageId
20:55:59 <Zuu> No, it shouldn't be in the Update function.
20:56:10 <frosch123> there might be trouble if the id is sometimes casted to uint32 or uint16
20:57:00 <frosch123> + if (p == NULL) return CommandCost(); <- CmdRemoveStoryPage: can that even happen?
20:57:12 <frosch123> wouldn't IsValid return false, or Get assert ?
20:58:06 <frosch123> +typedef Pool<StoryPageElement, StoryPageElementID, 1, 1024> StoryPageElementPool; <- use the same amounts as for goals? 64, 64000 ?
20:58:34 <Rubidium> the saveload file has tabs and spaces mixed up in the desc tables
20:58:55 <frosch123> +enum StoryPageElementType { <- missing doxygen
20:59:23 <Zuu> <frosch123> + if (p == NULL) return CommandCost(); <- CmdRemoveStoryPage: can that even happen? <------- I don't see that it can happen. I'll remove that check.
20:59:28 <Rubidium> \ No newline at end of file <- not sure there's something in the coding style about this, but it's better to not have those
20:59:58 <Zuu> <Rubidium> \ No newline at end of file <- not sure there's something in the coding style about this, but it's better to not have those <--- I saw that one too in the saveload file and fixed it locally before your comment. :-)
21:01:22 <Zuu> <frosch123> +typedef Pool<StoryPageElement, StoryPageElementID, 1, 1024> StoryPageElementPool; <- use the same amounts as for goals? 64, 64000 ? <------ that could go. There is a soft limit of max 128 elements per page. It could be raised but the performance of a scrolled list with line warp is worse than without line warp.
21:01:24 <Rubidium> I'm seeing it in more files
21:01:50 <Zuu> Rubidium: I'll look that over. I fixed some before uploading the patches, but there could be some remaining.
21:02:32 <frosch123> + switch(widget) { <- 30: missing space
21:03:41 <frosch123> + PopupMainToolbMenu(w, WID_TN_LEAGUE, STR_GRAPH_MENU_GOAL, _networking ? 3 : 4, Game::GetInstance() != NULL ? 0 : 2); <- also need to increase the "count", you are cutting the last item
21:04:43 <Rubidium> 30: @@ -227,13 changes g -> p, which you added a patch or two earlier
21:04:51 <frosch123> +STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Jumpt to a specific page by selecting it in this drop down list. <- "Jump"
21:06:34 <frosch123> + if ((g->company != INVALID_COMPANY && g->company == _local_company) || (g->company == INVALID_COMPANY && Company::IsValidID(_local_company))) ShowStoryBook(p1); <- should non-company specific pages also pop up for spectators?
21:06:44 <Rubidium> we could do with a tron-esque "constify" session ;)
21:07:25 <frosch123> 40: you are moving SetSelectedPage here. if this is needed, it could be done in an earlier diff
21:07:48 <frosch123> also there is a \n in front of a { in that function
21:12:21 <Zuu> <Rubidium> 30: @@ -227,13 changes g -> p, which you added a patch or two earlier <--- now fixed. It was a fix of g->p recorded in the wrong patch.
21:13:23 <Zuu> <frosch123> + PopupMainToolbMenu(w, WID_TN_LEAGUE, STR_GRAPH_MENU_GOAL, _networking ? 3 : 4, Game::GetInstance() != NULL ? 0 : 2); <- also need to increase the "count", you are cutting the last item <---- Thanks, I had the idea that the last param was # of optional items, but was not really sure and should have remembered to look this up.
21:16:32 <Zuu> should non-company specific pages also pop up for spectators? <----- I think I had in mind that the story book might be going to end up with its own main toolbar button where there might be a story book per company.
21:18:01 <Zuu> In practice when new companies can join at any time of a game, the only useful way to mix company specific and non-company specific pages is to place the non company specific pages first.
21:18:03 <frosch123> ah, i see. you do not know which story book to pop up for spectators
21:19:01 <Zuu> So one solution is to just show the global pages for a spectator. But that may give an odd end in the story if the GS author is not careful.
21:20:14 <frosch123> hmm... it did not quite occur to me yet. but company specific goals and stories are actually secret, i.e hidden from other companies :o usually you can see everything they have
21:20:20 <Zuu> <frosch123> 40: you are moving SetSelectedPage here. if this is needed, it could be done in an earlier diff <---- the function is moved because it needs to become public in that patch while earlier it had no reason to be public.
21:20:57 <Zuu> frosch123: well, they are in the savegame so a custom client could see them.
21:21:26 <Zuu> But yes, our GUI do currently not allow seeing them.
21:21:45 <frosch123> might be a feature :)
21:21:58 <frosch123> "secret" stuff fits better to goals, than to vehicles
21:22:52 <frosch123> ok, not having "secret" stuff makes maphacks superfluous :)
21:22:57 <Zuu> If we now follow the path to move these to the league menu and make that the home for GS goals etc., the solution would then be a company selector for the goal and story book window rather than selecting company in the menu.
21:23:33 <Zuu> Incidently the company league table also uses a company selector and is in the same menu. :-)
21:24:09 <frosch123> well, i would rather add a new icon to the toolbar than having a company selector in the window
21:24:17 <frosch123> a company selector in the window would be very inconsistent :)
21:24:30 <frosch123> we only have that in the script debug gui, and there it is kind of useful :p
21:25:15 <Zuu> Its also in the "detailend performance raiting" window
21:26:52 <Zuu> So that would be two new buttons. One for goals and one for story books. Both could appear only if there is > 0 goals/story pages.
21:27:42 <Zuu> If the main menu allow dynamic showing/hiding buttons in a runnig game.
21:28:09 <Zuu> Or they show when a GS is present and are grayed out if the GS do not provide any goal/page.
continue to next day ⏵