Slider UI component wasn't hard to do. What was hard to do was the output allocation. For example, if I increase my Research allocation, another output must decrease so the total output is 100% (I can't have 35% in research, 35% in construction, and 35% in waste management, for total of 105%)
Last night I coded in the algorithm for output allocation, but it wasn't working. It was late at night and I thought I had a clever way of doing it. But today when I looked at the code, I was like "What was I thinking?" and had to scrap a lot of it. But the good news is, it's done! There's a bug with the arrow buttons not changing the amount, but I'm confident that it's a minor bug and easily fixed.
Note, I haven't added labels yet, but you can see the sliders in action! Note that the top two is a bit different color than the bottom four? It's because they're disabled (waste management and agriculture). You cannot modify those because those are required to keep your population healthy. Racial bonuses and technology improvements can increase the output, therby decreasing the required input.
The area above the sliders will be used for displaying the planet information (amount of population, planet terrain type, amount of infrastructure built, etc). The area below sliders will be the construction item that the planet is building. Note the multiple planets per star system, so many that there's a scrollbar required to be able to view all of them. This won't be normal, I recommend 0-6 planets for a normal game. But the functionality is there in case people want to play with more than 6 planets per system.
Tomorrow's agenda: Fix the slider's arrow buttons, add the planet info and labels in display, and add end of turn processing.
No comments:
Post a Comment