remove on from user interface events

This commit is contained in:
Brett Mayson
2024-06-08 03:57:42 +00:00
parent 6fa2c43485
commit b667318900
2 changed files with 18 additions and 1 deletions

View File

@@ -142,7 +142,16 @@ pub async fn event_handlers(
"https://community.bistudio.com/wiki/User_Interface_Event_Handlers?action=raw",
"ui",
)
.await,
.await
.into_iter()
.map(|eh| match eh {
EventHandler::Parsed(mut eh) => {
eh.set_id(eh.id().trim_start_matches("on").to_string());
EventHandler::Parsed(eh)
}
EventHandler::Failed(name, e) => EventHandler::Failed(name, e),
})
.collect(),
);
event_handlers.insert(
EventHandlerNamespace::Mission,

View File

@@ -40,11 +40,19 @@ impl ParsedEventHandler {
&self.id
}
pub fn set_id(&mut self, id: String) {
self.id = id;
}
#[must_use]
pub fn description(&self) -> &str {
&self.description
}
pub fn set_description(&mut self, description: String) {
self.description = description;
}
#[must_use]
pub fn params(&self) -> &[Param] {
&self.params