Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- / Script: Open Basic material editor with Map Navigator aligned to the right side or Toggle Map Navigator
- / Author: Panteleev Sergey
- / Year: 2019
- / Contacts: fatbbc @ gmail.com
- */
- fn ToggleMeditMapNavigator align:true =
- (
- if MatEditor.mode == #basic and MatEditor.isOpen() do
- (
- local done = false
- for handle in UIAccessor.GetPopupDialogs() while not done where MatchPattern (UIAccessor.GetWindowText handle) pattern:"Material Editor*" do
- (
- local mapnav = windows.getChildHWND 0 "Material/Map Navigator"
- if mapnav == undefined then
- (
- for data in windows.getChildrenHWND handle where UIAccessor.GetWindowResourceID data[1] == 1100 do UIAccessor.PressButton data[1]
- if align do
- (
- for hwnd in UIAccessor.GetPopupDialogs() where UIAccessor.GetWindowText hwnd == "Material/Map Navigator" do
- (
- medit_rect = windows.getWindowPos handle
- mapnav_rect = windows.getWindowPos hwnd
- windows.setWindowPos hwnd (medit_rect.x + medit_rect.w) medit_rect.y mapnav_rect.w mapnav_rect.h true
- )
- )
- windows.sendMessage handle 0x7 0 0
- )
- else
- (
- UIAccessor.CloseDialog mapnav[1]
- )
- done = true
- )
- )
- )
- if MatEditor.mode == #basic do
- (
- if not MatEditor.isOpen() then
- (
- MatEditor.open()
- ToggleMeditMapNavigator()
- ) else ToggleMeditMapNavigator()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement