-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbec9a5
commit b5512e0
Showing
15 changed files
with
521 additions
and
104 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use crate::prelude::*; | ||
use ToolEvent::*; | ||
|
||
pub struct FXTool { | ||
id: TheId, | ||
} | ||
|
||
impl Tool for FXTool { | ||
fn new() -> Self | ||
where | ||
Self: Sized, | ||
{ | ||
Self { | ||
id: TheId::named("FX Tool"), | ||
} | ||
} | ||
|
||
fn id(&self) -> TheId { | ||
self.id.clone() | ||
} | ||
fn info(&self) -> String { | ||
str!("FX Tool (X). Apply effects to tiles.") | ||
} | ||
fn icon_name(&self) -> String { | ||
str!("magicwand") | ||
} | ||
fn accel(&self) -> Option<char> { | ||
Some('x') | ||
} | ||
|
||
fn tool_event( | ||
&mut self, | ||
tool_event: ToolEvent, | ||
_tool_context: ToolContext, | ||
_ui: &mut TheUI, | ||
ctx: &mut TheContext, | ||
_project: &mut Project, | ||
_server: &mut Server, | ||
_client: &mut Client, | ||
server_ctx: &mut ServerContext, | ||
) -> bool { | ||
if let Activate = tool_event { | ||
ctx.ui | ||
.send(TheEvent::SetStackIndex(TheId::named("Main Stack"), 3)); | ||
server_ctx.show_fx_marker = true; | ||
|
||
return true; | ||
} else if let DeActivate = tool_event { | ||
server_ctx.show_fx_marker = false; | ||
return true; | ||
}; | ||
|
||
false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.