Comments (13)
... Reverting the change to createDamageLabel will seem to fix the issue to a point - the numbers still scale wrong. Maybe that was always broken, or it regressed after #9387... Unlikely, the last significant change to ZoomableScrollPane was before that, around the "explored region" feature #8661 ... partial revert reintroducing the pack() call fixes too ... But pack() normally is very wrong for anything participating in a Layout hierarchy, no Widget with a Layout-aware parent should control its own size, that's a breach of contract... OK I start to get it: Stack already breaks that contract by sizing itself by default to 150x150 units - and I replaced the ShadowedLabel design late in its genesis from a generic WidgetGroup with much more glue code to the shorter Stack since all that glue logic turned out to be the same. Seemingly. My bad for testing that use early and not retesting after """simplification"""...
For laughs, here's the culprit:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Stack.java#L47
Any legitimate use of Stack must overwrite these values, and ShadowedLabel, trying to be nice to the Layout interface, doesn't. In the other use it has a parent that controls its size normally...
So the fix is... one pack(), which does not need the old setSize after it because ShadowedLabel implements Layout and includes the displacement in its reported prefSizes... But I'm not yet sure where to place it.
@prod0ad - thanks for the report, and sorry again I misunderstood. I read "the red text is applied a second time, in black/dark grey and a bit displaced" and immediately thought "but of course it's a bit displaced, that's the whole point of a shadow, I remember investing that effort because without a shadow they looked cr... - not so nice on some terrains, especially some mods with very reddish ones"...
from unciv.
oldschool game pics
It's pretty much Xmas! Shattered pixel's rat king already has a nifty santa hat! (And no you can't get it by giving him the other crown)
from unciv.
Can you add a screenshot?
@SomeTroglodyte sounds like shadowed text
from unciv.
Strange. I'm sure I wrapped that in a ShadowedLabel class. But in my master it's still done explicitly in BattleTableHelpers Line 215. So, yes, there's a shadow:
Nasty bug, that...
from unciv.
Just uploaded screenshot, was kinda hard to time correctly:p
from unciv.
Oh no - no damage label at all anymore:
from unciv.
Ah, there it is - just needed to pull a fresh master. ShadowedLabel
in the widgets package, used in BattleTableHelpers
and that yarn legend. And it shows!:
from unciv.
Ah now I see it - that far displaced. No, displacement should only be 1 logical world coord unit. So - which mods, including permanent visual ones? Which Linux? Graphics layer? Which Java? Display settings?
from unciv.
Ah now I see it - that far displaced. No, displacement should only be 1 logical world coord unit. So - which mods, including permanent visual ones? Which Linux? Graphics layer? Which Java? Display settings?
Mods: Invalid. Happens even when I disable my mod, the border mod and play the base game.
Linux: Devuan Beowolf
Graphics: GeForce GT 1030, NVIDIA Driver Version:418.181.07
Java: openjdk version "11.0.11" 2021-04-20
Display: 1600 x 900 60hz
from unciv.
Sorry for the nagging - I was expecting something unusual, something out of place (a 4.x kernel is a bit unusual nowadays but not the issue here) - but it reproduces on vanilla and current master here. So, the wrapping of the older shadow code in that ShadowedLabel went wrong. Not only that, the size and placement is also way off from what was intended. It seems the numbers get larger when zooming out instead of smaller...
This may have some correlation with an experiment I did lately - I tried painting something in Screen.render floating over a MapHolder to mirror position and size of a specific tile - I failed utterly, after several days of trying. localToStageCoordinates is simply wrong. But that damage label - what is its parent?? 🤔
from unciv.
Np and thank for working to fix this. I got a bit confused though with the oldschool game pics and the technicalities:)
from unciv.
technicalities
Always. This is a technical environment after all 🤪. To add to it: The nicest solution was not a pack() call after all, the ShadowedLabel simply undoes Stack's unsavoury default 150x150 sizing with better values than before - it already had the setSize call and the size a pack() would set readily available.
Nice profile pic by the way.
from unciv.
Nice profile pic by the way.
Credit to Unciv/Hexarealm and Fairline/Tanelorn units for Civ2 mods.
from unciv.
Related Issues (20)
- Effect "<for [amount] turns> <upon being defeated>" not working HOT 19
- Crash on next turn HOT 3
- Units that can't fortify stay fortified after upgrading HOT 6
- Exploit with pillage and repair tile improvement on enemy's lands HOT 19
- 4.10.11 (970) crashing every game -- UnreachableDestinationException HOT 3
- Credits.md maintenance - broken links HOT 3
- Feature request: Change ESC behavior HOT 7
- Automated workers get lost in the ocean HOT 5
- "Hidden from users" modifier not hiding uniques of tile improvements HOT 2
- Unciv Wiki Page: Mod File Structure - Uniques Page is broken on the Unciv Wiki HOT 6
- AI movement. HOT 2
- AI not using work boats to access luxury resources HOT 1
- 'Cannot move' cannot be added with some filters HOT 4
- AI declaring war on me and declaring friendship with me on the same turn HOT 1
- Feature request: Some way to scroll over large text boxes HOT 5
- Current master does not load **any** game HOT 4
- Feature request: Flat north and south boundaries for rectangular map HOT 4
- ИИ HOT 3
- Gods and Kings giving an error in the mod checker HOT 2
- Quicker selection of civilizations for custom maps HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unciv.