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

[CHART EDITOR] Added tooltip field for data event fields #4220

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion source/funkin/data/event/SongEventSchema.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import funkin.data.song.SongData.SongEventData;
import funkin.util.macro.ClassMacro;
import funkin.play.event.ScriptedSongEvent;

@:forward(name, title, type, keys, min, max, step, units, defaultValue, iterator)
@:forward(name, title, type, keys, min, max, step, units, tooltip, defaultValue, iterator)
abstract SongEventSchema(SongEventSchemaRaw)
{
/**
Expand Down Expand Up @@ -108,6 +108,11 @@ typedef SongEventSchemaField =
*/
type:SongEventFieldType,

/**
* The tooltip to display when the field is hovered
*/
tooltip:String,

/**
* Used only for ENUM values.
* The key is the display name and the value is the actual value.
Expand Down
13 changes: 9 additions & 4 deletions source/funkin/play/event/FocusCameraSongEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -166,37 +166,42 @@ class FocusCameraSongEvent extends SongEvent
title: "Target",
defaultValue: 0,
type: SongEventFieldType.ENUM,
keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2]
keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2],
tooltip: "The character to focus the camera on",
},
{
name: "x",
title: "X Position",
defaultValue: 0,
step: 10.0,
type: SongEventFieldType.FLOAT,
units: "px"
units: "px",
tooltip: "The X offset of the camera",
},
{
name: "y",
title: "Y Position",
defaultValue: 0,
step: 10.0,
type: SongEventFieldType.FLOAT,
units: "px"
units: "px",
tooltip: "The Y offset of the camera",
},
{
name: 'duration',
title: 'Duration',
defaultValue: 4.0,
step: 0.5,
type: SongEventFieldType.FLOAT,
units: 'steps'
units: 'steps',
tooltip: "The duration in steps the event will take",
},
{
name: 'ease',
title: 'Easing Type',
defaultValue: 'linear',
type: SongEventFieldType.ENUM,
tooltip: "The easing type to use",
keys: [
'Linear' => 'linear',
'Sine In' => 'sineIn',
Expand Down
5 changes: 4 additions & 1 deletion source/funkin/play/event/PlayAnimationSongEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,21 @@ class PlayAnimationSongEvent extends SongEvent
title: 'Target',
type: SongEventFieldType.STRING,
defaultValue: 'boyfriend',
tooltip: "The name of the target",
},
{
name: 'anim',
title: 'Animation',
type: SongEventFieldType.STRING,
defaultValue: 'idle',
tooltip: "The name of the animation",
},
{
name: 'force',
title: 'Force',
type: SongEventFieldType.BOOL,
defaultValue: false
defaultValue: false,
tooltip: "Wheter to play the animaton forcefully",
}
]);
}
Expand Down
11 changes: 8 additions & 3 deletions source/funkin/play/event/ScrollSpeedEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,24 @@ class ScrollSpeedEvent extends SongEvent
defaultValue: 1.0,
step: 0.1,
type: SongEventFieldType.FLOAT,
units: 'x'
units: 'x',
tooltip: "The speed multiplier"
},
{
name: 'duration',
title: 'Duration',
defaultValue: 4.0,
step: 0.5,
type: SongEventFieldType.FLOAT,
units: 'steps'
units: 'steps',
tooltip: "The duration in steps",
},
{
name: 'ease',
title: 'Easing Type',
defaultValue: 'linear',
type: SongEventFieldType.ENUM,
tooltip: "The easing type to use",
keys: [
'Linear' => 'linear',
'Instant (Ignores Duration)' => 'INSTANT',
Expand Down Expand Up @@ -163,13 +166,15 @@ class ScrollSpeedEvent extends SongEvent
title: 'Target Strumline',
defaultValue: 'both',
type: SongEventFieldType.ENUM,
keys: ['Both' => 'both', 'Player' => 'player', 'Opponent' => 'opponent']
keys: ['Both' => 'both', 'Player' => 'player', 'Opponent' => 'opponent'],
tooltip: "The target strumline to change the speed in",
},
{
name: 'absolute',
title: 'Absolute',
defaultValue: false,
type: SongEventFieldType.BOOL,
tooltip: "Wheter to set the scroll speed or use as additive to the previous one",
}
]);
}
Expand Down
6 changes: 4 additions & 2 deletions source/funkin/play/event/SetCameraBopSongEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ class SetCameraBopSongEvent extends SongEvent
defaultValue: 1.0,
step: 0.1,
type: SongEventFieldType.FLOAT,
units: 'x'
units: 'x',
tooltip: "The multiplier intensity to bop the camera",
},
{
name: 'rate',
title: 'Rate',
defaultValue: 4,
step: 1,
type: SongEventFieldType.INTEGER,
units: 'beats/zoom'
units: 'beats/zoom',
tooltip: "The rate the camera will bop at",
}
]);
}
Expand Down
10 changes: 7 additions & 3 deletions source/funkin/play/event/ZoomCameraSongEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,31 @@ class ZoomCameraSongEvent extends SongEvent
defaultValue: 1.0,
step: 0.05,
type: SongEventFieldType.FLOAT,
units: 'x'
units: 'x',
tooltip: "The zoom multiplier",
},
{
name: 'duration',
title: 'Duration',
defaultValue: 4.0,
step: 0.5,
type: SongEventFieldType.FLOAT,
units: 'steps'
units: 'steps',
tooltip: "The duration in steps",
},
{
name: 'mode',
title: 'Mode',
defaultValue: 'stage',
type: SongEventFieldType.ENUM,
keys: ['Stage zoom' => 'stage', 'Absolute zoom' => 'direct']
keys: ['Stage zoom' => 'stage', 'Absolute zoom' => 'direct'],
tooltip: "The mode to change the zoom",
},
{
name: 'ease',
title: 'Easing Type',
defaultValue: 'linear',
tooltip: "The easing type to use",
type: SongEventFieldType.ENUM,
keys: [
'Linear' => 'linear',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox
case INTEGER:
var numberStepper:NumberStepper = new NumberStepper();
numberStepper.id = field.name;
numberStepper.tooltip = field.tooltip;
numberStepper.step = field.step ?? 1.0;
if (field.min != null) numberStepper.min = field.min;
if (field.min != null) numberStepper.max = field.max;
Expand All @@ -197,6 +198,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox
case FLOAT:
var numberStepper:NumberStepper = new NumberStepper();
numberStepper.id = field.name;
numberStepper.tooltip = field.tooltip;
numberStepper.step = field.step ?? 0.1;
if (field.min != null) numberStepper.min = field.min;
if (field.max != null) numberStepper.max = field.max;
Expand All @@ -205,11 +207,13 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox
case BOOL:
var checkBox:CheckBox = new CheckBox();
checkBox.id = field.name;
checkBox.tooltip = field.tooltip;
if (field.defaultValue != null) checkBox.selected = field.defaultValue;
input = checkBox;
case ENUM:
var dropDown:DropDown = new DropDown();
dropDown.id = field.name;
dropDown.tooltip = field.tooltip;
dropDown.width = 200.0;
dropDown.dropdownSize = 10;
dropDown.dropdownWidth = 300;
Expand All @@ -236,6 +240,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox
case STRING:
input = new TextField();
input.id = field.name;
input.tooltip = field.tooltip;
if (field.defaultValue != null) input.text = field.defaultValue;
default:
// Unknown type. Display a label that proclaims the type so we can debug it.
Expand Down
Loading