|
|
@@ -12,8 +12,6 @@ end |
|
|
|
|
|
|
|
--[[---------------------------------
|
|
|
|
D3D Options Creation
|
|
|
|
|
|
|
|
Reorganized and to be integrated.
|
|
|
|
---------------------------------]]--
|
|
|
|
|
|
|
|
-- create a single new option for the menu.
|
|
|
@@ -31,7 +29,6 @@ function d3dmenu.new_option(id, label, index, th, h) |
|
|
|
end
|
|
|
|
|
|
|
|
-- default settings for options if file is not found.
|
|
|
|
-- return memory record descriptions and menu labels.
|
|
|
|
function d3dmenu.defaults()
|
|
|
|
-- preset strings come from names of memory records
|
|
|
@@ -89,7 +86,7 @@ function d3dmenu.fromfile(f, sep) |
|
|
|
end --end if
|
|
|
|
end --end for loop
|
|
|
|
return Outstrs, Outlabels
|
|
|
|
end -- end function
|
|
|
|
end
|
|
|
|
|
|
|
|
-- create and bind d3dmenu options with CE memory records.
|
|
|
|
-- global variables are declared here.
|
|
|
@@ -123,8 +120,6 @@ end |
|
|
|
|
|
|
|
--[[---------------------------------
|
|
|
|
D3D Menu Creation
|
|
|
|
|
|
|
|
Mostly old and to be replaced.
|
|
|
|
---------------------------------]]--
|
|
|
|
|
|
|
|
function d3dmenu.createD3Dmenu(CE_hook)
|
|
|
@@ -157,9 +152,7 @@ function d3dmenu.createD3Dmenu(CE_hook) |
|
|
|
fmap = CE_hook.createFontmap(font)
|
|
|
|
hlsprite.Height = fmap.Height
|
|
|
|
hlsprite.Visible = true
|
|
|
|
-- if (not d3dmenu.finit_options(":", CE_hook)) then --if file not found
|
|
|
|
-- d3dmenu.init_options(CE_hook)
|
|
|
|
-- end
|
|
|
|
|
|
|
|
d3dmenu.init(CE_hook)
|
|
|
|
end
|
|
|
|
|
|
|
@@ -167,12 +160,19 @@ end |
|
|
|
D3D Menu Operations
|
|
|
|
---------------------------------]]--
|
|
|
|
|
|
|
|
-- executes changes to game from menu options
|
|
|
|
-- no return value
|
|
|
|
-- accesses global 'Options', and everything related.
|
|
|
|
function d3dmenu.execute_selected()
|
|
|
|
OStates[selected_option] = not OStates[selected_option]
|
|
|
|
addresses.getMemoryRecordByDescription(OStrings[selected_option]).Active = OStates[selected_option]
|
|
|
|
Options[selected_option].Text = OLabels[selected_option]..d3dmenu.status_txt(OStates[selected_option])
|
|
|
|
end
|
|
|
|
|
|
|
|
-- called on the event of a mouse click
|
|
|
|
-- no return value
|
|
|
|
-- accesses and writes global 'selected_option'
|
|
|
|
-- only accesses global 'Options'
|
|
|
|
function d3dmenu.option_click(object, x, y)
|
|
|
|
for i = 1, Options.size do
|
|
|
|
--see which Option was clicked
|
|
|
@@ -184,6 +184,9 @@ function d3dmenu.option_click(object, x, y) |
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- toggle visibility of the menu
|
|
|
|
-- no return value
|
|
|
|
-- accesses and writes global 'bgsprite', 'hlsprite', 'Options'
|
|
|
|
function d3dmenu.toggle_display()
|
|
|
|
bgsprite.Visible = not bgsprite.Visible
|
|
|
|
hlsprite.Visible = not hlsprite.Visible
|
|
|
@@ -192,10 +195,16 @@ function d3dmenu.toggle_display() |
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- move highlighter sprite over selected menu option
|
|
|
|
-- no return value
|
|
|
|
-- accesses global 'selected_option'
|
|
|
|
function d3dmenu.highlight_selected()
|
|
|
|
hlsprite.Y = 50 + (fmap.Height * (selected_option - 1))
|
|
|
|
end
|
|
|
|
|
|
|
|
-- removes all d3d render objects
|
|
|
|
-- no return value
|
|
|
|
-- accesses globals declared in menu creation.
|
|
|
|
function d3dmenu.destroyD3Dmenu()
|
|
|
|
--Clean up... everything.
|
|
|
|
bgsprite.destroy()
|
|
|
@@ -215,4 +224,4 @@ function d3dmenu.destroyD3Dmenu() |
|
|
|
canvas.destroy()
|
|
|
|
end
|
|
|
|
|
|
|
|
return d3dmenu |
|
|
|
return d3dmenu
|