aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-11-23update dependenciesDaniel Schadt
2022-11-23add Legendary Alliance StanceDaniel Schadt
2021-10-07cargo fmt the codeDaniel Schadt
2021-10-07Modernize error handlingDaniel Schadt
This sprinkles in some thiserror and anyhow instead of the hand-rolled 'error_froms!' macros and the MainResult. The benefit of this is that we're hooking into an established ecosystem of error handling and we're saving a lot of effort in the hand-written Display and Error implementations. The reason for not sprinkling anyhow everywhere is because the retrieval/rendering part of kondou could be split off into a library at some point, in which case we want to have a proper KondouError type. However, the argument could be made that the current split of errors is not very good, especially because many of them boil down to the same inner errors (RenderError wrapping ApiError wrapping reqwest::Error), which keeps unnecessary information. Some future improvements may include 1.) Unifying those error enums into one bigger enum 2.) Attaching more context through anyhow in the application layer 3.) Properly define an API and split off the inner logic from the UI logic
2021-10-07Remove deprecated functionsDaniel Schadt
2021-10-07Update dependenciesDaniel Schadt
Some slight API changes in rusttype, but apart from that it's only version number bumps.
2020-03-24update dependenciesDaniel Schadt
2020-02-19update dependenciesDaniel Schadt
image should also be updated to 0.23, but imageproc currently still uses 0.22, so we need to match it.
2019-12-25allow the spec names to be aligned center/rightDaniel Schadt
2019-12-25[render] factor out trait position calculationDaniel Schadt
Working with a "grid" system where we can specifiy the row and column number directly is way easier than all the x_slice/y_slice calculations that have been done in all the methods.
2019-12-25remove BuildTemplate::empty()Daniel Schadt
The function was never used, and it is very easy to emulate using the other available constructor.
2019-12-25Merge branch 'user-options'Daniel Schadt
2019-12-25add more user configurable optionsDaniel Schadt
2019-12-25add flag to disable cachingDaniel Schadt
2019-12-25use byteorder for chatlink parsingDaniel Schadt
2019-12-20add comment about 12 byte paddingDaniel Schadt
2019-12-20remove hard coded palette IDsDaniel Schadt
Now that the API actually returns the proper palette IDs, we can use those values instead of relying on the hard coded values. This also gets rid of the make_table script that was mostly hackish anyway, and the lazy static HashMap.
2019-12-20don't error when cache value can't be deserializedDaniel Schadt
The cache is meant to help out by saving old responses. If those responses do not conform anymore to an updated struct definition, the whole application should not crash. Instead, the value is silently ignored and then overwritten by the proper value that has been fetched from the API. That way, users don't have to manually clear out the cache if a new API schema or new features are released.
2019-12-16also use a mask for major trait imagesDaniel Schadt
While it doesn't look as ugly if you have a major trait with a thick black border, it still looks a bit off, especially since some of them do come with the proper alpha channel, while others don't. This fix uses the same mask for all major traits now as well, which should make them look more uniform and remove the thick black border.
2019-12-16update minor trait maskDaniel Schadt
This one looks a bit better and comes directly off the API.
2019-12-14add preliminary support for user configurationsDaniel Schadt
2019-12-14correctly render transparent backgroundsDaniel Schadt
Previously, some areas were "double exposed" to the transparency, making them a bit darker than the rest. The solution is to make sure that each part is drawn with the correct background color, and then only copying pixels instead of blending them to the final canvas.
2019-12-14replace magic constants in rendererDaniel Schadt
2019-12-13better output for image rendering errorsDaniel Schadt
So far, we silently ignored all errors, because we assumed that they would be the EmptyBuild anyway. This fixes this by not swallowing errors anymore, and instead displays them.
2019-12-13don't need trait descriptionsDaniel Schadt
As it looks, not every trait comes with this field, which prevents some traitlines (notably the Firebrand one) from rendering successfully, as serde refuses to deserialize the Trait. We never displayed the description, and it's trivial to add back, so that's why it was removed.
2019-12-12remove quick_errorDaniel Schadt
quick_error used the deprecated Error::cause interface, therefore we want to use our own error enums with proper methods.
2019-12-12use helper traits for better codeDaniel Schadt
2019-12-12add some more doc commentsDaniel Schadt
2019-12-10avoid crashing with empty build templatesDaniel Schadt
This would occur if e.g. only the profession was given.
2019-12-10make skill lookup table staticDaniel Schadt
2019-12-10sanitize ID before accessing or sending to the APIDaniel Schadt
2019-12-08improve line renderingDaniel Schadt
This makes it so that instead of always going from the middle of the minor trait, they will now adjust based on where they are going to. This means if the chosen trait is the top one, the line will start a bit further to the top, which makes it better to look at.
2019-12-08formattingDaniel Schadt
2019-12-08add console output for build templatesDaniel Schadt
2019-12-08use iter_mut instead of indexingDaniel Schadt
2019-12-08use if on boolean instead of matchDaniel Schadt
2019-12-08center skills in output imageDaniel Schadt
2019-12-08use imageproc to draw the rectangleDaniel Schadt
Doesn't change the outcome but looks better to read
2019-12-08improve antialiasing of thick linesDaniel Schadt
As it turns out, the algorithm for drawing convex polygons is very bad at handling aliasing, and the line height looked off as well. The new algorithm fixes the issue by first drawing a horizontal filled rectangle, then rotating the rectangle by the required angle (using bicubic filtering) and finally overlaying the rectangle onto the target. This improves both the looks of the line height and the aliasing effects.
2019-12-08add support for brightness gradientsDaniel Schadt
2019-12-08fix background croppingDaniel Schadt
2019-12-07remove debug outputDaniel Schadt
2019-12-07improve grayscale renderingDaniel Schadt
Apparently, turning the picture to grayscale also messes with the alpha channel. A lot of trait icons have a small transparent border though. Therefore, we want to preserve the alpha channel by copying it back from the original trait icon. This improves render quality and removes some of the artifacts.
2019-12-07implement chatlink parsingDaniel Schadt
2019-12-07remove debug output from chat link creationDaniel Schadt
2019-12-07basic color supportDaniel Schadt
2019-12-07lint fixesDaniel Schadt
2019-12-07add chatlink + revenant legends supportDaniel Schadt
2019-12-06initial commitDaniel Schadt