IRC logs for #openttd on OFTC at 2025-10-29
⏴ go to previous day
00:00:00 <peter1138> "addition of the tracktypes menu"?
00:00:05 <_glx_> and it really affects button behaviour, old style is click to autoselect last used and hold to open the menu, new style is click to open the menu but hold and drag still works (the autoselect part is gone)
00:08:21 <zanooda2000> Is it possible to add some kind of tag "dropdown" to the search to make this (trad.buttons) setting easier to find?
00:27:19 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
00:30:06 <peter1138> I mean, the word "button" does not actually appear in the setting at all.
00:30:30 <peter1138> Well, other than "mouse button" in description.
01:07:10 <zanooda2000> peter1138: Ah, right. But still, it's searchable for "butt" or "menu", but not for "drop" Although at least for me it is closer to dropdown behaviour than a button or menu.
01:07:10 <zanooda2000> I might even suggest moving it to Settings → General, let's say it should replace currency, since this setting has really huge impact on interface speed and convinience. Currency is not that important and probably could be moved to advecned→localisation.
01:07:10 <zanooda2000> *Have you tried playing with this setting yourself, pretending that you don't know that this actually setting and it can be changed?*
01:13:36 *** Wormnest has joined #openttd
01:58:45 *** tokai|noir has joined #openttd
01:58:45 *** ChanServ sets mode: +v tokai|noir
02:01:45 *** herms2 has quit IRC (Quit: bye)
02:05:44 *** tokai has quit IRC (Ping timeout: 480 seconds)
03:59:01 *** gnu_jj_ has joined #openttd
04:02:19 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:09:52 *** WormnestAndroid has quit IRC (Remote host closed the connection)
04:09:56 *** WormnestAndroid has joined #openttd
04:41:19 <DorpsGek> - Update: Translations from eints (by translators)
04:41:44 *** Zathras has joined #openttd
04:45:16 *** Zathras_11 has quit IRC (Ping timeout: 480 seconds)
05:50:33 *** firepup650 has joined #openttd
05:58:57 *** Smedles has joined #openttd
06:04:45 *** firepup650 has quit IRC (Quit: Going down with the ship)
07:31:17 <LordAro> have you pretended you don't know stuff today?
07:32:04 <LordAro> awful attitude aside, i am also surprised that 'dropdown' doesn't appear anywhere in the setting
07:37:14 <andythenorth> I don’t know stuff
07:37:22 <andythenorth> Will coffee help?
07:38:59 <reldred> Sometimes I feel like I should pretend I don't know more stuff. Now I'm being volunteered to do a whole bunch more stuff to bail out some people in another deparment who pretended they know more stuff than they actually do now I have to help them actually do that stuff that they pretended to know how to do but actually don't.
07:40:16 <mnhebi> reldred: Curse of the tism in work life. They just stack more work on you with no benefit at all.
07:40:57 <reldred> eh I don't care much, my manager is making it clear we're not taking ownership of their fuckup
07:42:18 <reldred> i just turn up every day 🙂
07:44:56 <andythenorth> Do it all again next day
07:45:52 <andythenorth> Is my avatar still HEQS?
07:46:41 *** SigHunter has joined #openttd
07:46:56 *** SigHunter_ has quit IRC (Ping timeout: 480 seconds)
08:08:44 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
08:11:24 <reldred> I was gonna play a steeltown game wasn't I?
08:18:03 <kuhnovic> I'm trying to add a dropdown to a window, but I want it to only show up in the scenario editor. Is there a good way to do this without duplicating the whole nested structure?
08:22:34 <peter1138> Wrap it with an NWID_SELECTION widget.
08:23:54 <reldred> I think my brain is too smooth for steeltown
08:24:31 <andythenorth> I'm not sure Steeltown is actually fun
08:24:35 <andythenorth> more sort of 'compelling'
08:26:46 <reldred> Yeah I honestly kinda like some of the basic economies for their focus, like, you can't produce everything in one region, the world is bigger than just your little slice of it. Like the import/export stuff with ports/wharfs/whatever or the off map import/export that industries of the caribbean has
08:28:33 <reldred> maybe what I want is a good scenario to play
08:28:38 <reldred> i don't know what I want
08:31:51 <Borg> hmm, where I can palette definitions? or its loaded from some data file?
08:32:03 <Borg> grepping around PAL_DOS doesnt gets any results really
08:34:58 <Borg> reldred: try BSPI then :P
08:37:54 <reldred> nah, trying pirs again
08:45:21 <LordAro> protip, 'review' your own PR to avoid these sort of messages
08:48:47 <LordAro> additional protip, though i appreciate this depends on the reviewer (and workflow) in question, i don't require 'done' comments on every thread. thumbs up or just resolving the thread is fine if it requires no further input
08:49:22 <peter1138> Yeah, but I don't know if they're in chat.
08:49:42 <LordAro> hence why i didn't try to ping them :p
08:49:43 <reldred> they're on the other side of the veil
08:49:58 <LordAro> iirc the username as it appeared in irc was something different...
08:50:43 <reldred> showed as 'janisozaur (via GitHub)' on disco
08:51:10 <reldred> has been a lil while since I was on eye are sea
08:57:53 *** SigHunter has joined #openttd
08:58:18 <peter1138> That isn't them on Discord, that's just the bot posting it.
09:04:29 <reldred> they appear to be the same person, their github profile and their discord profile have the same profile pic, and their discord profile has their github profile linked.
09:04:55 <Borg> ahhh Ruby to the rescue.. quickly hacked palette viewer :>
09:23:09 <kaji_kaede> peter1138: No, that actually *does* seem to be them. The bot lacks a lot of information compared to whom reldred pinged, including an associated GitHub and Reddit account.
09:32:03 *** SigHunter has joined #openttd
09:41:43 *** SigHunter_ has joined #openttd
09:45:06 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
09:59:47 <reldred> bit more of a backbone compared to other areas of the open source community at the moment
10:00:13 <reldred> fdo is sounding like a dumpster fire atm
10:04:33 <peter1138> What's happened over there?
10:07:43 <reldred> eh, all sorts of nonsense, starting to sound like bullying trans devs out of the project, inviting in known shitcunts bigots, blah blah blah
10:07:56 <reldred> I skim read things, want to hurl, and then stop reading
10:08:04 <reldred> so it's hard to get a full picture.
10:09:29 <alfagamma7> All this fuss for nothing
10:09:59 <alfagamma7> Bullying devs just because they are trans?
10:10:08 <alfagamma7> I thought that's illegal
10:10:33 <alfagamma7> I don't understand it
10:10:53 * andythenorth decides to not comment further, due to the internets
10:12:13 <talltyler> Nah politics is tax policy and foreign relations, hating people based on their identity is just being a shitty person and not something you can excuse with “it’s just my politics”
10:12:37 <alfagamma7> That's something I agree on.
10:13:19 <alfagamma7> .... anyway irl stuff is not in the purview of a 20 yo game like OpenTTD
10:13:31 <alfagamma7> so probably I will shut up.
10:13:53 <talltyler> Yeah I should leave the topic alone before I make myself mad
10:14:58 <andythenorth> rule of internets
10:15:25 <andythenorth> also all of this power dynamic arises because people are prepared to sit and write words on the internet
10:15:28 <andythenorth> which is monetisable
10:15:31 <andythenorth> and then becomes electable
10:16:27 <LordAro> "It is better to keep your mouth shut and appear stupid, than to open it and remove all doubt."
10:20:30 <andythenorth> there's a mark twain quote too
10:20:37 <andythenorth> except maybe it wasn't
10:20:44 <LordAro> "commonly attributed to"
10:20:58 <andythenorth> you know the one 😛
10:21:13 <LordAro> Quora (lol) suggests its origins are from the Book of Proverbs
10:21:19 <LordAro> "Even fools are thought wise if they keep silent, and discerning if they hold their tongues"
10:45:12 <jfkuayue> I saw a lot of 20yo bash org archives featuring in words that are definitely unsuitable to say in today's western internet
10:51:26 <Borg> _jgr_: thx :) indeed recoloring of post works like a charm :D
10:51:44 <Borg> backported your stuff, but simplified it a bit and used my own remap table.. looks splendid :D
10:52:07 <Borg> now the hardest part left... adding Link Graph overlay betwen signals...
10:57:08 <peter1138> "Link Graph" refers to cargo flows between stations.
10:58:25 <peter1138> So basically don't mess with anything to do with that, instead create something else along side to draw your lines.
11:01:09 <LordAro> jfkuayue: there is some great stuff in there though
11:06:44 <Borg> peter1138: yeah yeah I know. I just want something similar
11:07:01 <Borg> I will attempt to just copy&paste the class and adjust it for routing restrictions..
11:07:58 <Borg> so I will need minimal changes to viewport.cpp.. like just constructor, and some Draw() call
11:10:25 <mmtunligit> I'm trying to make it so that you can move the name of a waypoint around to otheer tiles that are also a part of the same waypoint, and part of this is enabling the coverage button to show the player where valid tiles are. I have this working in every case except when clicking on the new button with the place waypoint tool active, and i can't for the life of me figure out why. I assume that tool
11:10:25 <mmtunligit> is overriding the ability for the coverage button to be pressed, but i cant for the life of me figure out how. would anyone know where i should be looking?
11:18:00 <rito12_51026> Have you ever considered porting OpenTTD into a game engine?
11:18:49 <kaji_kaede> ...What would the point bne>
11:21:22 <mmtunligit> I guess maybe OnClick in waypoint_gui.cpp is being run before OnPlaceObjectAbort in rail_gui.cpp ? ill try messing with that
11:22:27 <Borg> mmtunligit: use DEBUG(misc, 0, ...) :)
11:24:06 <mmtunligit> is that like an option when building?
11:25:39 <peter1138> mmtunligit, the code that searches for nearest station/waypoint also updates the highlight for it, so could be that.
11:29:09 <peter1138> And if you have any `DEBUG()` then you're working on somewhat old version of the code.
11:29:31 <mmtunligit> ok yeah it was the abort being run after the click
11:34:15 <mmtunligit> now i just need to figure out how to grab the window number of the waypoint i clicked onto
11:37:14 <peter1138> For per-instance windows, the window number is the ID of the thing.
11:42:05 <mmtunligit> yeah i know that, im just unsure of how to find that window in the first place
11:43:03 <mmtunligit> im thinking of using ```last_user_action```
11:43:07 <mmtunligit> but that seems wrong
11:43:46 <rito12_51026> kaji_kaede: - No need to maintain low level code for blitters, windows/widgets.
11:43:46 <rito12_51026> - gamepad/shortcuts control embedded in window class
11:43:46 <rito12_51026> - garbage collector?
11:44:53 <andythenorth> is there a suitable GPL game engine that is significantly portable and well supported?
11:46:06 *** kuka_lie has joined #openttd
11:46:17 <_jgr_> OpenTTD is already using SDL for low level stuff
11:47:13 <rito12_51026> andythenorth: Godot is on MIT
11:47:17 <_jgr_> There's no need for shaders or garbage collectors (Squirrel excepted)
11:47:48 <_jgr_> Asset bundles are effectively what GRFs are, etc.
11:48:13 <locosage> basically, openttd has it's own game engine
11:49:20 *** f_ has quit IRC (Ping timeout: 480 seconds)
11:50:05 <rito12_51026> _jgr_: I would like to see all trees moved by the wind
11:51:15 <Borg> _jgr_: are you planing to add TraceRestrictOverlay for Routing Restrictions? :)
11:51:36 <_jgr_> rito12_51026: That sounds quite distracting to me, but there's nothing to stop you drawing those and animating it
11:52:44 <rito12_51026> _jgr_: lack of time is stopping me
11:52:47 <_jgr_> Borg: I can't see what you're working on, I obviously can't say if I'm planning on adding it or not
11:53:20 <Borg> _jgr_: Overlay links graph to show links between signals.. like you have PBS entry signal.. I added also signal state to RR..
11:53:46 <Borg> I already backported Signal post coloring.. now I think about that stuff.. would be neat to see graph of nearby signals
11:54:50 <Borg> im looking at linkgraph_gui.cpp right now.. and how LinkGraphOverlay is implemented to ViewPort..
11:54:52 <_jgr_> I don't have any plans of my own to work on stuff like that. PBS entry signal conditionals and such are rarely used.
11:55:14 <Borg> Ill try to do it myself..
11:58:50 <kaji_kaede> rito12_51026: ...Why would we need shaders or asset bundles?
12:08:54 <rito12_51026> Asset bundles would allow to combine GS abilities and GRF abilities into one system. Multiple of them could be loaded at the same time and they could also comunicate with each other.
12:09:50 <LordAro> ah yes, a game engine is all that is needed to allow that
12:10:40 <mmtunligit> yeah what i want to use is FindWindowByID but i dont know how to find the ID of the window I just clicked
12:10:44 <vondpc> it's like the joke we make in another community - 5 games 50 game engines 😛
12:11:13 <mmtunligit> unless FindWindowByClass just returns the ID of the most recently used window of that class
12:12:10 <jfkuayue> should be shown as all starts
12:32:08 *** Flygon has quit IRC (Read error: Connection reset by peer)
13:01:35 <peter1138> andythenorth, I am still in awe at how quickly you managed to do the animation thing.
13:12:19 <alfagamma7> andythenorth: Hmm, that's rather a *short* period I think?
13:18:00 <mmtunligit> ive found a baffling bug, when you abort a road waypoint build while next to a road waypoint, it doesnt clear the highlight? i have no idea why though, it seems to be implemented the exact same as the rail waypoint aside from checking if youre in the scenario editor for some reason
13:18:49 <mmtunligit> wait no im dumb i think
13:19:36 <mmtunligit> it clearing the highlight wasnt implemented at all, and i just forgot to change a function when copy and pasting lol
13:33:44 <Borg> damn... this is indeed hard
13:33:52 <Borg> my TraceRestrictOverlay() constructor is called
13:33:59 <Borg> but Draw() seems not being called at all..
13:40:18 <Borg> ok.. this is advanced stuff
13:40:39 <Borg> I see that dpi coords and size are from screen Invalidation.. hmmm
13:54:15 <Borg> okey. no clue how it suppose to work..
13:54:28 <Borg> I get line on the screen.. but only when whole screen is refreshed..
13:54:38 <Borg> once I start scrolling it gets damaged
13:54:46 <Borg> refresh whole screen.. its back
13:57:53 <Borg> refresh is for cache rebuild on LinkGraphOverlay
13:58:04 <Borg> it sets Dirty for repaint.. but its not called often
14:05:12 <_jgr_> The link graph overlay implementation is likely more complicated than you'll need if you're just drawing a few lines
14:05:33 <Borg> _jgr_: for now all I want is to draw line... *whatever* place
14:05:38 <Borg> and I managed to do that
14:05:47 <Borg> but, im not sure why this line is not refreshed when I scroll
14:06:07 <Borg> from debug output I see dpi is used for screen invalidation.. to redraw part of it..
14:06:19 <Borg> but I dont see anything fancy in LinkGraphOverlay::Draw()
14:07:19 <Borg> from my crude understanding.. that should just work ;)
14:09:32 <_jgr_> If the viewport is scrolled, the line should already have been drawn in the correct place
14:09:44 <_jgr_> Only newly exposed edges, etc need to be drawn
14:11:15 <_jgr_> Your draw function advice sites not appear to be drawing stuff in the coordinate system of the actual viewport contents
14:12:12 <Borg> yeah I dont care for now.. I just want static line on screen..
14:12:39 <Borg> this is the hardest part.. once I will get it done. I will do all the necessary translations and visibility tests..
14:13:21 <Borg> maybe I should create new DPI?
14:13:55 <Borg> the upper part is from ViewportDoDraw() where LinkGraphOverlay is handled
14:14:03 <Borg> again.. nothing fancy for LinkGraph..
14:16:04 <_jgr_> Drawing lines in the viewport such aren't actually part of the viewport contents will just mean that you'll have to handle scrolling behaviour, etc yourself
14:17:16 <_jgr_> In general it's probably worth taking a look at how invalidation, redrawing, etc is handled
14:18:47 <_jgr_> However, if your lines are actually between signal tiles then that is not an issue
14:19:41 <Borg> but you are right. I think I hooked too far
14:19:58 <Borg> I also noticed that LinkGraph lines are part of PixelCache
14:20:14 <Borg> they stay on screen and for examle station boxes arent draw
14:20:34 <Borg> I need to lookup LinkGraphOverlay code again..
14:22:17 <_jgr_> It is probably more complicated than you need. Consider looking at ViewportDrawVehicleRoutePath instead.
14:23:35 <Borg> okey thx for hint.. lets see
14:31:57 <peter1138> The LinkGraphOverlay uses a delayed update system because there can be a LOT of lines on screen for a busy network.
14:35:36 <peter1138> So if you're drawing just one or two lines, you might be able to skip all that delaying and caching things.
14:38:10 <Borg> yeah.. but thats not the problem atm.. I cannot draw stable line for now
14:38:38 <Borg> maybe I dont need class at all
14:38:46 <Borg> maybe I should use vp directly...
14:47:26 <peter1138> Aim to draw a stable line between two signals. Or if not that, two tiles.
14:47:46 <peter1138> Don't try to draw a fixed line based on screen-coordinates -- that's more work that you don't need.
14:48:38 <Borg> peter1138: okey, can you give me a hint how to do that?
14:48:53 <Borg> yeah! best is.. line between 2 tiles
14:49:34 <Borg> I see that everything seems to happen on ViewportDoDraw()
14:50:32 <Borg> so I suspect its correct place to hook up and call my drawing function
14:51:06 <peter1138> As a rough example, GetViewportStationMiddle() gets a coordinate for station sign, which is location on a tile.
14:51:17 <Borg> I did atm.. and line was draving in.. well.. some weird coordinates.. somehow reasembling world...
14:51:22 <Borg> but after scrolling. it crashed :)
14:52:10 <Borg> peter1138: yeah I saw in LinkGraphOverlay
14:52:27 <Borg> weird is.. if I use same dpi as LinkGraphOverlay.. line is static.. in screen coords
14:53:22 <Borg> Ill try to draw box on Tile
15:10:33 <Borg> okey.. there are bad news and good news
15:10:41 <Borg> something start to work.. kinda correctly
15:10:49 <Borg> I have small square box on map rendered
15:11:43 <Borg> it works fine w/ scrolling and cliping
15:11:55 <Borg> the bad news is.. its on place where I was NOT expecting it
15:12:08 <Borg> I did stupid thing like TileIndex tile = 0xd60;
15:12:14 <Borg> to render box on single tile
15:12:41 <Borg> but box appears at the edge of map
15:13:19 <Borg> somehwere at tile 0x86 (6 x 1)
15:15:19 <rito12_51026> xarick: Since when there are breakpoints in game scripts?
15:17:24 <xarick> it's with set ai_developer_tools on
15:17:41 <xarick> then GSController.Break("text message")
15:17:56 <rito12_51026> peter1138: eh, it isn't just install
15:17:56 <rito12_51026> CMake Error at CMakeLists.txt:186 (message):
15:17:56 <rito12_51026> SDL2 or Allegro is required for this platform
15:18:47 <rito12_51026> xarick: I have only scenario tools turned on
15:18:58 <rito12_51026> peter1138: the filc
15:19:34 <LordAro> you really didn't get very far with reading if you thought it might work
15:22:21 <peter1138> Oh, I probably could've put more context. The idea of a memory-safe C/C++ compiler is... interesting. Not something we should try yet :)
15:25:02 <Borg> peter1138: okey, I cant belive this. but I need to add GetTileXYPoint() to Viewport stuff.. similar to GetStationMiddlePoint()
15:25:24 <Borg> lets hack it.. and see if this will work
15:29:54 <Borg> okey recompiling. I called it GetViewportTileMiddle()
15:36:48 <Borg> not the middle point tho.. got upper corner of it
15:40:36 <Borg> and I used Linkgraph DPI after all
15:40:57 <Borg> so I probably will leave my TraceRestrictOverlay as is.. because I need access to viewport and window..
15:50:46 <xarick> omg "Rewrite with Copilot" in browser is an awesome idea
15:57:37 <mmtunligit> I am so unbelievably confused right now
15:58:03 <mmtunligit> so i figured out the problem i was having earlier, and ported the solution to stations as well
15:58:11 <mmtunligit> and it works fine for rail and air
15:58:30 <mmtunligit> but for whatever reason roads and docks crash the game when aborting the station builder
15:58:46 <mmtunligit> despite all of the aborts having been modified in the exact same way
16:01:13 <peter1138> Hmm, pi-hole using up so much RAM my ssh session is lagging :o
16:01:33 <Borg> hah! I dont even need class at all :> I can reuse LinkGraph data... all I need is to call TraceRestrictDrawOverlay() with vp + dpi
16:01:42 <Borg> okey thanks all for hints
16:01:50 <Borg> now I can do proper implementation
16:01:52 <mmtunligit> it seems to have something to do with checking if the build station button is lowered but i dont understand why, since i didnt change that part
16:06:00 <mmtunligit> why does ```if (_game_mode != GM_EDITOR && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true);``` work but ```if (_game_mode != GM_EDITOR && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) {
16:06:00 <mmtunligit> if (w->window_class != WC_STATION_VIEW && !w->IsWidgetLowered(WID_SV_MOVE)) SetViewportCatchmentStation(nullptr, true);
16:06:00 <mmtunligit> }``` cause a crash, i do not get this
16:06:28 <mmtunligit> that second if statement causes no problems in rail_gui.cpp
16:10:59 <mmtunligit> ok it has to be something with how those subwindows are handled
16:15:27 <Borg> okey Ineed quick C++ hint
16:15:56 <Borg> I see that class that is derrived from Window doesnt have destructor.. but I need it now.. to stop rendeing Overlay
16:16:20 <Borg> can I add it and not to worry about derrivered destructors? or do I need to call it explictly?
16:47:13 *** Smedles has joined #openttd
17:31:58 <Borg> now... there are multiple viewports.. and I get updates from all of them
17:32:06 <Borg> how to actually.. work only w/ main viewport?
17:35:30 <peter1138> GetMainViewport() could be a start.
17:36:36 <Borg> the problem is.. ViewPort doesnt store Window with it belongs to...
17:37:09 <andythenorth> so we have a no war theme
17:37:18 <andythenorth> but I want to do add a naval dockyard to FIRS
17:37:41 <peter1138> Pretty sure you can do whatever you like in your NewGRFs.
17:37:54 <Borg> only main viewport have overlay :)
17:37:59 <andythenorth> it was a bit of a thing once
17:38:02 <andythenorth> 'no war in grfs'
17:38:13 <andythenorth> dunno, everything has or will be a thing at some point
17:39:24 <_jgr_> Borg: On the contrary, other viewports can also have overlays
17:41:00 <Borg> _jgr_: probabmy in newer OpenTTD
17:41:18 <Borg> im working here w/ older. and it seems only main window is allowed to have LinkgraphOverlay
17:41:26 <Borg> + of course minimap.. but im not touching that
17:41:31 <Borg> anyway :) it workz.. time for drawing..
17:41:37 <Borg> (for now I made caching code)
17:41:58 <Borg> _jgr_: also, can you hint me about destructor in your code? TraceRestrict?
17:42:20 <Borg> I need to know when to stop rendering links.. bet place is to when Widget gets destroyed
17:42:50 <Borg> can I have just basic destructor w/ my stuff? or do I need to care about Window class destructor too? call it somehow?
17:43:10 <_jgr_> What version is "older"?
17:44:15 <talltyler> You could always have a dockyard for civilian ships
17:44:50 <_jgr_> For windows, you'll probably want to override Window::Close, and call the parent implementation, in other cases just use a normal destructor as required
17:47:51 <Borg> okey.. lets try that w/ basic destructor
17:52:19 *** lobster has quit IRC (Ping timeout: 480 seconds)
17:53:16 <andythenorth> talltyler: Want to deliver nuclear fuels
17:53:25 <andythenorth> Implies nuke subs 😛
17:53:45 <andythenorth> Wasn’t there a sub in TTO?
17:54:02 <rito12_51026> ferries with nuclear engines
17:54:40 <andythenorth> nuclear icebreakers
17:55:15 <peter1138> So, uh, are they modding 1.8.0 for, uh... reasons?
17:55:35 <andythenorth> probably has passwords in savegames or something
17:55:44 <andythenorth> andythenorth: off-topic again
17:56:07 <locosage> lol, I was just wondering if passwords can be added with a game script xD
17:56:12 *** gelignite has joined #openttd
18:05:13 <peter1138> Fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
18:06:49 <LordAro> remember that Borg is the person that constantly runs into pathfinder issues but is convinced that their changes to the pathfinder penalty values are not at fault
18:33:43 *** gelignite has quit IRC (Read error: Connection reset by peer)
18:34:15 *** gelignite has joined #openttd
18:50:06 <xarick> when will visual studio get it?
19:25:03 <Borg> okey.. something start to works.. but that C++ stuff gives me hard times...
19:25:26 <Borg> no visibility checks yet, scrolling/zooming works
19:25:33 <Borg> but I have problem w/ main viewport invalidation
19:25:50 <Borg> when I open restricted routing window.. no links are draw, or artifacts.. full refresh is needed.. like zoom
19:25:57 <Borg> same w/ closing window.. tried to add
19:26:38 <Borg> this->GetWidget<NWidgetBase>(WID_M_VIEWPORT)->SetDirty(this);
19:26:48 <Borg> in Restrict Window contructor.. but didnt helped..
19:27:17 <Borg> MakeViewportDirty is actually static to viewport.cpp
19:29:06 <Borg> I think I will unstatic it for test..
19:30:12 <_jgr_> Borg: Are you sure that you are dirtying the correct window?
19:32:08 <Borg> im sure.. but maybe im doing it too early
19:32:25 <Borg> I think now I start to understand way LinkgraphOverlay have class
19:32:35 <Borg> it can actually have Window *win + widget id
19:32:41 <Borg> so it can signal that stuff itself
19:33:05 <Borg> so I think I need back to it.. and do stuff OnTick() like in Linkgraph()
19:33:16 <Borg> to correctly handle refreshing and invalidation
19:33:26 <_jgr_> You say that you are doing this in the constructor of the trace restrict window, but that is not the same as the main window where said widget is
19:34:02 <Borg> all Ineed is invalidation of main viewport
19:34:08 <Borg> whatever/whoever will it signal
19:34:27 <Borg> but! first, food time.. I think I will spawn my TraceRestrictOverlay class again
19:34:33 <Borg> and move some code out to proper places
19:35:21 <_jgr_> What is wrong with just using SetWindowWidgetDirty?
19:36:45 <_jgr_> Our use one of the various mark viewport dirty functions
19:37:22 <Borg> % git grep -F SetWindowWidgetDirty | fgrep WID_M_VIEWPORT
19:37:27 <Borg> im not sure I can use it...
19:38:03 <_jgr_> That is clearly what you were attempting to do above
19:47:23 <Borg> I think I will comeback to class TraceRestrictOverlay with will be initialized from main_gui.cpp (I will have Window + widget info)
19:47:34 <Borg> and refresh everything properly from OnTick()
19:47:58 <Borg> refresh flag will be signaled by any change within TraceRestrictWindow
19:48:18 <Borg> now im doing refresh from Draw() with is not bueno for sure
19:48:24 <Borg> Draw needs to do stuff quickly and return
19:50:52 <xarick> I can't use f(i) ? 1 : 0, valuator functions can return integers
19:52:38 <xarick> f(i).tointeger() was also kind of redundant for integers
19:53:04 <xarick> for the sake of opcode savings
19:54:34 <xarick> there is typeof to know which type the return value was, but would take even more ops
20:07:54 <andythenorth> 96 cargos per grf maybe?
20:23:34 <andythenorth> the problem is that I am doing a FIRS west country economy, and cornish pasties have a lot of ingredients 😛
20:57:55 <rito12_51026> andythenorth: I would love to have cargos per grf instead of per save
20:58:04 <reldred> Cornish pasties and Devonshire tea based economy
21:06:22 <peter1138> What does 'per grf instead of per save' even mean.
21:07:11 <talltyler> Each industry can define its own cargos, I imagine
21:07:25 <peter1138> Industries don't define cargos :)
21:07:26 <reldred> Probably like how objects used to be capped for a bit per grf.
21:07:32 <peter1138> But industry sets can.
21:07:41 <peter1138> But you never know, I might have a patch for that.
21:08:31 <andythenorth> peter1138: it means words get misplaced in my brain 😛
21:12:05 <Borg> _jgr_: ufff works like a charm! I mean.. SetDirty() from proper place
21:12:17 <Borg> I reimplemented back my class TraceRestrictOverlay
21:12:37 <Borg> probably I could actually use some hackery w/o class.. but.. its C++ after all
21:13:15 <Borg> now I need to do proper Visibility tests in Draw Functions.. and then.. MAYBE.. do optimization.. but I doubt I will need them. for like drawing up to 10 links on screen
21:15:26 <andythenorth> peter1138 so 96 is the correct number of cargos? 👀
21:20:16 *** SigHunter_ has quit IRC (Ping timeout: 480 seconds)
21:24:58 *** SigHunter has joined #openttd
21:47:51 <Borg> so vector() doesnt really have sth as simple as find() ?
21:53:51 <_glx_> works for many types of container
21:56:03 <Borg> auto it = std::find(ti->ts.begin(), ti->ts.end(), t);
21:56:25 <Borg> no wonder I dont code using C++
21:56:31 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
21:57:21 <Borg> its strange I cannot do that w/ one single line if..
21:58:54 <_jgr_> You can, just get rid of the temporary `it`
21:59:36 <_jgr_> Most likely the version you're using has a shorter wrapper for this
22:00:18 <Borg> _jgr_: btw, good news.. links work.. visibility test works (stolen)
22:00:27 <Borg> I just now remove dups and Im done :D
22:00:36 <Borg> I will just draw more fancy lines later
22:01:41 <xarick> I'm thinking about 14311, should I also add `SetSorterType` and `SetSorterDirection` to be surgical?
22:04:19 <Borg> heh, im going sth wrong.. entire OpenTTD does have std::find()
22:05:14 <xarick> I wanna extract the most gains as possible 😐
22:15:43 <Borg> haha.. C++ magickery ;) this is so much better
22:15:50 <Borg> I guess slower a bit.. but who cares
22:21:24 <Borg> okey, good nite.. enough for today.. tomorrow I will add fancy line drawing (tri-color) so direction will be provided
22:21:34 <Borg> and I can play some OpenTTD :D
22:30:58 *** Borg has quit IRC (Quit: nite)
22:42:32 *** kuka_lie has quit IRC (Quit: Lost terminal)
22:45:51 *** SigHunter has joined #openttd
22:47:40 *** keikoz has quit IRC (Ping timeout: 480 seconds)
23:02:52 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:07:20 *** lobster has joined #openttd
23:23:36 <xarick> wow, that was unexpected
23:33:20 <xarick> oh, i see, i can't just change it like that
23:50:46 <xarick> 1 tick difference, not worth the effort
continue to next day ⏵