Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ff9c920
Get egui working in the editor
aleokdev Apr 2, 2022
5f1828b
Partial commit
aleokdev Apr 2, 2022
1a1707f
Barebones layout
aleokdev Apr 2, 2022
c8e5fc9
Bulldoze old GUI, add basic editor tools
aleokdev Apr 2, 2022
452f181
Add deleting, selecting, and reordering layers
aleokdev Apr 2, 2022
7c7eb83
Run cargo fix
aleokdev Apr 2, 2022
21dba17
Clean up, misc changes
aleokdev Apr 3, 2022
9d64c76
Some structure renames
aleokdev Apr 3, 2022
84ee56d
Reorganize actions
aleokdev Apr 3, 2022
6df5cee
Add create tileset window
aleokdev Apr 3, 2022
bf2e5aa
More tileset progress; Draw selected tileset
aleokdev Apr 3, 2022
04a2499
Partial commit
aleokdev Apr 3, 2022
cb70e50
Add tile selection
aleokdev Apr 3, 2022
2d5e8e6
Add temp plot for showing level
aleokdev Apr 3, 2022
484b02a
Add temp custom painter
aleokdev Apr 8, 2022
01c1d77
Draw level + grid with macroquad
aleokdev Apr 8, 2022
fa3636d
Draw level in render target
aleokdev Apr 8, 2022
6280f74
Partial commit
aleokdev Apr 9, 2022
dcd0f70
Implement tile placement and removal
aleokdev Apr 9, 2022
e943849
Clean up
aleokdev Apr 9, 2022
419d075
More cleaning up and renaming
aleokdev Apr 9, 2022
816b322
More cleanup and organization
aleokdev Apr 9, 2022
123283a
Add editor menu
aleokdev Apr 9, 2022
ab6f80e
Run `cargo fix`
aleokdev Apr 9, 2022
ff36fa4
Fix some clippy warnings
aleokdev Apr 9, 2022
932ba3e
Partial commit: Drawing objects
aleokdev Apr 9, 2022
8ab59f5
Object drawing (messy impl)
aleokdev Apr 12, 2022
b18cd53
Add object tooltips + misc changes
aleokdev Apr 12, 2022
d0d1ce5
Update error/unknown sprite
aleokdev Apr 12, 2022
12077bd
Dragging objects
aleokdev Apr 12, 2022
82a27e4
Add undo/redo functionality
aleokdev Apr 12, 2022
6b94846
Separate move object action from update object
aleokdev Apr 12, 2022
7b76324
Add save window
aleokdev Apr 15, 2022
3b5c6cb
Clean up
aleokdev Apr 15, 2022
a9c4c20
Clean up object rendering
aleokdev Apr 15, 2022
b9cf04d
Update egui-macroquad
aleokdev Apr 16, 2022
9b533fd
Object creation
aleokdev Apr 16, 2022
bfe2b60
Clean up
aleokdev Apr 16, 2022
b3c1b59
Move remaining Editor members to State
aleokdev Apr 16, 2022
51a3f31
Clean up
aleokdev Apr 16, 2022
cfd1e5f
Fix & fmt
aleokdev Apr 16, 2022
5a4d5b3
Fix build
aleokdev Apr 16, 2022
91bbb5d
Only drag objects with primary button
aleokdev Apr 16, 2022
6c496bd
Remove the old Editor in favor of State
aleokdev Apr 16, 2022
666bb51
Clean up
aleokdev Apr 16, 2022
c6649f0
Allow repositioning object creation
aleokdev Apr 16, 2022
5b044e5
Only display objects if layer is visible
aleokdev Apr 20, 2022
3bd9800
Partial commit
aleokdev Apr 22, 2022
56cc5a9
Misc selection changes
aleokdev Apr 22, 2022
208e1dc
Add TODO
aleokdev Apr 22, 2022
06f93ef
Object selection improvements
aleokdev Apr 23, 2022
35260b5
Refactor
aleokdev Apr 23, 2022
62f46e4
Add sample context menu
aleokdev Apr 23, 2022
cf0c3c8
Remove &egui::Context params
aleokdev Apr 23, 2022
f363e5b
Misc improvements
aleokdev Apr 23, 2022
42c6718
Clean up
aleokdev May 1, 2022
fc05412
Cleanup
aleokdev May 1, 2022
ca2f17f
Fix build
aleokdev May 1, 2022
5e96557
Use a table for showing layers
aleokdev May 1, 2022
1255f15
Merge remote-tracking branch 'upstream/main' into new_editor_ui
aleokdev May 1, 2022
6ca2ad3
Right click to add objects
aleokdev May 1, 2022
4a72546
Selection text
aleokdev May 5, 2022
68252e3
Add target to object placement window
aleokdev May 5, 2022
bba2141
Allow moving object placement window around
aleokdev May 5, 2022
5952886
Draw object list
aleokdev May 5, 2022
88e6869
Do not deselect objects on drag release
aleokdev May 5, 2022
66f23d0
Better selection indicator
aleokdev May 5, 2022
23ba8af
Fix some selection issues
aleokdev May 5, 2022
2b09fb0
Draw spawnpoints
aleokdev May 9, 2022
736a155
Spawnpoint placement
aleokdev May 9, 2022
a3a6c64
Moving camera via middle click
aleokdev May 9, 2022
f9d45a8
Spawnpoint selection & movement
aleokdev May 9, 2022
b39fa1b
Add new map window
aleokdev May 14, 2022
e9f1fd8
Add open map window
aleokdev May 14, 2022
871df3a
Small fixes
aleokdev May 14, 2022
ab6ed07
Add import window
aleokdev May 14, 2022
10dae3f
Re-add object placement tool
aleokdev May 18, 2022
891cadd
Partial commit
aleokdev May 20, 2022
a55423d
Add map zoom
aleokdev May 20, 2022
c61ed91
Partial commit & off to do some git trickery
aleokdev May 20, 2022
f449bef
Fix drag/ctx menu quirks
aleokdev May 20, 2022
856ae35
Add background edit window
aleokdev May 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
690 changes: 618 additions & 72 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ opt-level = 3
core = { path = "./core", package = "fishfight-core" }
# ultimate = { path = "../FishFight-ultimate", package = "fishfight-ultimate", optional = true }
ff-particles = { version = "0.1", features = ["serde"] }
fishsticks = { git = "https://github.com/fishfight/fishsticks", default-features = false, features = ["gilrs"] }
fishsticks = { git = "https://github.com/fishfight/fishsticks", default-features = false, features = [
"gilrs",
] }
macroquad = { version = "0.3.10" }
macroquad-platformer = "0.1"
hecs = "0.7.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
egui = "0.18.1"
egui_extras = { git = "https://github.com/aleokdev/egui" }
egui-macroquad = "0.9.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.74"

[patch.crates-io]
# Temporal patch until https://github.com/optozorax/egui-macroquad/pull/17 gets merged
egui-macroquad = { git = "https://github.com/aleokdev/egui-macroquad" }
egui = { git = "https://github.com/aleokdev/egui" }
10 changes: 9 additions & 1 deletion assets/textures.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@
"y": 49
}
},
{
"id": "object_error_icon",
"path": "textures/ui/editor_icons/error.png",
"sprite_size": {
"x": 32,
"y": 32
}
},
{
"id": "spawn_point_placement_tool_icon",
"path": "textures/ui/editor_icons/Pointer and Map.png",
Expand Down Expand Up @@ -631,4 +639,4 @@
"y": 6
}
}
]
]
Binary file added assets/textures/ui/editor_icons/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/src/input/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl From<usize> for GamepadMapping {

impl From<&GamepadId> for GamepadMapping {
fn from(id: &GamepadId) -> Self {
let id: usize = id.into();
let id: usize = (*id).into();
id.into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn collect_local_input(input_scheme: GameInputScheme) -> PlayerInput {
let config = storage::get::<Config>();
config
.input
.get_gamepad_mapping(ix.into())
.get_gamepad_mapping((*ix).into())
.unwrap_or_else(|| ix.into())
};

Expand Down
18 changes: 18 additions & 0 deletions src/editor/RATIONALE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
TODO: Delete this file before merging!

- I changed the type of selected_tool from an option of type ID to an enum, because the available
tools are known at compiletime.
- The `actions` module file was too crowded, so I split all actions into their own files in `actions/`.
I think it's much more organized this way.
- Actions have been stripped from the `Action` suffix, as the parent module already tells us that
they are actions: `editor::actions::CreateLayerAction`. So instead of importing all the actions from
the editor and directly calling them with their names, I just import the actions module and refer to
them as `actions::CreateLayer` for instance. I think this is less redundant and also eliminates the
need to import all used actions, as their names are shorter.
- First, I tried to make the `ui` method in the editor state be immutable, sending *all* actions
through `UiAction`s being returned from the function. After a lot of work, I decided against making
it immutable. The reasoning behind this change is that passing all changes through the `UiAction`
enum is tiring and mechanical work that doesn't always have benefits, as there are some changes
that are *not* kept track of, such as opening windows, closing them, changing data within these
windows, etc. As of now, changes that do not require keeping track of are performed immediately,
while actions that do go through the history are sent through `apply_action` immediately.
13 changes: 13 additions & 0 deletions src/editor/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- [X] Object list
- [X] Spawnpoint placement
- [X] Spawnpoint selection & movement
- [X] Object placement via rightclick context menu
- [X] Re-add object placement tool
- [X] Moving camera via middle click
- [X] Open map window
- [X] Import map window
- [X] New map window
- [X] Background edit window
- [X] Map zoom
- [ ] Theme support
- [ ] Gamepad support
Loading