Skip to content

MENU: EasyUO 1.5 and 1.6

EasyUO has two different menu systems, and EasyUO Reforged runs both. Each script runs under one of them, the 1.5 logic or the 1.6 logic, chosen when the script starts.

  • EasyUO 1.5 is the version whose source code was published. Its menu builds one window with controls in it. Reforged is a port of that source, so this is the menu most scripts were written for.
  • EasyUO 1.6 came later, around 2017, as closed builds. Its author rewrote menu: any number of windows (menu Form), containers (menu Panel), radio buttons, and reading and changing any property of any control (menu GetProp, menu SetProp). The rewrite also changed how the old sub-commands behave in places: names, #MenuButton, what happens when a script starts.

Neither is a superset of the other. A script written for 1.6 shows nothing under 1.5, and some scripts written for 1.5 misbehave under 1.6. Reforged’s 1.6 logic is a port of what EasyUO 1.6.0.337 does, checked against the real program; the few places where it differs on purpose are on Known limitations.

When a stopped script starts, Reforged reads its text once:

  1. A menu Reforge Mode line decides: 1.5 or 1.6.
  2. Otherwise, a menu line using any of the nine sub-commands only 1.6 has selects the 1.6 logic: Form, Panel, Radio, GetProp, SetProp, GetDef, SetDef, PushDef and PopDef.
  3. Otherwise, the 1.5 logic.
menu Form main 300 200 260 50 My tool ; 1.6-only: this script runs under the 1.6 logic
menu Text t 10 10 Built with menu Form.
menu SetProp main visible #true
halt
menu Clear
menu Text status 10 10 Waiting... ; only sub-commands both have: the 1.5 logic
menu Show
halt

Only real menu lines count: a sub-command in a comment does not, and neither does one that comes from a variable (menu %what ...), which is only known once the line runs. Files the script pulls in with call are not read, unless the script says menu Reforge IncludeCall #true.

The editor’s status bar shows which logic the script runs, or ran last: MENU 1.5, MENU 1.6, or MENU 1.6 (forced) when menu Reforge Mode chose it. If a 1.6-only sub-command does run under a 1.5 logic that was chosen for you, Reforged says so once per run, in a message box, and tells you which line to add. The script keeps running; under 1.5 that line does nothing.

Put a menu Reforge Mode line in the main script, usually at the top:

menu Reforge Mode 1.6
set %make Form
set %change SetProp
menu %make main 300 200 260 50 Chosen by menu Reforge Mode
menu Text t 10 10 Form and SetProp come from variables.
menu %change main visible #true
halt

It is read before the script runs, wherever it is, so it works even in a script whose 1.6 sub-commands all come from variables or from called files. The value must be written as 1.5 or 1.6; a variable is not read. EasyUO 1.5 and 1.6 themselves ignore the line, so a script that has it still runs there.

menu Reforge IncludeCall #true makes the automatic choice read the files the script calls too.

The MENU Designer writes 1.6 windows only, and every file it saves starts with menu Reforge Mode 1.6.

The choice holds for the whole run, for the main script and every file it calls, as in EasyUO, where one version ran everything. The two logics cannot be mixed: a window built by one is unknown to the other. To change logic, stop the script and start it again; the windows of the old logic are taken down first.

Differs links to how the sub-command behaves differently in the two.

Sub-command 1.5 1.6
menu Activate ✓ ✓ Differs
menu Button ✓ ✓ Differs
menu Check ✓ ✓ Differs
menu Clear ✓ ✓ Differs
menu Combo (Create, Add, Select, Clear) ✓ ✓ Differs
menu Delete ✓ ✓ Differs
menu Edit ✓ ✓ Differs
menu Font Align, BgColor, Color, Name, Size, Style ✓ ✓
menu Font Transparent ✓ ignored by 1.6
menu Form ✓
menu Get ✓ ✓ Differs
menu GetDef ✓
menu GetNum ✓ ✓ Differs
menu GetProp ✓
menu Hide ✓ ✓ Differs
menu HideEUO ✓ ignored by 1.6
menu Image Create ✓ ✓ Differs
menu Image Ellipse, Line, Rectangle ✓ ✓ Differs
menu Image File, FloodFill, Pix ✓ ✓
menu Image PixLine ✓ ignored by 1.6
menu Image Pos ✓ ✓ Differs
menu List (Create, Add, Select, Clear) ✓ ✓ Differs
menu Memo (Reforged) ✓ ✓ Differs
menu Panel ✓
menu PopDef, menu PushDef ✓
menu Radio ✓
menu Reforge Mode, IncludeCall (Reforged) ✓ ✓
menu Set ✓ ✓ Differs
menu SetDef ✓
menu SetProp ✓
menu Shape ✓ ✓ Differs
menu Show ✓ ✓ Differs
menu Text ✓ ✓ Differs
menu Window Color, Size, Title, Transparent ✓ ✓
  • 1.5: several controls may share a name. menu Set, menu Delete, combo/list Add, Select and Clear, and the menu Image drawing commands act on all of them; menu Get and menu Activate use the first.
  • 1.6: a name belongs to one control. A second control created with a taken name still appears, but no command can reach it: menu Set changes the first, menu Delete removes only the first, and a click on the second button records nothing. Names are not case-sensitive and are kept in lower case.
menu Clear
menu Window Size 200 70
menu Text status 10 10 one
menu Text status 10 30 two
menu Set status three ; 1.5: both labels say "three". 1.6: only the first does.
menu Show
halt
1.5 1.6
A button click the button’s name in capitals the button’s name in lower case
The window’s × CLOSED CLOSED for the main window; another menu Form gives its own name
menu Hide CLOSED unchanged
menu Clear unchanged emptied
A script starting unchanged: the last run’s value #MenuButton and #MenuRes emptied

In 1.6, set #MenuButton form0 reads back as CLOSED.

  • 1.5: starting a script frees its controls but leaves the window as it was, shown or hidden.
  • 1.6: starting a script destroys every menu window, then creates a new, hidden main window at 100,100 with a 305 × 180 inside.

Stopping a script leaves every window as it is in both.

In 1.6 the main window is a control called form0: menu GetProp and menu SetProp work on it, menu SetDef parent form0 puts new controls back in it, and menu Delete form0 destroys it until the next start. It has a fixed frame without a maximize button. In 1.5 it is a resizable window that no command can name.

In 1.5 menu Shape is a real shape: dashed lines, hatched fills, rounded corners. In 1.6 it is drawn into an image: the line is solid or absent, the inside is filled only with fill type 7, rounded corners are square, and types 1, 5 and 6 shrink the box to a centred square. Because it is an image, menu Image commands can draw on it.

1.6 ignores menu Font Transparent: its labels always have a background, in the colour set by menu Font BgColor. It also ignores menu HideEUO and menu Image PixLine.

1.6 refuses a negative width or height in menu Image Create and menu Shape, and a negative second corner in menu Image Line, Ellipse and Rectangle. An invalid line width draws a 1-pixel line in 1.6 and nothing in 1.5.

  • menu Activate works on any control in 1.6 and brings its window to the front.
  • menu Get and menu Set also work on radio buttons in 1.6.
  • menu Image Pos moves any control in 1.6, and stretches an image only when a size is given.
  • menu Show also puts the window on top in 1.6.
  • Give every control its own name, at least those the script changes, reads or deletes later.
  • Set #MenuButton to N/A before waiting for a click. (Its case changes, from OK to ok, but = ignores case.)
  • Don’t wait for CLOSED after menu Hide: in 1.6 hiding is silent.
  • Instead of menu Font Transparent, give labels the colour of what is behind them.
  • Check shapes that use dashed lines, hatching or rounded corners.
  • Add menu Reforge Mode 1.6 at the top, so Reforged does not depend on detecting it.

The nine 1.6-only sub-commands do nothing in 1.5. Build a single window with menu Window and menu Show instead of forms, place controls directly instead of in panels, use check boxes instead of radio buttons, and read values with menu Get instead of menu GetProp.

The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.