Conversation
Merge a bunch of fixes into the empire editor so it's only one scenario version increase
crudelios
left a comment
There was a problem hiding this comment.
All in all, code-wise, this is extremely well done. It is also a very welcome addition to the game.
I mostly have nitpicks for changes, as well as one or two slightly more complicated requests.
I haven't yet built/checked for warnings/debugged anything. That will come later 😉
There was a problem hiding this comment.
Referring to @Areldir regarding these icons: I believe the backgroud box and foreground icon can be separated to save a little bit of space. But not a lot anyway.
| <image src="Plus_Button_Idle" id="Plus_Button_Idle"/> | ||
| <image src="Plus_Button_Idle"/> | ||
| <image src="Plus_Button_Click"/> | ||
| <image src="Edit_Button_Idle" id="Edit_Button_Idle"/> | ||
| <image src="Edit_Button_Idle"/> | ||
| <image src="Edit_Button_Click"/> |
There was a problem hiding this comment.
Aren't the Plus_Button_Idle and the Edit_Button_Idle being duplicated?
There was a problem hiding this comment.
I think we need this because of how the image button handles the image offsets. +0 is idle; +1 is focused +2; is clicked. But honestly I just copied the image UI xml from the pause button.
There was a problem hiding this comment.
I think you can save a bit of VRAM by using the following git the repeated image:
<image group="this" image="Plus_Button_Idle"/>
If that doesn't work, use this instead:
<image>
<layer group="this" image="Plus_Button_Idle"/>
</image>
That will prevent loading the same image twice.
There was a problem hiding this comment.
Should I do that for the pause button as well. Or would that shift the image ids?
There was a problem hiding this comment.
It shouldn't shift the IDs because there's still both images.
The only difference is that they'll both use the same spot from the atlas texture, this saving memory.
| if (data.type != FILE_TYPE_EMPIRE && data.type != FILE_TYPE_EMPIRE_IMAGE) { | ||
| return; | ||
| } | ||
| char *filename = (char *)dir_get_file_at_location(data.selected_file, data.file_data->location); |
There was a problem hiding this comment.
Cant this be const char *?
There was a problem hiding this comment.
I can make it const char but then I can no longer assign it. So I would have to create a new if and a new variable. Up to you whether thats worth it.
There was a problem hiding this comment.
Yeah I'd prefer that if possible. const stuff should not be changed.
Co-authored-by: José Cadete <crudelios@gmail.com>
Co-authored-by: José Cadete <crudelios@gmail.com>
…augustus into empire-editor
|
That was fast. The only thing I'm not sure about are the city names. I'm pretty certain they are in the translation files, so they can probably be used directly as ti avoid string duplication (and respect eventual name changes on some translations). Apart from that, this feels ready for proper testing. Maybe provide a binary for users like Fairbuy and Comissar so they can try it out before merging? |
|
I let eugenkius test it and the names are wrong in russian. So I'll change the names to name ids |
|
Also there is a binary public on mareks discord server. |
|
I think that's everything. It's only missing testing, correct? |
|
Yes, correct. |
crudelios
left a comment
There was a problem hiding this comment.
This looks fine to me.
Since you're handling testing, I'll let you merge the PR when you feel it's ready.
Remember to use "squash and merge" to add everything as a single commit please.
|
The "Import Empire" button's focus is shifted about 10 pixels to the left. |
|
It was probably reintroduced by the changes I did in review with changing the buttons hidden state. |
This is a PR which allows people to create their own empire inside of augustus.
It was never tested on any mobile device but I suspect it will look very squeezed on it.
It provides many fixes to how empires are drawn generally for example trade routes are drawn again in the editor and not every city has a trade icon.
Also it adds a new xml attribute to the
<city>tagicon_afterit determines the icon of a future trade city after being converted to a trade city.And it adds a new icon
res_seaand a new ornamentThe Temple.General
The core of the editor are the so called empire tools.
There are 13 different tools:
Each tool basically does what it says on left click on the map.
To delete an object you can either select it with the selection tool and then click Delete Object in the bottom menu or you can bind a hotkey for it then hover over the object and press the hotkey to delete it.
To move an object select it and click Move Object in the bottom menu.
All empire tools can be accessed with hotkeys or in the bottom left where there was previously the preview image button. Left click cycles forward, right click backwards.
Cities
You can rename cities by clicking on the edit city name button which shows a pencil.
When the city is your own city, a trade city, or a future trade city you can add resources with the add resource button (A plus button). Note that you can only add to selling on your own city.
To remove a resource right click on it.
To change the qouta of the resource left click on it.
Obviously editing quota is also not possible on your own city.
When the city is a trade city or a future trade city you can redraw it's trade route by clicking on the Redraw route button.
The type of the trade route (sea/land) can be changed by clicking on the button left the preview image.
You can change a city's icon by clicking on the button which says Current empire tool.
It'll change it's text to Current city icon and the preview image button will then change the icon of the selected city.
The icon of a future trade city after it's conversion can be changed by pressing the button in the second row at the very left of the right side.
Objects in order
This PR reworks the ordering of objects to no longer rely on for example border edges to have ids next to each other and behind their parent.
Now they have an
order_indexand aparent_object_id.This change applies to border edges and trade waypoints.
You can change the
order_indexof an object in order by selecting it and pressing one of the arrow buttons it'll exchange the order index with the next one or the one before.Although Battles aren't objects in order their
invasion_yearscan also be adjusted with these arrow buttons.Also you can set the index by right clicking on the arrow buttons. This will shift all the objects in order between the current index and the new set one. It either shifts them down if the set value is higher then the current else it shifts them up.
Invasions
Battles are always placed with
invasion_yearbeing one more than the latest battle in the current path andinvasion_path_idbeing the current path.Distant battles aren't actually waypoints in code so they can be placed freely as if they were distant cities.
Their
distant_battle_travel_monthsare always one more than the ones of the latest distant battle of the same type (enemy/roman).Bottom buttons
OK exits out of the empire screen
Toggle invasions makes battles and distant battle un-/visible
Toggle edges makes trade points and border edges un-/visible
Refresh (F5) resets the empire to the state last exported or imported from xml
Export Empire exports the current empire as xml
Import Empire imports an empire from xml as usual
Empire Properties shows the empire properties window explained underneath
Empire properties
In the empire properties you can change the empire background image by clicking on select empire image or reset by clicking Default image.
Also you can add ornaments and default cities as well as Ireland but only if it's the normal background.
And you can access empire settings and hotkeys.
Missing features
This also fixes #1643 by reworking trade routes so they seperate buying and selling.