-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Captains log, star date 2020... #4795
Conversation
f1402b7
to
fb41690
Compare
@impaktor you could avoid bumping saves by simply serializing a Version field in the FlightLog object, and then checking if that field is nil and fixing up the log entries. It looks there aren't many changes which would need fixing up; you can simply display N/A if need be when there isn't data stored in a save file about how much money you had. I'd like to retain backwards save compatibility as much as possible, and this really isn't a feature that's worth breaking saves over, in my opinion. It's a little more work, but it avoids invalidating saves. |
66d490c
to
9fe7f44
Compare
|
766f5c2
to
aca89a3
Compare
267309b
to
8f259e0
Compare
ad85af0
to
24a6651
Compare
aa04c60
to
c2f5752
Compare
OK, this was stalled since 4 months, because I didn't want to deal with the underlying three different data structures for logs, and how to sort them / weave them together (or re-write the whole thing). Solution: Tabs! And it also feels more feature rich this way, since now the player sees they got three logs, instead of just the one! For now, you can add text entry field to all three logs (custom log, auto-log system events, and auto-log station-events), but only the custom logs can be deleted fully. Maybe it's a feature, maybe it's a bug. I dunno. Things of interest for others to reviewWhen starting a new game, there's some back story (and some hints): Remains?This PR is now done, so I'm removing the WIP on it. Please hold off with merging this at least a few days. FutureThere are many routes to develop this further, like integrating this with sector view, whith notes on systems, or filter and search function, or auto-logging buying/selling prices in station log, or/and kills, crimes, missions? (I suspect a re-write of the FlightLog module might be needed then). Anyway, I don't intend to do anything more on this, now, so I'll leave any future work to others. |
f6f7770
to
f763362
Compare
I've made the final tweaks on this now. I've changed it so station events are logged when docking, instead of un-docking, since I find that more intuitive. Also, I realized when displaying the logs separately, station logs should also show which planet and system one docked in, or else one has to look in system log to see time stamp for different jumps. Perhaps more (other) station events can be logged, like what the player buys, but I suspect that will require reworking flightlog library a bit. Ready for final review. |
@Web-eWorks if you want to hold this for review, then speak up, as I'd like to merge this the comming days. I've noticed I have unused definition ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The game-start prose is a little awkward but that's nothing particularly major. I've suggested one minor change, but I think this is pretty good to go.
name = l.FLIGHT_LOG, | ||
icon = ui.theme.icons.bookmark, | ||
showView = true, | ||
draw = function() drawLog() end, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
draw = function() drawLog() end, | |
draw = drawLog, |
You can also pass the function by value directly instead of invoking another function call each time we draw this module. It's not a big inefficiency, but it makes things a little less confusing.
|
||
-- | ||
-- Function: ui.coloredSelectedIconButton | ||
-- | ||
-- > clicked = ui.coloredSelectedIconButton(icon, button_size, is_selected, | ||
-- > frame_padding, bg_color, fg_color, tooltip, img_size) | ||
-- | ||
-- | ||
-- Example: | ||
-- | ||
-- > clicked = ui.coloredSelectedIconButton(ui.theme.icons.bullseye, Vector2(10,10), false, | ||
-- > 0, ui.theme.colors.buttonBlue, Color(255,0,0), "Click for action##42", Vector2(8,8)) | ||
-- | ||
-- Parameters: | ||
-- | ||
-- icon - image to place on button, e.g. from ui.theme.icons | ||
-- button_size - size of button, Vector2 | ||
-- is_selected - bool | ||
-- frame_padding - number | ||
-- bg_color - Color(R,G,B), for background | ||
-- fg_color - Color(R,G,B), for forground | ||
-- tooltip - string, mouseover text, will be used as ID, must be unique, append "##uniqueID" if needed | ||
-- img_size - size of icon on the button, Vector2 | ||
-- | ||
-- Returns: | ||
-- | ||
-- clicked - true if button was clicked | ||
-- | ||
ui.coloredSelectedIconButton = function(icon, thesize, is_selected, frame_padding, bg_color, fg_color, tooltipID, img_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANK YOU for documenting this function. This made my day!
This method used to require each instance to have a unique tooltip string. Now it supports having the same tooltip repeated, provided it is appended with a "...##ID", where ID is a unique identifier. Also added documentation.
Defaults to empty. Will allow player to enter info on system/station e.g. "Smelly station, but nice ring system".
We have a flightlog for automatically logging station-departures, and one for system arrival/departure. Have now added a custom one, that captures player stats, and a custom field for text entries.
Lets us keep backwards compatibility as we add more features to this library
I merged in master, and now, for some reason, this segfaults when launching pioneer,
So I assume I've done something bad when I added the tab bar in #4893 |
@impaktor for some reason, the function |
At the end of 06-flightlog.lua, line 227, change You want to assign the reference to the function to |
Will show the automatically logged events (station, and system visits), as well as allow custom text entries to these, and custom logs to be made at arbitrary points.
This feels more intuitive, to log arrival event, rather than undocking event. Typically, arrival data is important for checking if one made a mission dead line.
@Gliese852 & @The-EG doh! yeah, thanks! Merging it now. |
Introduction
Inspired by this flight log add-on for original Frontier, I've implemented something similar. This is highly work in progress. I've used the FlightLog that automatically logs departures from stations, and arrival/departure times into systems. I've also added a custom log, that can be created by writing some fitting string, and pressing enter; and show all three in a Flight Log tab in InfoView.
Currently text can only be entered into the custom logs, but I'll extend the other two logs (system, and station) so one can enter, as @nozmajner suggested: "this was a smelly station".Potential: Custom entries at start give backstory
I've played around with adding a custom log entry from the mainmenu, when starting a new game, so the first entry could be:
"Just picked up the ship that uncle Nick left for me to inherrit. This rusty old bucket isn't much, but together we'll write our destiny in the stars, and it's my new home. Can't wait to undock!"
"Now I've cleared my debt with Wu, and sold all my belongings, and all I got was this lousy ship. By it's mine, and with it I can escape this god forsaken world and build a brighter future, forever onwards!"
Biggest hurdle
Currently, it's to get the three logs (system, station, custom) to be printed in date-order, instead of printing each one in turn. I think the FlightLog method might have some method that sorts them, or combines them, but they have different table fields, so... need to think.
Multiline input. I've experimented with adding multiline text-input field, but the game crashes if I try to use it, so for now, it's just a dead commit.
Also, this is a savebumping PR, since the updated FlightLog library will be incompatible with the previous, since I'm adding more fields (also log player's money), and a custom log.
To do
sort them on dates, not printing SYSTEM, STATION & CUSTOM logs separately. EDIT: Solved this by printing each log in a separate tab, thus Add support for IMGUI tabs in pigui #489315. MaketextWrapped
include the secondary optional argument in LuaPiGui.cppFor future
These are things that might be intuitive next steps to add, but I don't plan to do them, so up for grabs:
Current state
This is a screenshot of where I'm at. It works pretty well, as is, I think,
although only single line text-input, andthe tree logs are only date-sorted within each group (First it prints all custom logs, then all system logs, then all station logs).Closes #204