-- IMPORTANT: Button and dialog data defined at end of Lua file (CCE_buttons)
-- Corner_positions
local BTN_POS_TOP = 110 -- Top row of buttons
local BTN_POS_LEFT = 80 -- Left edge
local BTN_POS_RIGHT = (1280 - 80) -- Right edge
if vint_is_std_res() then
BTN_POS_RIGHT = (960 - 80)
end
local BTN_POS_BOTTOM = 720 - 40 -- Bottom row of buttons
-- Global variables
Cinema_clip_editor_doc_handle = -1
-- Mouse input
Mouse_input_tracker = -1
-- Get the Back/Esc button when moving the camera or selecting a target
Input_tracker = -1
CCE_option_beginner_mode = false
-- Button variables
local Num_buttons = 0
-- Completely transparent backdrop for capturing mouse_move events
local Button_bg
-- Colors for some of the elements
local COLOR_DIALOG_HEADING = {R=80/255, G=75/255, B=78/255}
local COLOR_KEYS_KEY = {R=180/255, G=50/255, B=230/255}
local COLOR_KEYS_ACTION = {R=180/255, G=180/255, B=180/255}
local COLOR_EXPORT_TITLE = {R=160/255, G=160/255, B=160/255}
local COLOR_EXPORT_LOCKED = {R=80/255, G=75/255, B=78/255}
local COLOR_EXPORT_UNLOCKED = {R=160/255, G=0/255, B=0/255}
local COLOR_TOOLTIP_TEXT = {R=160/255, G=160/255, B=160/255}
-- Sizing constants
local ICON_BUTTON_WIDTH = 35
local DIALOG_TOP = 128
local DIALOG_TITLE_OFFSET = 5
local DIALOG_SPACING = 28
local DIALOG_HEADER = 35
local DIALOG_BUTTON_OFFSET = 17
local DIALOG_X_MIN = 125
local DIALOG_X_MAX = 1280 - DIALOG_X_MIN
local DIALOG_SIDE_BUFFER = 6
local KEYS_BOTTOM = 680
local KEYS_CENTER = 640
local KEYS_BUFFER = 10
local KEYS_SPACING = 20
-- Defines for zone property option lists
local PROP_TYPE_CUT = 0
local PROP_TYPE_BLEND = 1
local PROP_MODE_DEFAULT = 0
local PROP_MODE_STATIC = 1
local PROP_MODE_FOLLOW = 2
local PROP_MODE_FOLLOW_LOOK = 3
local PROP_MODE_FOLLOW_WATCH = 4
local PROP_MODE_TRACKING = 5
local PROP_DOF_OFF = 0
local PROP_DOF_ZOOM = 1
local PROP_DOF_CLOSEUP = 2
local PROP_DOF_NORMAL = 3
local PROP_SLOMO_OFF = 0
local PROP_SLOMO_HALF = 1
local PROP_SLOMO_QUARTER = 2
local PROP_EASE_LINEAR = 0
local PROP_EASE_IN = 1
local PROP_EASE_OUT = 2
local PROP_EASE_BOTH = 3
-- Popup to show the shortcut and control keys
local Keys_popup = {
x = 0, y = 0, w = 0, h = 0, -- Position and size
visible = true,
bg = nil, -- Backdrop
split = 14,
num_keys = 0,
text_key = {}, -- Text for keys (change to have key bitmap as well?)
text_action = {}, -- Text for key controls
}
-- Simple popup to show when video is exporting and if the camera is locked or not
local Export_popup = {
export_text = nil,
camera_text = nil,
x = 640, y = 110,
}
local Tooltip = {
tooltip_text = nil,
x = 640, y = 680,
}
-- Default data for what the keys popup will show
-- Eventually get this data from the game instead of hardcoding it
local Keys_data = {
[1] = { key = "MOVE*", action = "MOVE CAMERA" },
[2] = { key = "AIM*", action = "ROTATE CAMERA" },
[3] = { key = "E*", action = "MOVE CAMERA UP" },
[4] = { key = "C*", action = "MOVE CAMERA DOWN" },
[5] = { key = "1*", action = "TILT CAMERA LEFT" },
[6] = { key = "2*", action = "TILT CAMERA RIGHT" },
[7] = { key = "4*", action = "DECREASE FOV" },
[8] = { key = "5*", action = "INCREASE FOV" },
[9] = { key = "7*", action = "DECREASE HANDYCAM" },
[10] = { key = "8*", action = "INCREASE HANDYCAM" },
[11] = { key = "9*", action = "DECREASE DOF DISTANCE" },
[12] = { key = "0*", action = "INCREASE DOF DISTANCE" },
[13] = { key = "O*", action = "DECREASE DOF FOCAL RANGE" },
[14] = { key = "P*", action = "INCREASE DOF FOCAL RANGE" },
[15] = { key = "*+SHFT", action = "- FASTER" },
[16] = { key = "*+CTRL", action = "- SLOWER" },
[17] = { key = "HOLD Z", action = "HEADING-ONLY ROTATION" },
[18] = { key = "HOLD X", action = "PITCH-ONLY ROTATION" },
[19] = { key = "", action = "" },
[20] = { key = "SPC", action = "PLAY/PAUSE" },
[21] = { key = "SHFT+SPC", action = "PLAY TO NEXT ZONE" },
[22] = { key = "ENTER", action = "SHOW/HIDE ZONE PROPERTIES" },
[23] = { key = "L", action = "TOGGLE ZONE LOCK" },
[24] = { key = "N", action = "CYCLE FOLLOW MODE" },
[25] = { key = "T", action = "TOGGLE TARGET ICONS" },
[26] = { key = "SHFT+T", action = "TARGET SELECT MODE" },
[27] = { key = "SHFT+M", action = "EDIT CAMERA POSITION" },
[28] = { key = "G", action = "CYCLE SLOW-MO TYPE" },
[29] = { key = "I", action = "CYCLE DEPTH OF FIELD TYPE" },
}
-- These objects are located in the VINT doc, but are only for cloning usage, not actual UI
local Base_button
local Base_dialog_bg
local Base_dialog_text
local Base_keys_bg
local Base_keys_text
-- These objects are located in the VINT doc, and are only used once
local Export_progress_meter -- Used to show the state of exporting
local Hint_bar -- Used to show which button to push in certain modes (cannot be clicked on)
-- Confirmation popup data/constants (used for export/exit/rewind)
local Confirm_popup
local CONFIRM_LIST_SIZE = 427
local CONFIRM_CHOICES_EXIT = {
[1] = { type = TYPE_BUTTON, label = "EXIT", id = 1, },
[2] = { type = TYPE_BUTTON, label = "CANCEL", id = 2, },
}
local CONFIRM_CHOICES_EXPORT = {
[1] = { type = TYPE_BUTTON, label = "EXPORT", id = 1, },
[2] = { type = TYPE_BUTTON, label = "CANCEL", id = 2, },
}
local CONFIRM_CHOICES_REWIND = {
[1] = { type = TYPE_BUTTON, label = "REWIND", id = 1, },
[2] = { type = TYPE_BUTTON, label = "CANCEL", id = 2, },
}
local CONFIRM_CHOICES_CAMERA = {
[1] = { type = TYPE_BUTTON, label = "EDIT", id = 1, },
[2] = { type = TYPE_BUTTON, label = "CANCEL", id = 2, },
}
function cinema_clip_editor_init()
-- Handle all the standard res coordinates
if vint_is_std_res() then
Export_popup.x = 480
Tooltip.x = 480
KEYS_CENTER = 480
end
Cinema_clip_editor_doc_handle = vint_document_find("cinema_clip_editor")
-- This backdrop is here to catch mouse_move events when not over a button
-- (It's a hack, but one which may ship because this might be the only screen/interface that's mouse-only)
Button_bg = Vdo_base_object:new("button_bg", 0, Cinema_clip_editor_doc_handle)
Button_bg:set_visible(false)
-- Init the base objects
Base_button = Vdo_button_pc:new("button_base")
Base_dialog_bg = Vdo_base_object:new("dialog_bg", 0, Cinema_clip_editor_doc_handle)
Base_dialog_text = Vdo_base_object:new("dialog_text", 0, Cinema_clip_editor_doc_handle)
Base_keys_bg = Vdo_base_object:new("keys_bg", 0, Cinema_clip_editor_doc_handle)
Base_keys_text = Vdo_base_object:new("keys_text", 0, Cinema_clip_editor_doc_handle)
-- Init the special objects
Export_progress_meter = Vdo_export_progress_meter:new("progress_meter")
Hint_bar = Vdo_hint_bar:new("hint_bar")
-- Setup confirmation popup
Confirm_popup = Vdo_store_popup:new("confirm_popup", 0, Cinema_clip_editor_doc_handle)
Confirm_popup:set_visible(false)
Confirm_popup:set_size(CONFIRM_LIST_SIZE, (LIST_BUTTON_HEIGHT * 5) + (LIST_BUTTON_SPACE * 5))
Confirm_popup:set_color(COLOR_SAINTS_PURPLE, COLOR_STORE_REWARDS_SECONDARY, COLOR_STORE_REWARDS_TERTIARY)
-- Create all the buttons (and dialogs)
-- Reminder: Data for buttons and dialogs is at the END of this file
-- Start with the buttons not associated with a dialog
-- Rewind/Play/Pause/Options/AV buttons
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_REWIND], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 0.5, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_PLAY_SLOW], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 2.0, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_PLAY], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 3.0 + 4, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_PLAY_FAST], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 4.0 + 8, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_PAUSE], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 5.0 + 12, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_OPTIONS], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 6.5 + 12, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_AV], BTN_POS_LEFT + ICON_BUTTON_WIDTH * 8.0 + 12, BTN_POS_TOP)
-- Save/Export/Exit buttons
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_SAVE], BTN_POS_RIGHT - ICON_BUTTON_WIDTH * 3.5, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_EXPORT], BTN_POS_RIGHT - ICON_BUTTON_WIDTH * 2.0, BTN_POS_TOP)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_EXIT], BTN_POS_RIGHT - ICON_BUTTON_WIDTH * 0.5, BTN_POS_TOP)
-- Also move the Export_progress_meter below the export button
Export_progress_meter:set_anchor(BTN_POS_RIGHT - ICON_BUTTON_WIDTH * 2.0, BTN_POS_TOP + 30)
Export_progress_meter:update(true, "EXPORT_READY", 0.0, false)
-- Show Keys button (aligned left)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_SHOW_KEYS], BTN_POS_LEFT, BTN_POS_BOTTOM)
cinema_clip_editor_button_align_left(CCE_free_buttons[BTN_FREE_SHOW_KEYS], 150)
-- Hide the SHOW KEYS BUTTON (might not be used)
CCE_free_buttons[BTN_FREE_SHOW_KEYS].button:set_visible(false)
-- Hide HUD button (aligned right)
cinema_clip_editor_button_create(CCE_free_buttons[BTN_FREE_HIDE_HUD], BTN_POS_RIGHT, BTN_POS_BOTTOM)
cinema_clip_editor_button_align_right(CCE_free_buttons[BTN_FREE_HIDE_HUD], 150)
-- Hidden Show HUD button (aligned to same location as Hide HUD button, but not in a group)
CCE_free_buttons[BTN_FREE_SHOW_HUD].button = Vdo_button_pc:new("button_show_hud")
CCE_free_buttons[BTN_FREE_SHOW_HUD].button:create(CCE_free_buttons[BTN_FREE_SHOW_HUD].data)
CCE_free_buttons[BTN_FREE_SHOW_HUD].button:set_anchor(BTN_POS_RIGHT, BTN_POS_BOTTOM + 720) -- Offscreen so it doesn't mess up the Hide HUD button
if vint_is_std_res() then
CCE_free_buttons[BTN_FREE_SHOW_HUD].button:set_scale(0.66667, 0.66667)
end
cinema_clip_editor_button_align_right(CCE_free_buttons[BTN_FREE_SHOW_HUD], 150)
-- Camera zone dialog (buttons are initialized inside dialog_init)
local dialog = CCE_dialogs[DLG_CAMERA_ZONE]
cinema_clip_editor_dialog_add_heading(dialog, 4, "PC_NEW_ZONE")
cinema_clip_editor_dialog_init(dialog)
-- Options dialog
dialog = CCE_dialogs[DLG_OPTIONS]
--cinema_clip_editor_dialog_add_heading(dialog, 4, "PC_EXPORT_SETTINGS")
--cinema_clip_editor_dialog_add_heading(dialog, 6, "PC_CHARACTER_MODEL")
cinema_clip_editor_dialog_init(dialog)
cinema_clip_editor_dialog_slide(dialog, dialog.x_pos) -- Make sure it's aligned correctly
-- AV dialog
dialog = CCE_dialogs[DLG_AV]
cinema_clip_editor_dialog_add_heading(dialog, 3, "PC_GREEN_SCREEN")
cinema_clip_editor_dialog_add_heading(dialog, 7, "PC_AUDIO_TOGGLES")
cinema_clip_editor_dialog_init(dialog)
cinema_clip_editor_dialog_slide(dialog, dialog.x_pos) -- Make sure it's aligned correctly
-- Properties dialog
dialog = CCE_dialogs[DLG_PROP]
cinema_clip_editor_dialog_add_heading(dialog, 6, "PC_ADDITIONAL_PROPS")
cinema_clip_editor_dialog_init(dialog)
-- Cancel dialog (used for submodes: selecting target and positioning camera)
-- Note that this dialog is hacked up a bit because it uses a hint_bar
dialog = CCE_dialogs[DLG_CANCEL]
cinema_clip_editor_dialog_init(dialog)
-- Set CCE_buttons to be the button master list (for easier mouse processing)
cinema_clip_editor_set_button_ref()
Num_buttons = #CCE_buttons
-- Init the timeline
cinema_clip_editor_timeline_init()
-- Init mouse controls (not using "if PC" because this screen will only be used on PC)
Mouse_input_tracker = Vdo_input_tracker:new()
for i = 1, Num_buttons do
if CCE_buttons[i].data.type == PC_TYPE_SLIDER then
-- Arrow and slider controls for sliders
CCE_buttons[i].button:add_mouse_inputs("cinema_clip_editor", Mouse_input_tracker, false)
cinema_clip_editor_slider_add_extra_inputs(CCE_buttons[i].button, Mouse_input_tracker)
elseif CCE_buttons[i].data.type == PC_TYPE_TOGGLE then
-- Toggles also get input tracking for their left arrow
CCE_buttons[i].button:add_mouse_inputs("cinema_clip_editor", Mouse_input_tracker, true)
cinema_clip_editor_toggle_add_arrow_inputs(CCE_buttons[i].button, Mouse_input_tracker)
else
-- Other buttons are straightforward
CCE_buttons[i].button:add_mouse_inputs("cinema_clip_editor", Mouse_input_tracker, true)
end
end
-- Show HUD button
Mouse_input_tracker:add_mouse_input("mouse_move", "cinema_clip_editor_mouse_move", 0, Button_bg.handle)
-- Add inputs for the timeline
cinema_clip_editor_timeline_add_mouse_inputs(Mouse_input_tracker)
-- Done adding mouse inputs, subscribe to them
Mouse_input_tracker:subscribe(true)
-- Button input tracker
Input_tracker = Vdo_input_tracker:new()
Input_tracker:add_input("back", "cinema_clip_editor_button_back", 50)
Input_tracker:subscribe(true)
-- Hide the dialogs by default
for i = 1, #CCE_dialogs do
cinema_clip_editor_dialog_hide(CCE_dialogs[i])
end
-- Create the keys popup (and hide it)
cinema_clip_editor_keys_init(Keys_popup, Keys_data)
cinema_clip_editor_keys_toggle_visibility(Keys_popup)
-- Create the export popup (and hide it)
cinema_clip_editor_exporting_init(Export_popup)
cinema_clip_editor_exporting_set_locked(Export_popup, true)
cinema_clip_editor_exporting_set_visibility(Export_popup, false)
-- Create the tooltip text
cinema_clip_editor_tooltip_init(Tooltip)
-- Hide the base objects
Base_button:set_visible(false)
Base_dialog_bg:set_visible(false)
Base_dialog_text:set_visible(false)
Base_keys_text:set_visible(false)
Base_keys_bg:set_visible(false)
Hint_bar:set_visible(false)
-- Reset the play/pause buttons
cinema_clip_editor_cb_pause(CCE_free_buttons[BTN_FREE_PAUSE].button)
-- Export/encoder status update (disabled for now)
Export_progress_meter:set_visible(false)
--vint_dataitem_add_subscription("encoder_info_di", "update", "cinema_clip_editor_encoder_info_di")
end
-- Update the export progress meter
function cinema_clip_editor_encoder_info_di(di_h)
local progress, state = vint_dataitem_get(di_h)
local status_text = ""
if state ~= 1 then
if state == 3 then
progress = 1
status_text = "EXPORT_DONE"
else
progress = 0
if state == 2 then
status_text = "EXPORT_ERROR"
else
status_text = "EXPORT_READY"
end
end
else
status_text = "EXPORT_IN_PROGRESS"
end
Export_progress_meter:update(true, status_text, progress, false)
end
-- Get references to all the buttons, save them in one table (for easier mouse input processing)
function cinema_clip_editor_set_button_ref()
-- First get all the non-dialog buttons
for i = 1, #CCE_free_buttons do
CCE_buttons[i] = CCE_free_buttons[i]
end
-- Then add all the dialogs' buttons
local cce_counter = #CCE_buttons
for i = 1, #CCE_dialogs do
for j = 1, #CCE_dialogs[i].buttons do
cce_counter = cce_counter + 1
CCE_buttons[cce_counter] = CCE_dialogs[i].buttons[j]
end
if CCE_dialogs[i].ease_buttons ~= nil then
for j = 1, #CCE_dialogs[i].ease_buttons do
cce_counter = cce_counter + 1
CCE_buttons[cce_counter] = CCE_dialogs[i].ease_buttons[j]
end
end
end
end
function cinema_clip_editor_cleanup()
if Mouse_input_tracker ~= nil then
Mouse_input_tracker:subscribe(false)
end
Input_tracker:subscribe(false)
end
--------------------------------------------------------------------------
-- Special case (keys and exporting) popup functions
--------------------------------------------------------------------------
function cinema_clip_editor_tooltip_init(popup)
popup.tooltip_text = Vdo_base_object:clone(Base_keys_text.handle)
-- Set alignment, color, default text, and position
popup.tooltip_text:set_property("auto_offset", "n")
popup.tooltip_text:set_color(COLOR_TOOLTIP_TEXT)
popup.tooltip_text:set_anchor(popup.x, popup.y)
popup.tooltip_text:set_scale(0.8, 0.8)
vint_set_property(popup.tooltip_text.handle, "shadow_enabled", true)
vint_set_property(popup.tooltip_text.handle, "shadow_offset", 2, 2)
cinema_clip_editor_tooltip_set_text(" ")
end
function cinema_clip_editor_tooltip_set_text(text)
Tooltip.tooltip_text:set_text(text)
end
-- Create the exporting popup
function cinema_clip_editor_exporting_init(popup)
popup.export_text = Vdo_base_object:clone(Base_keys_text.handle)
popup.camera_text = Vdo_base_object:clone(Base_dialog_text.handle)
-- Set alignment, color, text, and move them where they should be
popup.export_text:set_property("auto_offset", "s")
popup.export_text:set_color(COLOR_EXPORT_TITLE)
popup.export_text:set_text("PC_EXPORTING_VIDEO")
popup.export_text:set_anchor(popup.x, popup.y)
popup.export_text:set_scale(0.8, 0.8)
popup.camera_text:set_property("auto_offset", "n")
popup.camera_text:set_anchor(popup.x, popup.y)
popup.camera_text:set_scale(0.5, 0.5)
-- Text and color set in exporting_set_locked
end
-- Set the export popup text to locked or unlocked (and change text color)
function cinema_clip_editor_exporting_set_locked(popup, locked)
if locked then
popup.camera_text:set_color(COLOR_EXPORT_LOCKED)
popup.camera_text:set_text("PC_CAMERA_LOCKED")
else
popup.camera_text:set_color(COLOR_EXPORT_UNLOCKED)
popup.camera_text:set_text("PC_CAMERA_UNLOCKED")
end
end
-- Show/hide the export popup
function cinema_clip_editor_exporting_set_visibility(popup, visible)
popup.export_text:set_visible(visible)
popup.camera_text:set_visible(visible)
end
-- Creates the keys popup
function cinema_clip_editor_keys_init(popup, data)
popup.bg = Vdo_base_object:clone(Base_keys_bg.handle)
popup.num_keys = #data
for i = 1, popup.num_keys do
-- Create the key and action text
popup.text_key[i] = Vdo_base_object:clone(Base_keys_text.handle)
popup.text_action[i] = Vdo_base_object:clone(Base_keys_text.handle)
popup.text_key[i]:set_color(COLOR_KEYS_KEY)
popup.text_action[i]:set_color(COLOR_KEYS_ACTION)
end
cinema_clip_editor_keys_reset_and_resize(popup, data)
end
-- Reloads the text from data and resizes the popup appropriately
function cinema_clip_editor_keys_reset_and_resize(popup, data)
local w1 = 0
local w2 = 0
-- Set text (using data) and measure the widths
for i = 1, popup.num_keys do
popup.text_key[i]:set_text(data[i].key)
popup.text_action[i]:set_text(data[i].action)
local w = popup.text_key[i]:get_actual_size() + 2 -- A little padding
if (w > w1) then
w1 = w
end
w = popup.text_action[i]:get_actual_size() + 2 -- A little padding
if (w > w2) then
w2 = w
end
end
-- Calculate the width and how far to offset column 2
local column_2_offset = (w1 + w2) + KEYS_BUFFER
popup.w = (w1 + w2) * 2 + KEYS_BUFFER * 2
-- Figure out how many rows of keys will show, apply this info to the popup's height
local max_rows = popup.split
if (popup.num_keys - popup.split > max_rows) then
max_rows = popup.num_keys - popup.split
end
popup.h = max_rows * KEYS_SPACING + KEYS_BUFFER
-- Set the popup's upper left corner
popup.x = KEYS_CENTER - popup.w * 0.5
popup.y = KEYS_BOTTOM - popup.h
-- Position and resize the backdrop
popup.bg:set_anchor(popup.x, popup.y)
popup.bg:set_actual_size(popup.w, popup.h)
-- Space the keys out (1st column)
for i = 1, popup.split do
popup.text_key[i]:set_anchor(popup.x + KEYS_BUFFER * 0.5, popup.y + KEYS_BUFFER * 0.5 + (i - 1) * KEYS_SPACING)
popup.text_action[i]:set_anchor(popup.x + KEYS_BUFFER * 0.5 + (w1 + 2), popup.y + KEYS_BUFFER * 0.5 + (i - 1) * KEYS_SPACING)
end
-- 2nd column
for i = popup.split + 1, popup.num_keys do
popup.text_key[i]:set_anchor(popup.x + KEYS_BUFFER * 0.5 + column_2_offset, popup.y + KEYS_BUFFER * 0.5 + (i - popup.split - 1) * KEYS_SPACING)
popup.text_action[i]:set_anchor(popup.x + KEYS_BUFFER * 0.5 + (w1 + 2) + column_2_offset, popup.y + KEYS_BUFFER * 0.5 + (i - popup.split - 1) * KEYS_SPACING)
end
end
-- Toggles the visibility of the keys popup
function cinema_clip_editor_keys_toggle_visibility(popup)
if (popup.visible) then
popup.visible = false
else
popup.visible = true
end
cinema_clip_editor_keys_apply_visibility(popup)
end
-- Applies visible state of the keys popup
function cinema_clip_editor_keys_apply_visibility(popup)
popup.bg:set_visible(popup.visible)
for i = 1, popup.num_keys do
popup.text_key[i]:set_visible(popup.visible)
popup.text_action[i]:set_visible(popup.visible)
end
end
---
-- Confirmation popup functions
---
-- Select between the different confirmation options
function cinema_clip_editor_confirm_nav(event, value)
--if event == "nav_up" then
-- Store_popup.list:move_cursor(-1)
--elseif event == "nav_down" then
-- Store_popup.list:move_cursor(1)
if event == "mouse_move" then
-- value contains the target_handle in this case
local new_index = Confirm_popup.list:get_button_index(value)
if new_index ~= 0 then
Confirm_popup.list:set_selection(new_index)
Confirm_popup.list:move_cursor(0, true)
end
else
--do nothing
end
end
local Acquire_something = false
local Acquire_target = false
function cinema_clip_editor_button_back(event)
if Acquire_something then
cinema_clip_editor_cb_cancel()
Acquire_something = false
end
end
--------------------------------------------------------------------------
-- Button helper functions
--------------------------------------------------------------------------
-- Create a button at the position given
-- See the buttons definition for the format of data
function cinema_clip_editor_button_create(data, x, y)
-- Create a new vdo_button_pc based off the base
data.button = Vdo_button_pc:clone(Base_button.handle)
data.button:create(data.data)
data.button:set_anchor(x, y)
if (data.data.type == PC_TYPE_ICON) then
data.button:set_width(ICON_BUTTON_WIDTH, 0)
else
-- These widths are usually overridden, but there's no reason not to set them
if (data.data.type == PC_TYPE_NORMAL) then
data.button:set_width(150, 0)
else
data.button:set_width(200, 100)
end
end
end
-- Aligns a label-only button with the following rules:
-- The button's width is the greater of min_width and the button's label's actual width
-- The button's left side is aligned with its current anchor
function cinema_clip_editor_button_align_left(data, min_width)
local width = cinema_clip_editor_button_label_get_width(data.button, min_width)
data.button:set_width(width, 0)
data.button:move(width * 0.5, 0)
end
-- Aligns a label-only button with the following rules:
-- The buttons width is the greater of min_width and the button's label's actual width
-- The button's right side is aligned with its current anchor
function cinema_clip_editor_button_align_right(data, min_width)
local width = cinema_clip_editor_button_label_get_width(data.button, min_width)
data.button:set_width(width, 0)
data.button:move(-width * 0.5, 0)
end
-- Find the width of the button's label
function cinema_clip_editor_button_label_get_width(button, min_width)
local width = button:get_label_width()
if (min_width > width) then
width = min_width
end
return width
end
--------------------------------------------------------------------------
-- Mouse input functions
--------------------------------------------------------------------------
-- NOTE: Mouse input functions operate using CCE_buttons, and so use button_ids to pass info instead of direct references
-- Primary mouse move function (sets highlighting on/off)
function cinema_clip_editor_mouse_move(event, target_handle)
for i = 1, Num_buttons do
-- Highlight the button if I'm over it, otherwise unhighlight it
if CCE_buttons[i].button.handle == target_handle then
if CCE_buttons[i].button:is_active() and CCE_buttons[i].button:get_visible() then
CCE_buttons[i].button:mouse_move()
cinema_clip_editor_tooltip_set_text(CCE_buttons[i].button:get_tooltip())
end
else
CCE_buttons[i].button:mouse_off()
end
end
if target_handle == Button_bg.handle then
cinema_clip_editor_tooltip_set_text("")
end
cinema_clip_editor_timeline_mouse_off()
end
-- Primary mouse click function (sets highlighting and calls the button's callback function)
function cinema_clip_editor_mouse_click(event, target_handle)
for i = 1, Num_buttons do
-- Activate the button
if CCE_buttons[i].button.handle == target_handle then
if CCE_buttons[i].button:is_active() and CCE_buttons[i].button:get_visible() then
-- Pass the actual button along instead of the button_id (many callback functions do something to the button and don't care about the id)
CCE_buttons[i].callback(CCE_buttons[i].button)
CCE_buttons[i].button:mouse_click()
end
end
end
end
-- Add mouse inputs for sliders (slider box and two arrows)
function cinema_clip_editor_slider_add_extra_inputs(button, input_tracker)
-- Slider
input_tracker:add_mouse_input("mouse_click", "cinema_clip_editor_slider_mouse_click", 0, button.bar_outline.handle)
input_tracker:add_mouse_input("mouse_drag", "cinema_clip_editor_slider_mouse_drag", 0, button.bar_outline.handle)
input_tracker:add_mouse_input("mouse_drag_release", "cinema_clip_editor_slider_mouse_drag_release", 0, button.bar_outline.handle)
-- Arrows
input_tracker:add_mouse_input("mouse_click", "cinema_clip_editor_slider_left_arrow_click", 0, button.img_left.handle)
input_tracker:add_mouse_input("mouse_move", "cinema_clip_editor_slider_left_arrow_move", 0, button.img_left.handle)
input_tracker:add_mouse_input("mouse_click", "cinema_clip_editor_slider_right_arrow_click", 0, button.img_right.handle)
input_tracker:add_mouse_input("mouse_move", "cinema_clip_editor_slider_right_arrow_move", 0, button.img_right.handle)
end
-- Add mouse inputs for toggle left arrows (right arrow does the same as clicking anywhere else)
function cinema_clip_editor_toggle_add_arrow_inputs(button, input_tracker)
input_tracker:add_mouse_input("mouse_click", "cinema_clip_editor_toggle_left_arrow_click", 0, button.img_left.handle)
input_tracker:add_mouse_input("mouse_move", "cinema_clip_editor_toggle_left_arrow_move", 0, button.img_left.handle)
end
-- The following group of functions: Respond to the toggle mouse events
function cinema_clip_editor_toggle_left_arrow_click(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
-- Perform the callback function (with a negative direction)
if button_id > 0 then
CCE_buttons[button_id].callback(CCE_buttons[button_id].button, 1)
CCE_buttons[button_id].button:mouse_click()
end
end
function cinema_clip_editor_toggle_left_arrow_move(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:mouse_move()
end
end
-- The following group of functions: Respond to slider arrow mouse events
function cinema_clip_editor_slider_left_arrow_click(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:slider_arrow_click(true)
CCE_buttons[button_id].callback(CCE_buttons[button_id].button)
end
end
function cinema_clip_editor_slider_left_arrow_move(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:slider_arrow_move(true)
end
end
function cinema_clip_editor_slider_right_arrow_click(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:slider_arrow_click(false)
CCE_buttons[button_id].callback(CCE_buttons[button_id].button)
end
end
function cinema_clip_editor_slider_right_arrow_move(event, target_handle)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:slider_arrow_move(false)
end
end
-- Respond to the slider drag event
function cinema_clip_editor_slider_mouse_drag(event, target_handle, mouse_x, mouse_y)
local button_id = cinema_clip_editor_get_button_index(target_handle)
if button_id > 0 then
CCE_buttons[button_id].button:mouse_set_slider(mouse_x)
CCE_buttons[button_id].callback(CCE_buttons[button_id].button)
end
end
-- Dummy function to make the slider respond to drag events
function cinema_clip_editor_slider_mouse_click(event, target_handle)
end
-- Dummy function to make the slider respond to drag events
function cinema_clip_editor_slider_mouse_drag_release(event, target_handle, mouse_x, mouse_y)
end
-- Returns the index of the button if its arrow/slider was clicked/moved over
function cinema_clip_editor_get_button_index(target_handle)
for i = 1, Num_buttons do
if CCE_buttons[i].button.img_left.handle == target_handle or CCE_buttons[i].button.img_right.handle == target_handle or CCE_buttons[i].button.bar_outline.handle == target_handle then
-- Check if the button is active and visible
if CCE_buttons[i].button:is_active() and CCE_buttons[i].button:get_visible() then
cinema_clip_editor_all_buttons_mouse_off()
return i
end
end
end
-- If no matching target handle was found, return an invalid index
return 0
end
-- Unhighlights all buttons
function cinema_clip_editor_all_buttons_mouse_off()
for i = 1, Num_buttons do
CCE_buttons[i].button:mouse_off()
end
-- Hide the timeline marker
cinema_clip_editor_timeline_mouse_off()
end
--------------------------------------------------------------------------
-- Dialog management functions
--------------------------------------------------------------------------
-- Init a dialog
function cinema_clip_editor_dialog_init(dialog)
-- Background and text header
dialog.bg = Vdo_base_object:clone(Base_dialog_bg.handle)
dialog.text = Vdo_base_object:clone(Base_dialog_text.handle)
-- Create the buttons
for i = 1, dialog.num_buttons do
cinema_clip_editor_button_create(dialog.buttons[i])
end
-- The hide dialog button (clone, set the hide reference, then custom create it)
dialog.buttons[dialog.num_buttons + 1].button = Vdo_button_pc:clone(Base_button.handle)
dialog.hide = dialog.buttons[dialog.num_buttons + 1].button
dialog.hide:create(dialog.buttons[dialog.num_buttons + 1].data)
dialog.hide:set_icon_scale(0.5)
dialog.hide:set_width(16, 0)
-- Set the title text
dialog.text:set_text(dialog.title)
dialog.text:set_color(COLOR_DIALOG_HEADING)
if dialog.ease_buttons ~= nil then
-- This only applies to the Properties dialog
cinema_clip_editor_dialog_add_ease_buttons(dialog)
end
cinema_clip_editor_dialog_resize_and_move(dialog)
end
-- Move and resize the dialog (using its internal data)
function cinema_clip_editor_dialog_resize_and_move(dialog)
cinema_clip_editor_dialog_set_min_width(dialog, dialog.width, dialog.value_width)
dialog.bg:set_actual_size(dialog.width, dialog.num_buttons * DIALOG_SPACING + dialog.num_headings * DIALOG_HEADER + 32)
cinema_clip_editor_dialog_move(dialog, false)
end
-- Quickly set the title and hint button text, then resize the dialog
-- Used only for special dialogs (aka DLG_CANCEL)
function cinema_clip_editor_dialog_quick_set_and_resize(dialog, text_title, text_button, width)
dialog.width = width
dialog.text:set_text(text_title)
-- This will make sure the dialog bg is wide enough (though probably unnecessary)
dialog.buttons[1].button:set_label("ESC_"..text_button)
dialog.text:set_scale(0.35, 0.35)
cinema_clip_editor_dialog_resize_and_move(dialog)
-- Now make the first adjustments to force this to show the hint_bar instead
local hint_data = { {CTRL_MENU_BUTTON_B, text_button},}
Hint_bar:set_hints(hint_data)
local w, h = Hint_bar:get_size()
local x = dialog.x_pos - w * 0.5
Hint_bar:set_anchor(x, DIALOG_TOP + DIALOG_BUTTON_OFFSET + 26)
Hint_bar:set_visible(true)
end
-- Add a heading to a dialog
-- space = which button # to appear above
function cinema_clip_editor_dialog_add_heading(dialog, space, txt)
dialog.num_headings = dialog.num_headings + 1
dialog.spacers[dialog.num_headings] = space
dialog.headings[dialog.num_headings] = Vdo_base_object:clone(Base_dialog_text.handle)
dialog.headings[dialog.num_headings]:set_text(txt)
dialog.headings[dialog.num_headings]:set_color(COLOR_DIALOG_HEADING)
end
-- Move the dialog to the position stored in dialog.x_pos (and sets button sizes)
-- Does NOT constrain the x_pos
function cinema_clip_editor_dialog_move(dialog, offscreen)
local dialog_top = DIALOG_TOP
-- Maybe move the dialog offscreen (so it doesn't interfere with the mouse)
if offscreen == true then
dialog_top = 720
end
-- If the dialog has ease_buttons and they are set, then move those
if dialog.ease_buttons ~= nil then
cinema_clip_editor_dialog_move_ease_buttons(dialog, dialog_top)
end
-- Move the basic dialog elements
dialog.text:set_anchor(dialog.x_pos, dialog_top + DIALOG_TITLE_OFFSET)
dialog.bg:set_anchor(dialog.x_pos, dialog_top)
dialog.hide:set_anchor(dialog.x_pos + (dialog.width * 0.5) - 13, dialog_top + 13)
-- Move the headings and buttons
local heading_count = 0
for i = 1, dialog.num_buttons do
-- If there's a next heading, see if it should be inserted here
if (dialog.num_headings > heading_count) then
if (i == dialog.spacers[heading_count + 1]) then
-- Set the anchor for this heading
dialog.headings[heading_count + 1]:set_anchor(dialog.x_pos, dialog_top + i * DIALOG_SPACING + heading_count * DIALOG_HEADER + 13)
-- Increment the count, so that all future headings/buttons are offset
heading_count = heading_count + 1
end
end
-- Now set the next button
-- Determine the value width
local w = dialog.value_width
if (dialog.buttons[i].data.type == PC_TYPE_NORMAL) then
w = 0
end
-- Set the button width
dialog.buttons[i].button:set_width(dialog.width - DIALOG_SIDE_BUFFER, w)
-- Set the button position
dialog.buttons[i].button:set_anchor(dialog.x_pos, dialog_top + i * DIALOG_SPACING + heading_count * DIALOG_HEADER + DIALOG_BUTTON_OFFSET)
end -- for
end
-- Sets the widths (total and value) of the dialog
function cinema_clip_editor_dialog_set_min_width(dialog, total_min_width, value_min_width)
-- First find the minimums for the button label and value text fields
local min_label = 0
local min_value = 0
local has_arrows = false -- Set to true if any buttons have L/R arrows, so width will be padded later
-- Find button minimum widths
for i = 1, dialog.num_buttons do
-- Save a reference to this button so the following code is more readable
local btn = dialog.buttons[i]
local w = btn.button:get_label_width()
if (w > min_label) then
min_label = w
end
-- For toggle buttons:
-- Set each value and measure the results
if btn.data.type == PC_TYPE_TOGGLE then
has_arrows = true
for j = 1, #btn.data.options do
btn.button:set_value(btn.data.options[j])
w = btn.button:get_value_width()
if (w > min_value) then
min_value = w
end
end
-- Set the label back to default value
btn.button:set_value(btn.data.options[btn.data.o_index])
else
-- Otherwise just ask for a width
w = btn.button:get_value_width()
if (w > min_value) then
min_value = w
end
if btn.data.type == PC_TYPE_SLIDER then
has_arrows = true
end
end
end
-- Set the value width
if (value_min_width > min_value) then
min_value = value_min_width
end
dialog.value_width = min_value
-- Total width based on buttons
local total = min_value + min_label + DIALOG_SIDE_BUFFER
if has_arrows == true then
local arrow_width = Base_button:get_arrow_double_width()
total = total + arrow_width
end
-- Now measure the headings (title and other)
local min_heading = dialog.text:get_actual_size() + 3 + 50 -- Add a little padding + extra for the close button
for i = 1, dialog.num_headings do
local w = dialog.headings[i]:get_actual_size() + 3
if (w > min_heading) then
min_heading = w
end
end
-- Enlarge for title/headings in dialog if necessary
if (min_heading > total) then
total = min_heading
end
-- Set the total width
if (total_min_width > total) then
total = total_min_width
end
dialog.width = total
end
-- Hides all elements of the dialog
function cinema_clip_editor_dialog_hide(dialog)
cinema_clip_editor_dialog_move(dialog, true)
dialog.bg:set_visible(false)
dialog.text:set_visible(false)
dialog.hide:set_visible(false)
for i = 1, dialog.num_headings do
dialog.headings[i]:set_visible(false)
end
for i = 1, dialog.num_buttons do
dialog.buttons[i].button:set_visible(false)
end
dialog.visible = false
end
-- Shows all elements of the dialog
function cinema_clip_editor_dialog_show(dialog)
-- Hide all other dialogs
for i = 1, #CCE_dialogs do
if dialog ~= CCE_dialogs[i] then
cinema_clip_editor_dialog_hide(CCE_dialogs[i])
end
end
cinema_clip_editor_dialog_move(dialog, false)
dialog.bg:set_visible(true)
dialog.text:set_visible(true)
dialog.hide:set_visible(true)
for i = 1, dialog.num_headings do
dialog.headings[i]:set_visible(true)
end
for i = 1, dialog.num_buttons do
dialog.buttons[i].button:set_visible(true)
end
dialog.visible = true
end
function cinema_clip_editor_dialog_hide_all()
for i = 1, #CCE_dialogs do
cinema_clip_editor_dialog_hide(CCE_dialogs[i])
end
end
-- Add ease buttons to the dialog
function cinema_clip_editor_dialog_add_ease_buttons(dialog, button_offset)
-- Create the buttons
for i = 1, #dialog.ease_lines do
cinema_clip_editor_button_create(dialog.ease_buttons[i], 0, 0)
-- Set special icon parameters
dialog.ease_buttons[i].button:set_icon_mid()
dialog.ease_buttons[i].button:set_width(24, 0)
-- Hide the button by default
dialog.ease_buttons[i].button:set_visible(false)
end
cinema_clip_editor_dialog_move_ease_buttons(dialog, DIALOG_TOP)
end
-- Move/resize the ease buttons
function cinema_clip_editor_dialog_move_ease_buttons(dialog, dialog_top)
for i = 1, #dialog.ease_lines do
-- Get the info about how to align the buttons
local line = dialog.ease_lines[i]
local heading_count = dialog.ease_headers[i]
-- Set the button position
dialog.ease_buttons[i].button:set_anchor(dialog.x_pos + dialog.width * 0.5 + 14, dialog_top + line * DIALOG_SPACING + heading_count * DIALOG_HEADER + DIALOG_BUTTON_OFFSET)
end
end
function cinema_clip_editor_dialog_camera_zone_slide(x)
cinema_clip_editor_dialog_slide(CCE_dialogs[DLG_CAMERA_ZONE], x)
cinema_clip_editor_dialog_slide(CCE_dialogs[DLG_PROP], x)
if CCE_dialogs[DLG_CAMERA_ZONE].visible == false and CCE_dialogs[DLG_PROP].visible == false then
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_CAMERA_ZONE])
end
if CCE_option_beginner_mode == true then
if cinema_clip_editor_zone_active() ~= cinema_clip_editor_zone_highlight() then
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_CAMERA_ZONE])
end
end
cinema_clip_editor_dialog_move(CCE_dialogs[DLG_CAMERA_ZONE], not CCE_dialogs[DLG_CAMERA_ZONE].visible)
cinema_clip_editor_dialog_move(CCE_dialogs[DLG_PROP], not CCE_dialogs[DLG_PROP].visible)
cinema_clip_editor_prop_update_dialog_general()
end
function cinema_clip_editor_dialog_slide(dialog, x)
local new_x = x
new_x = max(new_x, dialog.width * 0.5 + DIALOG_SIDE_BUFFER * 4)
new_x = min(new_x, 1280 - dialog.width * 0.5 - DIALOG_SIDE_BUFFER * 4)
dialog.x_pos = new_x
end
--------------------------------------------------------------------------
-- Button actions (callback functions)
--------------------------------------------------------------------------
-- Callback functions for buttons (top and bottom row)
function cinema_clip_editor_cb_rewind(click_button)
-- Actually rewind, since we didn't go back
vint_dataresponder_post("cinema_editor_dr", "Rewind")
-- Reset the play/pause buttons
vint_dataresponder_post("cinema_editor_dr", "Pause")
cinema_clip_editor_cb_pause(CCE_free_buttons[BTN_FREE_PAUSE].button)
Rewinding = true
Playback_disabled = false
--[[Confirm_popup:populate_list(CONFIRM_CHOICES_REWIND, 1, CONFIRM_LIST_SIZE, 2)
Confirm_popup:set_title("REWIND WARNING")
Confirm_popup:set_text("A LOADING SCREEN WILL APPEAR WHILE REWINDING")
Confirm_popup:nav_enable(true, "cinema_clip_editor_rewind_final", "cinema_clip_editor_confirm_nav")
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(.5)
Mouse_input_tracker:subscribe(false)]]--
end
--[[function cinema_clip_editor_rewind_final(event)
if event == "back" then
return
end
Confirm_popup:nav_enable(false, nil, nil)
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(1.0)
Mouse_input_tracker:subscribe(true)
-- Did we select NO? This assumes YES is the first item, NO the second
if Confirm_popup:get_selected_data() ~= 1 then
return
end
Rewinding = true
Playback_disabled = false
-- Actually rewind, since we didn't go back
vint_dataresponder_post("cinema_editor_dr", "Rewind")
-- Reset the play/pause buttons
cinema_clip_editor_cb_pause(CCE_free_buttons[BTN_FREE_PAUSE].button)
end]]--
function cinema_clip_editor_cb_play_slow(click_button)
vint_dataresponder_post("cinema_editor_dr", "Play", 0.25)
cinema_clip_editor_playback_buttons(true)
CCE_free_buttons[BTN_FREE_PLAY_SLOW].button:set_inactive()
CCE_free_buttons[BTN_FREE_PAUSE].button:set_active()
Rewinding = false
end
function cinema_clip_editor_cb_play(click_button)
vint_dataresponder_post("cinema_editor_dr", "Play", 1.0)
cinema_clip_editor_playback_buttons(true)
CCE_free_buttons[BTN_FREE_PLAY].button:set_inactive()
CCE_free_buttons[BTN_FREE_PAUSE].button:set_active()
Rewinding = false
end
function cinema_clip_editor_cb_play_fast(click_button)
vint_dataresponder_post("cinema_editor_dr", "Play", 4.0)
cinema_clip_editor_playback_buttons(true)
CCE_free_buttons[BTN_FREE_PLAY_FAST].button:set_inactive()
CCE_free_buttons[BTN_FREE_PAUSE].button:set_active()
Rewinding = false
end
function cinema_clip_editor_cb_pause(click_button)
vint_dataresponder_post("cinema_editor_dr", "Pause")
click_button:set_inactive()
cinema_clip_editor_playback_buttons(true)
end
-- Set the state of the playback buttons
function cinema_clip_editor_playback_buttons(active)
if active then
CCE_free_buttons[BTN_FREE_PLAY_SLOW].button:set_active()
CCE_free_buttons[BTN_FREE_PLAY].button:set_active()
CCE_free_buttons[BTN_FREE_PLAY_FAST].button:set_active()
else
CCE_free_buttons[BTN_FREE_PLAY_SLOW].button:set_inactive()
CCE_free_buttons[BTN_FREE_PLAY].button:set_inactive()
CCE_free_buttons[BTN_FREE_PLAY_FAST].button:set_inactive()
end
end
function cinema_clip_editor_cb_options(click_button)
cinema_clip_editor_options_dialog_fill_data()
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_OPTIONS])
end
function cinema_clip_editor_cb_av(click_button)
cinema_clip_editor_av_dialog_fill_data()
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_AV])
end
function cinema_clip_editor_cb_save(click_button)
game_vkeyboard_input("SAVE_CLIP", "SAVE_CLIP_NAME", 64, "SAVE_CLIP", "cce_cb_save_confirm", true)
vint_dataresponder_post("cinema_editor_dr", "Save")
end
function cce_cb_save_confirm(success)
if success == true then
cinema_editor_save_clip("VKEYBOARD_RESULTS")
end
end
-- TODO: Move this elsewhere and make it show via code (data item?)
--Export_lock = not Export_lock
--cinema_clip_editor_exporting_set_locked(Export_popup, Export_lock)
--Export_visible = not Export_visible
--cinema_clip_editor_exporting_set_visibility(Export_popup, Export_visible)
function cinema_clip_editor_cb_export(click_button)
Confirm_popup:populate_list(CONFIRM_CHOICES_EXPORT, 1, CONFIRM_LIST_SIZE, 2)
Confirm_popup:set_title("PC_CONFIRM_EXPORT")
Confirm_popup:set_text("PC_EXPORT_EXPLANATION")
Confirm_popup:nav_enable(true, "cinema_clip_editor_export_final", "cinema_clip_editor_confirm_nav")
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(.5)
Mouse_input_tracker:subscribe(false)
end
-- Confirm or back out of exiting
function cinema_clip_editor_export_final(event)
-- No keyboard/gamepad processing, so ignore BACK
if event == "back" then
return
end
Confirm_popup:nav_enable(false, nil, nil)
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(1.0)
Mouse_input_tracker:subscribe(true)
-- Did we select NO? This assumes YES is the first item, NO the second
if Confirm_popup:get_selected_data() ~= 1 then
return
end
-- Actually exit, since we didn't go back
vint_dataresponder_post("cinema_editor_dr", "Export")
end
function cinema_clip_editor_cb_exit(click_button)
Confirm_popup:populate_list(CONFIRM_CHOICES_EXIT, 1, CONFIRM_LIST_SIZE, 2)
Confirm_popup:set_title("PC_CONFIRM_EXIT")
Confirm_popup:set_text("PC_EXIT_EXPLANATION")
Confirm_popup:nav_enable(true, "cinema_clip_editor_exit_final", "cinema_clip_editor_confirm_nav")
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(.5)
--cinema_clip_editor_dialog_hide_all()
Mouse_input_tracker:subscribe(false)
end
-- Confirm or back out of exiting
function cinema_clip_editor_exit_final(event)
-- No keyboard/gamepad processing, so ignore BACK
if event == "back" then
return
end
Confirm_popup:nav_enable(false, nil, nil)
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(1.0)
Mouse_input_tracker:subscribe(true)
-- Did we select NO? This assumes YES is the first item, NO the second
if Confirm_popup:get_selected_data() ~= 1 then
return
end
-- Actually exit, since we didn't go back
vint_dataresponder_post("cinema_editor_dr", "Quit")
end
function cinema_clip_editor_cb_show_keys(click_button)
cinema_clip_editor_keys_toggle_visibility(Keys_popup)
if (Keys_popup.visible) then
click_button:set_label("PC_HIDE_KEYS")
else
click_button:set_label("PC_SHOW_KEYS")
end
end
function cinema_clip_editor_cb_toggle_hud(visible)
-- Hide everything
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_visible(visible)
end
function cinema_clip_editor_cb_hide_hud(click_button)
-- Hide everything
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
--everything:set_visible(false)
everything:set_alpha(0.4)
-- Show the show hud button (and highlight it)
CCE_buttons[BTN_FREE_SHOW_HUD].button:set_visible(true)
if vint_is_std_res() then
CCE_buttons[BTN_FREE_SHOW_HUD].button:set_anchor((BTN_POS_RIGHT - 75) * 0.66667, BTN_POS_BOTTOM * 0.66667)
else
CCE_buttons[BTN_FREE_SHOW_HUD].button:set_anchor(BTN_POS_RIGHT - 75, BTN_POS_BOTTOM)
end
CCE_buttons[BTN_FREE_SHOW_HUD].button:mouse_move()
end
function cinema_clip_editor_cb_show_hud(click_button)
-- Show everything
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
--everything:set_visible(true)
everything:set_alpha(1.0)
-- Hide the show hud button
CCE_buttons[BTN_FREE_SHOW_HUD].button:set_visible(false)
CCE_buttons[BTN_FREE_SHOW_HUD].button:set_anchor(BTN_POS_RIGHT, BTN_POS_BOTTOM + 720)
-- Highlight the Hide HUD button
CCE_buttons[BTN_FREE_HIDE_HUD].button:mouse_move()
end
-- Callback functions for buttons (camera zone dialog)
function cinema_clip_editor_cb_cz_edit_properties(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_CAMERA_ZONE])
local current_zone = cinema_clip_editor_zone_get_current()
cinema_clip_editor_prop_dialog_fill_data(current_zone)
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_PROP])
end
function cinema_clip_editor_cb_cz_copy_current(click_button)
cinema_clip_editor_zone_insert(Marker_time_timeline, true)
end
function cinema_clip_editor_cb_cz_copy_next(click_button)
cinema_clip_editor_zone_insert(Marker_time_timeline, false)
end
function cinema_clip_editor_cb_cz_delete(click_button)
cinema_clip_editor_zone_delete_current()
end
function cinema_clip_editor_cb_cz_hide(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_CAMERA_ZONE])
CCE_free_buttons[BTN_FREE_REWIND].button:set_active()
end
-- Callback functions for buttons (options dialog)
function cinema_clip_editor_cb_opt_advanced(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
if click_button:get_option_index() == 1 then
CCE_option_beginner_mode = true
else
CCE_option_beginner_mode = false
end
end
function cinema_clip_editor_cb_opt_rotation_sens(click_button)
local sens_move = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_MOVEMENT].button.s_value
local sens_rot = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_ROTATION].button.s_value
vint_dataresponder_post("cinema_editor_dr", "set_sensitivity", sens_move / 100, sens_rot / 100)
end
function cinema_clip_editor_cb_opt_movement_sens(click_button)
local sens_move = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_MOVEMENT].button.s_value
local sens_rot = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_ROTATION].button.s_value
vint_dataresponder_post("cinema_editor_dr", "set_sensitivity", sens_move / 100, sens_rot / 100)
end
-- These options don't work currently
--[[function cinema_clip_editor_cb_opt_show_output(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local output_only = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_OUTPUT].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Show_output_only", output_only)
end
function cinema_clip_editor_cb_opt_watermark(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local watermark = CCE_dialogs[DLG_OPTIONS].buttons[BTN_OPT_WATERMARK].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Watermark", watermark)
end
function cinema_clip_editor_cb_opt_create_import(click_button)
-- TODO: Hook this up to code (or remove it)
end
function cinema_clip_editor_cb_opt_load_default(click_button)
-- TODO: Hook this up to code (or remove it)
end]]
function cinema_clip_editor_cb_opt_hide(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_OPTIONS])
CCE_free_buttons[BTN_FREE_OPTIONS].button:set_active()
end
-- Callback functions for buttons (AV dialog)
function cinema_clip_editor_cb_av_time_of_day(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local tod_preset = CCE_dialogs[DLG_AV].buttons[BTN_AV_TIME_OF_DAY].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Time_of_day", tod_preset)
end
function cinema_clip_editor_cb_av_weather(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local weather_preset = CCE_dialogs[DLG_AV].buttons[BTN_AV_WEATHER].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Weather", weather_preset)
end
function cinema_clip_editor_cb_av_background(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
cinema_clip_editor_greenscreen_data_post()
end
function cinema_clip_editor_cb_av_vehicles(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
cinema_clip_editor_greenscreen_data_post()
end
function cinema_clip_editor_cb_av_people(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
cinema_clip_editor_greenscreen_data_post()
end
function cinema_clip_editor_cb_av_player(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
cinema_clip_editor_greenscreen_data_post()
end
function cinema_clip_editor_cb_av_sound_fx(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local sfx = CCE_dialogs[DLG_AV].buttons[BTN_AV_SOUND_FX].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "SoundFX", sfx)
end
function cinema_clip_editor_cb_av_voice(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local voice = CCE_dialogs[DLG_AV].buttons[BTN_AV_VOICE].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Voice", voice)
end
function cinema_clip_editor_greenscreen_data_post()
local gs_background = CCE_dialogs[DLG_AV].buttons[BTN_AV_BACKGROUND].button:get_option_index() - 1
local gs_vehicles = CCE_dialogs[DLG_AV].buttons[BTN_AV_VEHICLES].button:get_option_index() - 1
local gs_npc = CCE_dialogs[DLG_AV].buttons[BTN_AV_PEOPLE].button:get_option_index() - 1
local gs_player = CCE_dialogs[DLG_AV].buttons[BTN_AV_PLAYER].button:get_option_index() - 1
vint_dataresponder_post("cinema_editor_dr", "Greenscreen", gs_background, gs_vehicles, gs_npc, gs_player)
end
function cinema_clip_editor_cb_av_hide(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_AV])
CCE_free_buttons[BTN_FREE_AV].button:set_active()
end
-- Callback functions for buttons (Properties dialog)
function cinema_clip_editor_cb_prop_zone_type(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local zone = cinema_clip_editor_zone_get_current()
zone.zone_type = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_ZONE_TYPE].button:get_option_index() - 1
vint_dataresponder_post("camera_zone_dr", "set_type", zone.UID, zone.zone_type)
local previous_zone = cinema_clip_editor_zone_get_previous()
if previous_zone ~= nil then
cinema_clip_editor_zone_update_blend_next()
cinema_clip_editor_zone_update_visuals(previous_zone)
end
cinema_clip_editor_zone_update_all()
cinema_clip_editor_prop_dialog_fill_data(zone)
end
function cinema_clip_editor_cb_prop_export_lock(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local zone = cinema_clip_editor_zone_get_current()
zone.export_lock = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_EXPORT_LOCK].button:get_option_index() - 1
vint_dataresponder_post("camera_zone_dr", "set_export_lock", zone.UID, zone.export_lock)
cinema_clip_editor_zone_update_visuals(zone)
cinema_clip_editor_zone_update_all()
end
function cinema_clip_editor_cb_prop_follow_mode(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local zone = cinema_clip_editor_zone_get_current()
zone.camera_mode = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_FOLLOW].button:get_option_index() - 1
vint_dataresponder_post("camera_zone_dr", "set_mode", zone.UID, zone.camera_mode)
vint_dataresponder_post("camera_zone_dr", "Acquire_transform", zone.UID)
cinema_clip_editor_zone_update_all()
cinema_clip_editor_prop_update_dialog_general()
end
function cinema_clip_editor_cb_prop_pos_camera(click_button)
if cinema_clip_editor_zone_active() ~= cinema_clip_editor_zone_highlight() then
Confirm_popup:populate_list(CONFIRM_CHOICES_CAMERA, 1, CONFIRM_LIST_SIZE, 2)
Confirm_popup:set_title("PC_EDIT_WARNING")
Confirm_popup:set_text("PC_EDIT_EXPLANATION")
Confirm_popup:nav_enable(true, "cinema_clip_editor_pos_camera_final", "cinema_clip_editor_confirm_nav")
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(.5)
Mouse_input_tracker:subscribe(false)
else
cinema_clip_editor_pos_camera_go()
end
end
-- Callback for checking if the user really wants to edit a non-active zone
function cinema_clip_editor_pos_camera_final(event)
if event == "back" then
return
end
Confirm_popup:nav_enable(false, nil, nil)
local everything = Vdo_base_object:new("screen_grp", 0, Cinema_clip_editor_doc_handle)
everything:set_alpha(1.0)
Mouse_input_tracker:subscribe(true)
-- Did we select NO? This assumes YES is the first item, NO the second
if Confirm_popup:get_selected_data() ~= 1 then
return
end
-- Actually position the camera, since we didn't go back
cinema_clip_editor_pos_camera_go()
end
-- Close the current dialog and start moving the camera
function cinema_clip_editor_pos_camera_go()
cinema_clip_editor_dialog_quick_set_and_resize(CCE_dialogs[DLG_CANCEL], "PC_POSITION_CAMERA", "PC_CAMERA_DONE", 100)
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_CANCEL])
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_PROP])
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_CAMERA_ZONE])
CCE_dialogs[DLG_CANCEL].buttons[1].button:set_visible(false)
vint_dataresponder_post("cinema_editor_dr", "control_mode", 1)
Acquire_something = true
Acquire_target = false
end
function cinema_clip_editor_cb_prop_target(click_button, dir, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
-- TODO: Change this to a filter, or remove it
end
function cinema_clip_editor_cb_prop_choose_target(click_button)
cinema_clip_editor_dialog_quick_set_and_resize(CCE_dialogs[DLG_CANCEL], "PC_SELECT_TARGET", "PC_CAMERA_DONE", 100)
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_CANCEL])
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_PROP])
CCE_dialogs[DLG_CANCEL].buttons[1].button:set_visible(false)
vint_dataresponder_post("cinema_editor_dr", "control_mode", 1)
Acquire_something = true
Acquire_target = true
end
function cinema_clip_editor_cb_prop_field_of_view(click_button)
local zone = cinema_clip_editor_zone_get_current()
zone.fov = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_FOV].button.s_value
vint_dataresponder_post("camera_zone_dr", "set_fov", zone.UID, zone.fov, zone.fov_blend)
end
function cinema_clip_editor_cb_prop_camera_tilt(click_button)
local zone = cinema_clip_editor_zone_get_current()
zone.tilt = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_TILT].button.s_value
vint_dataresponder_post("camera_zone_dr", "set_tilt", zone.UID, zone.tilt, zone.tilt_blend)
end
function cinema_clip_editor_cb_prop_handycam(click_button)
local zone = cinema_clip_editor_zone_get_current()
zone.handycam = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_HANDYCAM].button.s_value
vint_dataresponder_post("camera_zone_dr", "set_handycam", zone.UID, zone.handycam, zone.handycam_blend)
end
function cinema_clip_editor_cb_prop_slow_mo(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local zone = cinema_clip_editor_zone_get_current()
zone.slow_mo = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_SLOW_MO].button:get_option_index() - 1
vint_dataresponder_post("camera_zone_dr", "set_slow_motion", zone.UID, zone.slow_mo)
cinema_clip_editor_zone_update_all()
end
function cinema_clip_editor_cb_prop_depth_of_field(click_button, dir)
local direction = dir or 0
click_button:toggle_dir(direction)
local zone = cinema_clip_editor_zone_get_current()
zone.dof_mode = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_DOF].button:get_option_index() - 1
vint_dataresponder_post("camera_zone_dr", "set_dof_params", zone.UID, zone.dof_mode, zone.dof_dist, zone.dof_dist_blend, zone.dof_focal, zone.dof_focal_blend)
cinema_clip_editor_zone_update_all()
cinema_clip_editor_prop_update_dialog_general()
end
function cinema_clip_editor_cb_prop_dof_distance(click_button)
local zone = cinema_clip_editor_zone_get_current()
zone.dof_dist = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_DOF_DIST].button.s_value
vint_dataresponder_post("camera_zone_dr", "set_dof_params", zone.UID, zone.dof_mode, zone.dof_dist, zone.dof_dist_blend, zone.dof_focal, zone.dof_focal_blend)
end
function cinema_clip_editor_cb_prop_dof_focal_range(click_button)
local zone = cinema_clip_editor_zone_get_current()
zone.dof_focal = CCE_dialogs[DLG_PROP].buttons[BTN_PROP_DOF_FOCAL].button.s_value
vint_dataresponder_post("camera_zone_dr", "set_dof_params", zone.UID, zone.dof_mode, zone.dof_dist, zone.dof_dist_blend, zone.dof_focal, zone.dof_focal_blend)
end
function cinema_clip_editor_cb_prop_hide(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_PROP])
cinema_clip_editor_dialog_show(CCE_dialogs[DLG_CAMERA_ZONE])
end
-- Callback functions for buttons (Blend buttons on the Properties dialog)
function cinema_clip_editor_cb_blend_cam_position(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.camera_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_POSITION].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_transform_blend", zone.UID, zone.camera_blend)
end
function cinema_clip_editor_cb_blend_dof_distance(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.dof_dist_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_DOF_DIST].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_dof_params", zone.UID, zone.dof_mode, zone.dof_dist, zone.dof_dist_blend, zone.dof_focal, zone.dof_focal_blend)
end
function cinema_clip_editor_cb_blend_dof_focal_range(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.dof_focal_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_DOF_FOCAL].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_dof_params", zone.UID, zone.dof_mode, zone.dof_dist, zone.dof_dist_blend, zone.dof_focal, zone.dof_focal_blend)
end
function cinema_clip_editor_cb_blend_fov(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.fov_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_FOV].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_fov", zone.UID, zone.fov, zone.fov_blend)
end
function cinema_clip_editor_cb_blend_cam_tilt(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.tilt_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_TILT].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_tilt", zone.UID, zone.tilt, zone.tilt_blend)
end
function cinema_clip_editor_cb_blend_handycam(click_button)
click_button:toggle_ease()
local zone = cinema_clip_editor_zone_get_current()
zone.handycam_blend = CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_FOV].button.icon_num - PC_ICON_EASE_NONE
vint_dataresponder_post("camera_zone_dr", "set_handycam", zone.UID, zone.handycam, zone.handycam_blend)
end
-- Utility functions for the properties dialog
-- Update stuff that enables/disables/hides other parts of the dialog
function cinema_clip_editor_prop_update_dialog_general()
-- Turn everything on by default, hide ease buttons by default
-- Enable and hide the ease buttons
for i = 1, #CCE_dialogs[DLG_PROP].ease_buttons do
CCE_dialogs[DLG_PROP].ease_buttons[i].button:set_visible(false)
CCE_dialogs[DLG_PROP].ease_buttons[i].button:set_active()
end
-- Enable properties dialog buttons
for i = 1, CCE_dialogs[DLG_PROP].num_buttons do
CCE_dialogs[DLG_PROP].buttons[i].button:set_active()
end
-- Enable the camera zone dialog buttons
for i = 1, CCE_dialogs[DLG_CAMERA_ZONE].num_buttons do
CCE_dialogs[DLG_CAMERA_ZONE].buttons[i].button:set_active()
end
-- Get the zone (keep in mind all zone data is 0-based, not 1-based)
local zone = cinema_clip_editor_zone_get_current()
local no_editing = false
-- If beginner mode is on, don't allow editing of non-active zones
if CCE_option_beginner_mode == true then
if cinema_clip_editor_zone_highlight() ~= cinema_clip_editor_zone_active() then
no_editing = true
end
end
if zone ~= nil then
-- Depth of field sliders - disable if DOF is off
if zone.dof_mode == 0 then -- 0 = OFF
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_DOF_DIST].button:set_inactive()
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_DOF_FOCAL].button:set_inactive()
CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_DOF_DIST].button:set_inactive()
CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_DOF_FOCAL].button:set_inactive()
end
-- Blending on disables some buttons, unhides ease buttons
if zone.zone_type == 1 then -- 1 = BLEND
cinema_clip_editor_prop_update_dialog_zone_blend()
end
-- Camera_mode disables some buttons for certain types
if zone.camera_mode == 0 then -- { "DEFAULT", "STATIC", "FOLLOW", "FOLLOW LOOK", "FOLLOW WATCH", "TRACKING" }
CCE_dialogs[DLG_CAMERA_ZONE].buttons[BTN_CZ_POS_CAMERA].button:set_inactive()
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_POS_CAMERA].button:set_inactive()
CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_POSITION].button:set_inactive()
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_SELECT_TARGET].button:set_inactive()
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_TILT].button:set_inactive()
CCE_dialogs[DLG_PROP].ease_buttons[BTN_EASE_TILT].button:set_inactive()
elseif zone.camera_mode == 1 then
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_SELECT_TARGET].button:set_inactive()
end
-- If this is the first zone, disable type
if zone.index == 1 then
CCE_dialogs[DLG_PROP].buttons[BTN_PROP_ZONE_TYPE].button:set_inactive()
end
-- If it's the last zone, disable copy next
if Num_zones == zone.index then
CCE_dialogs[DLG_CAMERA_ZONE].buttons[BTN_CZ_COPY_NEXT].button:set_inactive()
end
if no_editing == true then
CCE_dialogs[DLG_CAMERA_ZONE].buttons[BTN_CZ_POS_CAMERA].button:set_inactive()
CCE_dialogs[DLG_CAMERA_ZONE].buttons[BTN_CZ_EDIT_PROPERTIES].button:set_inactive()
end
end
end
-- Update the properties dialog when the ZONE TYPE is set to BLEND
function cinema_clip_editor_prop_update_dialog_zone_blend()
-- Unhide the ease buttons
for i = 1, #CCE_dialogs[DLG_PROP].ease_buttons do
CCE_dialogs[DLG_PROP].ease_buttons[i].button:set_visible(true)
end
-- Disable the buttons without ease buttons
for i = BTN_PROP_EXPORT_LOCK, BTN_PROP_SELECT_TARGET do
CCE_dialogs[DLG_PROP].buttons[i].button:set_inactive()
end
for i = BTN_PROP_SLOW_MO, BTN_PROP_DOF do
CCE_dialogs[DLG_PROP].buttons[i].button:set_inactive()
end
end
-- Callback function for button (Cancel dialog)
function cinema_clip_editor_cb_cancel(click_button)
cinema_clip_editor_dialog_hide(CCE_dialogs[DLG_CANCEL])
Hint_bar:set_visible(false)
local zone = cinema_clip_editor_zone_get_current()
vint_dataresponder_post("cinema_editor_dr", "control_mode", 0)
if Acquire_target then
vint_dataresponder_post("camera_zone_dr", "set_target", zone.UID)
else
vint_dataresponder_post("camera_zone_dr", "Acquire_transform", zone.UID)
end
Acquire_something = false
end
-- Fill the zone properties dialog with data from the zone
function cinema_clip_editor_prop_dialog_fill_data(zone)
if zone ~= nil then
local dialog = CCE_dialogs[DLG_PROP]
-- Toggle properties
dialog.buttons[BTN_PROP_ZONE_TYPE].button:set_option_index(zone.zone_type + 1)
dialog.buttons[BTN_PROP_EXPORT_LOCK].button:set_option_index(zone.export_lock + 1)
dialog.buttons[BTN_PROP_FOLLOW].button:set_option_index(zone.camera_mode + 1)
dialog.buttons[BTN_PROP_SLOW_MO].button:set_option_index(zone.slow_mo + 1)
dialog.buttons[BTN_PROP_DOF].button:set_option_index(zone.dof_mode + 1)
-- Slider properties
dialog.buttons[BTN_PROP_FOV].button:set_slider_value(zone.fov)
dialog.buttons[BTN_PROP_TILT].button:set_slider_value(zone.tilt)
dialog.buttons[BTN_PROP_HANDYCAM].button:set_slider_value(zone.handycam)
dialog.buttons[BTN_PROP_DOF_DIST].button:set_slider_value(zone.dof_dist)
dialog.buttons[BTN_PROP_DOF_FOCAL].button:set_slider_value(zone.dof_focal)
-- Ease properties
dialog.ease_buttons[BTN_EASE_POSITION].button:set_icon(PC_ICON_EASE_NONE + zone.camera_blend)
dialog.ease_buttons[BTN_EASE_FOV].button:set_icon(PC_ICON_EASE_NONE + zone.fov_blend)
dialog.ease_buttons[BTN_EASE_TILT].button:set_icon(PC_ICON_EASE_NONE + zone.tilt_blend)
dialog.ease_buttons[BTN_EASE_HANDYCAM].button:set_icon(PC_ICON_EASE_NONE + zone.handycam_blend)
dialog.ease_buttons[BTN_EASE_DOF_DIST].button:set_icon(PC_ICON_EASE_NONE + zone.dof_dist_blend)
dialog.ease_buttons[BTN_EASE_DOF_FOCAL].button:set_icon(PC_ICON_EASE_NONE + zone.dof_focal_blend)
end
cinema_clip_editor_prop_update_dialog_general()
end
function cinema_clip_editor_options_dialog_fill_data()
vint_dataresponder_request("cinema_editor_dr", "cinema_clip_editor_update_options", 0)
end
function cinema_clip_editor_av_dialog_fill_data()
vint_dataresponder_request("cinema_editor_dr", "cinema_clip_editor_update_options", 0)
end
function cinema_clip_editor_update_options(output_only, watermark, tod, weather, gs_background, gs_vehicle, gs_npc, gs_player, sfx, voice, clip_time)
local dialog = CCE_dialogs[DLG_OPTIONS]
-- TODO: Add other options as they are added in code
--dialog.buttons[BTN_OPT_OUTPUT].button:set_option_index(output_only + 1)
--dialog.buttons[BTN_OPT_WATERMARK].button:set_option_index(watermark + 1)
dialog = CCE_dialogs[DLG_AV]
dialog.buttons[BTN_AV_TIME_OF_DAY].button:set_option_index(tod + 1)
dialog.buttons[BTN_AV_WEATHER].button:set_option_index(weather + 1)
dialog.buttons[BTN_AV_BACKGROUND].button:set_option_index(gs_background + 1)
dialog.buttons[BTN_AV_VEHICLES].button:set_option_index(gs_vehicle + 1)
dialog.buttons[BTN_AV_PEOPLE].button:set_option_index(gs_npc + 1)
dialog.buttons[BTN_AV_PLAYER].button:set_option_index(gs_player + 1)
dialog.buttons[BTN_AV_SOUND_FX].button:set_option_index(sfx + 1)
dialog.buttons[BTN_AV_VOICE].button:set_option_index(voice + 1)
Timeline_time_end = clip_time
end
-- Dialog defines
DLG_CAMERA_ZONE = 1
DLG_OPTIONS = 2
DLG_AV = 3
DLG_PROP = 4
DLG_CANCEL = 5
-- Dialog button defines
-- Camera zone buttons
BTN_CZ_EDIT_PROPERTIES = 1
BTN_CZ_POS_CAMERA = 2
BTN_CZ_DELETE = 3
BTN_CZ_COPY_CURRENT = 4
BTN_CZ_COPY_NEXT = 5
BTN_CZ_EXIT = 6
-- Options buttons
BTN_OPT_ADVANCED = 1
BTN_OPT_ROTATION = 2
BTN_OPT_MOVEMENT = 3
--BTN_OPT_OUTPUT = 4
--BTN_OPT_WATERMARK = 5
--BTN_OPT_CREATE = 6
--BTN_OPT_LOAD_DEFAULT = 7
BTN_OPT_EXIT = 4
-- AV buttons
BTN_AV_TIME_OF_DAY = 1
BTN_AV_WEATHER = 2
BTN_AV_BACKGROUND = 3
BTN_AV_VEHICLES = 4
BTN_AV_PEOPLE = 5
BTN_AV_PLAYER = 6
BTN_AV_SOUND_FX = 7
BTN_AV_VOICE = 8
BTN_AV_EXIT = 9
-- Properties buttons
BTN_PROP_ZONE_TYPE = 1
BTN_PROP_EXPORT_LOCK = 2
BTN_PROP_FOLLOW = 3
--BTN_PROP_TARGET = 4
BTN_PROP_SELECT_TARGET = 4
BTN_PROP_POS_CAMERA = 5
BTN_PROP_SLOW_MO = 6
BTN_PROP_DOF = 7
BTN_PROP_DOF_DIST = 8
BTN_PROP_DOF_FOCAL = 9
BTN_PROP_FOV = 10
BTN_PROP_TILT = 11
BTN_PROP_HANDYCAM = 12
BTN_PROP_EXIT = 13
-- Ease buttons (for the properties dialog)
BTN_EASE_POSITION = 1
BTN_EASE_DOF_DIST = 2
BTN_EASE_DOF_FOCAL = 3
BTN_EASE_FOV = 4
BTN_EASE_TILT = 5
BTN_EASE_HANDYCAM = 6
-- Cancel buttons
BTN_CNCL_DONE = 1
BTN_CNCL_EXIT = 2
-- List of dialogs, including their buttons
CCE_dialogs = {
[DLG_CAMERA_ZONE] = {
bg = nil, -- Background image object (filled during init)
text = nil, -- Text object (filled during init)
hide = nil, -- Hide button (X in upper right)
title = "PC_CAMERA_ZONE",
x_pos = 0,
width = 200,
value_width = 0,
num_buttons = 5, -- Not counting the hide button
buttons = {
[BTN_CZ_EDIT_PROPERTIES] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_EDIT_PROPERTIES", tooltip = "PC_EDIT_PROPS_HINT", }, callback = cinema_clip_editor_cb_cz_edit_properties, },
[BTN_CZ_POS_CAMERA] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_POSITION_CAMERA", tooltip = "PC_POSITION_CAMERA_HINT", }, callback = cinema_clip_editor_cb_prop_pos_camera, },
[BTN_CZ_DELETE] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_DELETE_CZ", tooltip = "PC_DELETE_CZ_HINT", }, callback = cinema_clip_editor_cb_cz_delete, },
[BTN_CZ_COPY_CURRENT] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_COPY_CURRENT", tooltip = "PC_COPY_CURRENT_HINT", }, callback = cinema_clip_editor_cb_cz_copy_current, },
[BTN_CZ_COPY_NEXT] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_COPY_NEXT", tooltip = "PC_COPY_NEXT_HINT", }, callback = cinema_clip_editor_cb_cz_copy_next, },
[BTN_CZ_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = true, tooltip = "PC_CZ_EXIT_HINT", }, callback = cinema_clip_editor_cb_cz_hide, }, -- Created by dialog
}, -- Buttons
num_headings = 0, -- Incremented dynamically (see cinema_clip_editor_dialog_add_heading)
headings = {}, -- List of headings (text)
spacers = {}, -- List of heading positions
ease_buttons = nil, -- See DLG_PROP for how this is used
visible = false, -- Whether the dialog is visible
},
[DLG_OPTIONS] = {
bg = nil,
text = nil,
hide = nil,
title = "PC_OPTIONS",
x_pos = 0,
width = 300,
value_width = 120,
num_buttons = 3,
buttons = {
[BTN_OPT_ADVANCED] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_ADVANCED_MODE", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_ADVANCED_MODE_HINT", }, callback = cinema_clip_editor_cb_opt_advanced, },
[BTN_OPT_ROTATION] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_ROTATION_SENSITIVITY", s_min = 25, s_max = 100, s_step = 10, s_snap = 5, s_value = 50, tooltip = "PC_ROTATION_SENSITIVITY_HINT", }, callback = cinema_clip_editor_cb_opt_rotation_sens, },
[BTN_OPT_MOVEMENT] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_MOVEMENT_SENSITIVITY", s_min = 25, s_max = 100, s_step = 10, s_snap = 5, s_value = 50, tooltip = "PC_MOVEMENT_SENSITIVITY_HINT", }, callback = cinema_clip_editor_cb_opt_movement_sens, },
--[BTN_OPT_OUTPUT] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_OUTPUT_ONLY", options = { "OPTION_NO", "OPTION_YES" }, o_index = 1, tooltip = "PC_OUTPUT_ONLY_HINT", }, callback = cinema_clip_editor_cb_opt_show_output, },
--[BTN_OPT_WATERMARK] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_WATERMARK", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_WATERMARK_HINT", }, callback = cinema_clip_editor_cb_opt_watermark, },
--[BTN_OPT_CREATE] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_CREATE_CHAR", tooltip = "PC_CREATE_CHAR_HINT", }, callback = cinema_clip_editor_cb_opt_create_import, },
--[BTN_OPT_LOAD_DEFAULT] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_LOAD_CHAR", tooltip = "PC_LOAD_CHAR_HINT", }, callback = cinema_clip_editor_cb_opt_load_default, },
[BTN_OPT_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = true, tooltip = "PC_OPTIONS_EXIT_HINT", }, callback = cinema_clip_editor_cb_opt_hide, }, -- Created by dialog
},
num_headings = 0,
headings = {},
spacers = {},
ease_buttons = nil,
visible = false,
},
[DLG_AV] = {
bg = nil,
text = nil,
hide = nil,
title = "PC_ENVIRONMENT",
x_pos = 0,
width = 300,
value_width = 120,
num_buttons = 8,
buttons = {
[BTN_AV_TIME_OF_DAY] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_TOD", options = { "PC_TOD_DEFAULT", "PC_TOD_MORNING", "PC_TOD_NOON", "PC_TOD_AFTERNOON", "PC_TOD_NIGHT" }, o_index = 2, tooltip = "PC_TOD_HINT", }, callback = cinema_clip_editor_cb_av_time_of_day, },
[BTN_AV_WEATHER] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_WEATHER", options = { "PC_W_DEFAULT", "PC_W_CLEAR", "PC_W_OVERCAST", "PC_W_RAINY", "PC_W_THUNDERSTORM" }, o_index = 1, tooltip = "PC_WEATHER_HINT", }, callback = cinema_clip_editor_cb_av_weather, },
[BTN_AV_BACKGROUND] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_GS_BACKGROUND", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_GS_BACKGROUND_HINT", }, callback = cinema_clip_editor_cb_av_background, },
[BTN_AV_VEHICLES] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_GS_VEHICLES", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_GS_VEHICLES_HINT", }, callback = cinema_clip_editor_cb_av_vehicles, },
[BTN_AV_PEOPLE] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_GS_PEOPLE", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_GS_PEOPLE_HINT", }, callback = cinema_clip_editor_cb_av_people, },
[BTN_AV_PLAYER] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_GS_PLAYER", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_GS_PLAYER_HINT", }, callback = cinema_clip_editor_cb_av_player, },
[BTN_AV_SOUND_FX] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_SOUNDFX", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_SOUNDFX_HINT", }, callback = cinema_clip_editor_cb_av_sound_fx, },
[BTN_AV_VOICE] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_VOICE", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_VOICE_HINT", }, callback = cinema_clip_editor_cb_av_voice, },
[BTN_AV_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = true, tooltip = "PC_AV_EXIT_HINT", }, callback = cinema_clip_editor_cb_av_hide, }, -- Created by dialog
},
num_headings = 0,
headings = {},
spacers = {},
ease_buttons = nil,
visible = false,
},
[DLG_PROP] = {
bg = nil,
text = nil,
hide = nil,
title = "PC_PROPS",
x_pos = 0,
width = 300,
value_width = 120,
num_buttons = 12,
buttons = {
[BTN_PROP_ZONE_TYPE] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_ZONE_TYPE", options = { "PC_ZT_CUT", "PC_ZT_BLEND" }, o_index = 1, tooltip = "PC_ZONE_TYPE_HINT", }, callback = cinema_clip_editor_cb_prop_zone_type, },
[BTN_PROP_EXPORT_LOCK] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_EXPORT_LOCK", options = { "OPTION_NO", "OPTION_YES" }, o_index = 2, tooltip = "PC_EXPORT_LOCK_HINT", }, callback = cinema_clip_editor_cb_prop_export_lock, },
[BTN_PROP_FOLLOW] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_CAM_MODE", options = { "PC_CM_DEFAULT", "PC_CM_STATIC", "PC_CM_FOLLOW", "PC_CM_FOLLOW_LOOK", "PC_CM_FOLLOW_WATCH", "PC_CM_TRACKING" }, o_index = 1, tooltip = "PC_CAM_MODE_HINT", }, callback = cinema_clip_editor_cb_prop_follow_mode, },
--[BTN_PROP_TARGET] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "BLANK", options = { "BLANK" }, o_index = 1, tooltip = "REMOVE THIS OPTION?", }, callback = cinema_clip_editor_cb_prop_target, },
[BTN_PROP_SELECT_TARGET] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_SELECT_TARGET", tooltip = "PC_SELECT_TARGET_HINT", }, callback = cinema_clip_editor_cb_prop_choose_target, },
[BTN_PROP_POS_CAMERA] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_POSITION_CAMERA", tooltip = "PC_POSITION_CAMERA_HINT", }, callback = cinema_clip_editor_cb_prop_pos_camera, },
[BTN_PROP_SLOW_MO] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_SLOWMO", options = { "PC_SM_NORMAL", "PC_SM_SLOW", "PC_SM_VERY_SLOW", "PC_SM_VERY_FAST", "PC_SM_FAST", }, o_index = 1, tooltip = "PC_SLOWMO_HINT", }, callback = cinema_clip_editor_cb_prop_slow_mo, },
[BTN_PROP_DOF] = { button = nil, data = { type = PC_TYPE_TOGGLE, label = "PC_DOF", options = { "PC_DOF_OFF", "PC_DOF_ZOOM", "PC_DOF_CLOSEUP", "PC_DOF_NORMAL", "PC_DOF_WIDE", }, o_index = 4, tooltip = "PC_DOF_HINT", }, callback = cinema_clip_editor_cb_prop_depth_of_field, },
[BTN_PROP_DOF_DIST] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_DOF_DIST", s_min = 0, s_max = 100, s_step = 10, s_snap = 5, s_value = 50, tooltip = "PC_DOF_DIST_HINT", }, callback = cinema_clip_editor_cb_prop_dof_distance, },
[BTN_PROP_DOF_FOCAL] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_DOF_RANGE", s_min = 0, s_max = 100, s_step = 10, s_snap = 5, s_value = 50, tooltip = "PC_DOF_RANGE_HINT", }, callback = cinema_clip_editor_cb_prop_dof_focal_range, },
[BTN_PROP_FOV] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_FOV", s_min = 10, s_max = 120, s_step = 5, s_snap = 5, s_value = 60, tooltip = "PC_FOV_HINT", }, callback = cinema_clip_editor_cb_prop_field_of_view, },
[BTN_PROP_TILT] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_CAM_TILT", s_min = -180, s_max = 180, s_step = 5, s_snap = 5, s_value = 0, tooltip = "PC_CAM_TILT_HINT", }, callback = cinema_clip_editor_cb_prop_camera_tilt, },
[BTN_PROP_HANDYCAM] = { button = nil, data = { type = PC_TYPE_SLIDER, label = "PC_HANDYCAM", s_min = 0, s_max = 100, s_step = 10, s_snap = 5, s_value = 0, tooltip = "PC_HANDYCAM_HINT", }, callback = cinema_clip_editor_cb_prop_handycam, },
[BTN_PROP_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = true, tooltip = "PC_PROPS_EXIT_HINT", }, callback = cinema_clip_editor_cb_prop_hide, }, -- Created by dialog
},
num_headings = 0,
headings = {},
spacers = {},
visible = false,
-- These buttons are used only in this specific dialog
ease_buttons = {
[BTN_EASE_POSITION] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_cam_position, },
[BTN_EASE_DOF_DIST] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_dof_distance, },
[BTN_EASE_DOF_FOCAL] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_dof_focal_range, },
[BTN_EASE_FOV] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_fov, },
[BTN_EASE_TILT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_cam_tilt, },
[BTN_EASE_HANDYCAM] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EASE_NONE, mini = false, tooltip = "PC_EASE_HINT", }, callback = cinema_clip_editor_cb_blend_handycam, },
},
ease_lines = { 5, 8, 9, 10, 11, 12 }, -- Which dialog buttons to line up with
ease_headers = { 0, 1, 1, 1, 1, 1 }, -- How many sub-headers to offset by for each ease button
},
[DLG_CANCEL] = {
bg = nil,
text = nil,
hide = nil,
title = "PC_POSITION_CAMERA",
x_pos = 1280 * 0.5,
width = 100,
value_width = 0,
num_buttons = 1,
buttons = {
[BTN_CNCL_DONE] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_CAMERA_DONE", tooltip = "PC_CAMERA_DONE_HINT", }, callback = cinema_clip_editor_cb_cancel, },
[BTN_CNCL_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = true, tooltip = "PC_CAMERA_DONE_HINT", }, callback = cinema_clip_editor_cb_cancel, }, -- Created by dialog, does same thing as main button (currently)
},
num_headings = 0,
headings = {},
spacers = {},
ease_buttons = nil,
visible = false,
},
}
-- Non-dialog button defines
BTN_FREE_REWIND = 1
BTN_FREE_PLAY_SLOW = 2
BTN_FREE_PLAY = 3
BTN_FREE_PLAY_FAST = 4
BTN_FREE_PAUSE = 5
BTN_FREE_OPTIONS = 6
BTN_FREE_AV = 7
BTN_FREE_SAVE = 8
BTN_FREE_EXPORT = 9
BTN_FREE_EXIT = 10
BTN_FREE_SHOW_KEYS = 11
BTN_FREE_HIDE_HUD = 12
BTN_FREE_SHOW_HUD = 13
-- Buttons not associated with a dialog
CCE_free_buttons = {
-- Top row
[BTN_FREE_REWIND] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_REWIND, mini = false, tooltip = "PC_REWIND_HINT", }, callback = cinema_clip_editor_cb_rewind, },
[BTN_FREE_PLAY_SLOW] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_PLAY_SLOW, mini = false, tooltip = "PC_PLAY_SLOW_HINT", }, callback = cinema_clip_editor_cb_play_slow, },
[BTN_FREE_PLAY] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_PLAY, mini = false, tooltip = "PC_PLAY_HINT", }, callback = cinema_clip_editor_cb_play, },
[BTN_FREE_PLAY_FAST] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_PLAY_FAST, mini = false, tooltip = "PC_PLAY_FAST_HINT", }, callback = cinema_clip_editor_cb_play_fast, },
[BTN_FREE_PAUSE] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_PAUSE, mini = false, tooltip = "PC_PAUSE_HINT", }, callback = cinema_clip_editor_cb_pause, },
[BTN_FREE_OPTIONS] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_OPTIONS, mini = false, tooltip = "PC_OPTIONS_HINT", }, callback = cinema_clip_editor_cb_options, },
[BTN_FREE_AV] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_AV_OPTIONS, mini = false, tooltip = "PC_AV_OPTIONS_HINT", }, callback = cinema_clip_editor_cb_av, },
[BTN_FREE_SAVE] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_SAVE, mini = false, tooltip = "PC_SAVE_HINT", }, callback = cinema_clip_editor_cb_save, },
[BTN_FREE_EXPORT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXPORT, mini = false, tooltip = "PC_EXPORT_HINT", }, callback = cinema_clip_editor_cb_export, },
[BTN_FREE_EXIT] = { button = nil, data = { type = PC_TYPE_ICON, icon = PC_ICON_EXIT, mini = false, tooltip = "PC_EXIT_HINT", }, callback = cinema_clip_editor_cb_exit, },
-- Bottom row
[BTN_FREE_SHOW_KEYS] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_SHOW_KEYS", tooltip = "PC_SHOW_KEYS_HINT", }, callback = cinema_clip_editor_cb_show_keys, },
[BTN_FREE_HIDE_HUD] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_HIDE_HUD", tooltip = "PC_SHOW_HUD_HINT", }, callback = cinema_clip_editor_cb_hide_hud, },
[BTN_FREE_SHOW_HUD] = { button = nil, data = { type = PC_TYPE_NORMAL, label = "PC_SHOW_HUD", tooltip = "PC_SHOW_HUD_HINT", }, callback = cinema_clip_editor_cb_show_hud, },
}
-- Reference to data for all buttons (used for mouse inputs)
CCE_buttons = {}