Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New System for Tile Map, Tile Set, and Brush #714

Merged
merged 51 commits into from
Jan 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
36b1063
Merge branch 'FyroxEngine:master' into tiles
b-guild Nov 5, 2024
4465d42
Merge branch 'FyroxEngine:master' into tiles
b-guild Nov 6, 2024
ca3f6b6
Merge branch 'FyroxEngine:master' into tiles
b-guild Nov 8, 2024
6f97d7f
Merge branch 'FyroxEngine:master' into tiles
b-guild Nov 28, 2024
b6d6c87
Rough working version of new tile set editor.
b-guild Nov 28, 2024
8d1f106
Bringing up to date with latest changes
b-guild Nov 28, 2024
ddfd02d
Merge branch 'FyroxEngine:master' into tiles
b-guild Dec 15, 2024
7ad7a34
Updating to latest Fyrox style system.
b-guild Dec 15, 2024
a491269
Merge branch 'FyroxEngine:master' into tiles
b-guild Dec 23, 2024
ffa6469
Merge branch 'tiles' of https://github.com/b-guild/Fyrox-glTF into tiles
b-guild Dec 23, 2024
3230e49
Merge branch 'FyroxEngine:master' into tiles
b-guild Dec 23, 2024
c2fcffd
Fully functional version of TileMap with TileSet editor and Brush editor
b-guild Dec 23, 2024
d920cc0
Merge branch 'tiles' of https://github.com/b-guild/Fyrox-glTF into tiles
b-guild Dec 23, 2024
e2f8d12
Moving hotkeys to 1,2,3 to avoid conflicts and making flood fill inde…
b-guild Dec 24, 2024
579fa7a
Corrections for clippy.
b-guild Dec 24, 2024
307b6fc
More corrections for clippy.
b-guild Dec 24, 2024
486881a
Removing obsolete example documentation. Need to replace them with up…
b-guild Dec 24, 2024
c6ffac5
Conceptually simplified and improved Transform sets, plus minor fixes.
b-guild Dec 24, 2024
51bda42
Added checkboard behind tile set tiles to show transparency
b-guild Dec 24, 2024
9398a5a
Removing obsolete ResourceGrid concept that was just an early experim…
b-guild Dec 24, 2024
6b87d54
Re-organizing messing use-statements.
b-guild Dec 25, 2024
e288efc
Adding an easy way to access tile properties through a TileMap
b-guild Dec 25, 2024
c04368b
Minor fix for clippy
b-guild Dec 25, 2024
3cb7c2a
Minor fix for clippy
b-guild Dec 25, 2024
4e10bd8
Added method to get tile properties with generic typing
b-guild Dec 25, 2024
dd50cde
Adding PropertyEditorDefinition for TileDefinitionHandle
b-guild Dec 26, 2024
7ea4519
Fixing bugs in tile dragging.
b-guild Dec 26, 2024
f82bf21
Creating NineI8 struct to better represent nine-slice property values…
b-guild Dec 27, 2024
4d30174
Simplified tile set interface by creating ResourceTilePosition
b-guild Dec 28, 2024
7bf1891
Experimental addition of WidgetMessage::ReplaceChildren in order to s…
b-guild Dec 28, 2024
0177821
Add pick button to tile set editor, auto-switch out of editor draw mo…
b-guild Dec 29, 2024
e74eed7
Accidental unused import.
b-guild Dec 29, 2024
fd5792e
Make the tile set pick tool button do something when clicked.
b-guild Dec 29, 2024
05f1789
Expanding comments of tile set editor
b-guild Dec 29, 2024
fcfd38b
Fixing comment markup
b-guild Dec 29, 2024
47c15b0
More comments for tile map.
b-guild Dec 29, 2024
083f0e5
Some requested changes to tile map.
b-guild Dec 30, 2024
a93e50f
Added swap_hash_map_entries to fyrox-core
b-guild Dec 30, 2024
557f6eb
Removing TileMapEditorData and introducing TileMapEffect
b-guild Jan 1, 2025
c06381b
Comment correction
b-guild Jan 1, 2025
2d927a9
Update to new texture system and creating tile map before_effect and …
b-guild Jan 1, 2025
02bb6c1
Fixing comment.
b-guild Jan 1, 2025
1b8a848
Fixing tile map collider shape
b-guild Jan 4, 2025
1bab21d
More fixing tile map collider shape
b-guild Jan 4, 2025
c58165e
Fixes for TileMap
b-guild Jan 4, 2025
df71fa8
Fixing transform set tile move logic error
b-guild Jan 5, 2025
f8bcc4e
Typo in comment
b-guild Jan 7, 2025
1ecaaad
Requested changes
b-guild Jan 9, 2025
0770c7f
Removing `map_or(false,...) to make clippy happy.
b-guild Jan 10, 2025
e6992b5
Fixing error when deleting tile pages through palette hotkey.
b-guild Jan 10, 2025
d8d3722
Make tile map cursor disappear when mouse leaves scene preview
b-guild Jan 10, 2025
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
Prev Previous commit
Next Next commit
Update to new texture system and creating tile map before_effect and …
…after_effect
  • Loading branch information
b-guild committed Jan 1, 2025
commit 2d927a9a7934c88b14ebc0b920d0fde76fcfebf8
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ on:
push:
pull_request:
workflow_dispatch:
# This allows running it on any branch manually:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# This allows running it on any branch manually:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow

env:
CARGO_TERM_COLOR: always
@@ -22,9 +22,9 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable]
rust: [ stable ]
# For reference: https://github.com/actions/virtual-environments#available-environments
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
@@ -56,7 +56,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable]
rust: [ stable ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
@@ -188,3 +188,13 @@ jobs:
fyrox-template upgrade --version=latest --local
cd executor-wasm
wasm-pack build --target=web
project_manager:
name: Project Manager
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build Project Manager
run: |
cargo build --package fyrox-project-manager
1 change: 1 addition & 0 deletions .idea/rg3d-core.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ members = [
"project-manager",
"fyrox-graphics",
"fyrox-build-tools"
]
, "fyrox-texture"]
resolver = "2"

[profile.dev]
6 changes: 3 additions & 3 deletions editor-standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fyroxed"
version = "0.17.0"
version = "0.36.0"
license = "MIT"
authors = ["Dmitry Stepanov <d1maxa@yandex.ru>"]
edition = "2021"
@@ -13,6 +13,6 @@ readme = "README.md"
include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md"]

[dependencies]
fyrox = { version = "0.34.0", path = "../fyrox" }
fyroxed_base = { version = "0.21.0", path = "../editor" }
fyrox = { version = "0.36.0", path = "../fyrox" }
fyroxed_base = { version = "0.36.0", path = "../editor" }
clap = { version = "4", features = ["derive"] }
6 changes: 3 additions & 3 deletions editor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fyroxed_base"
license = "MIT"
version = "0.21.1"
version = "0.36.0"
authors = ["Dmitry Stepanov <d1maxa@yandex.ru>"]
edition = "2021"
rust-version = "1.80"
@@ -13,8 +13,8 @@ readme = "README.md"
include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md", "/resources/**/*"]

[dependencies]
fyrox = { version = "0.34.1", path = "../fyrox", default-features = false }
fyrox-build-tools = { version = "0.1.0", path = "../fyrox-build-tools" }
fyrox = { version = "0.36.0", path = "../fyrox", default-features = false }
fyrox-build-tools = { version = "0.36.0", path = "../fyrox-build-tools" }
lazy_static = "1.4.0"
ron = "0.8.0"
serde = "^1.0.0"
Binary file added editor/resources/Roboto-Regular.ttf
Binary file not shown.
Binary file removed editor/resources/arial.ttf
Binary file not shown.
9 changes: 5 additions & 4 deletions editor/src/asset/item.rs
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ use crate::{
message::MessageSender,
Message,
};
use fyrox::resource::texture::TextureResource;
use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
@@ -57,14 +58,14 @@ use std::{
pub enum AssetItemMessage {
Select(bool),
Icon {
texture: Option<UntypedResource>,
texture: Option<TextureResource>,
flip_y: bool,
},
}

impl AssetItemMessage {
define_constructor!(AssetItemMessage:Select => fn select(bool), layout: false);
define_constructor!(AssetItemMessage:Icon => fn icon(texture: Option<UntypedResource>, flip_y: bool), layout: false);
define_constructor!(AssetItemMessage:Icon => fn icon(texture: Option<TextureResource>, flip_y: bool), layout: false);
}

#[allow(dead_code)]
@@ -264,7 +265,7 @@ impl Control for AssetItem {
pub struct AssetItemBuilder {
widget_builder: WidgetBuilder,
path: Option<PathBuf>,
icon: Option<UntypedResource>,
icon: Option<TextureResource>,
}

fn make_tooltip(ctx: &mut BuildContext, text: &str) -> RcUiNodeHandle {
@@ -303,7 +304,7 @@ impl AssetItemBuilder {
self
}

pub fn with_icon(mut self, icon: Option<UntypedResource>) -> Self {
pub fn with_icon(mut self, icon: Option<TextureResource>) -> Self {
self.icon = icon;
self
}
5 changes: 2 additions & 3 deletions editor/src/asset/preview/cache.rs
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ use crate::{
engine::Engine,
fxhash::FxHashMap,
gui::{message::MessageDirection, UiNode},
resource::texture::Texture,
},
};
use std::sync::mpsc::Receiver;
@@ -76,7 +75,7 @@ impl AssetPreviewCache {
generator.simple_icon(&resource, &engine.resource_manager)
{
let preview = AssetPreviewTexture {
texture: icon.try_cast::<Texture>().unwrap(),
texture: icon,
flip_y: false,
};
self.container.insert(resource_kind, preview.clone());
@@ -94,7 +93,7 @@ impl AssetPreviewCache {
ui.send_message(AssetItemMessage::icon(
asset_item,
MessageDirection::ToWidget,
Some(preview.texture.into()),
Some(preview.texture),
preview.flip_y,
));
}
24 changes: 12 additions & 12 deletions editor/src/asset/preview/mod.rs
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ pub trait AssetPreviewGenerator: Send + Sync + 'static {
&self,
resource: &UntypedResource,
resource_manager: &ResourceManager,
) -> Option<UntypedResource>;
) -> Option<TextureResource>;
}

pub struct TexturePreview;
@@ -186,8 +186,8 @@ impl AssetPreviewGenerator for TexturePreview {
&self,
resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
resource.try_cast::<Texture>().map(Into::into)
) -> Option<TextureResource> {
resource.try_cast::<Texture>()
}
}

@@ -284,7 +284,7 @@ impl AssetPreviewGenerator for SoundPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/sound.png")
}
}
@@ -409,7 +409,7 @@ impl AssetPreviewGenerator for ModelPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/model.png")
}
}
@@ -450,7 +450,7 @@ impl AssetPreviewGenerator for SurfaceDataPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/model.png")
}
}
@@ -494,7 +494,7 @@ impl AssetPreviewGenerator for ShaderPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/shader.png")
}
}
@@ -538,7 +538,7 @@ impl AssetPreviewGenerator for MaterialPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/material.png")
}
}
@@ -569,7 +569,7 @@ impl AssetPreviewGenerator for HrirPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/hrir.png")
}
}
@@ -599,7 +599,7 @@ impl AssetPreviewGenerator for CurvePreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/curve.png")
}
}
@@ -677,7 +677,7 @@ impl AssetPreviewGenerator for FontPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/font.png")
}
}
@@ -712,7 +712,7 @@ impl AssetPreviewGenerator for UserInterfacePreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/ui.png")
}
}
4 changes: 2 additions & 2 deletions editor/src/export.rs
Original file line number Diff line number Diff line change
@@ -881,7 +881,7 @@ impl ExportWindow {
)
.add_row(Row::auto())
.add_row(Row::stretch())
.add_column(Column::auto())
.add_column(Column::stretch())
.build(ctx);

let buttons_section = StackPanelBuilder::new(
@@ -939,7 +939,7 @@ impl ExportWindow {
.add_row(Row::strict(200.0))
.add_row(Row::stretch())
.add_row(Row::strict(32.0))
.add_column(Column::auto())
.add_column(Column::stretch())
.build(ctx),
)
.with_title(WindowTitle::text("Export Project"))
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.