Create a gist now

Instantly share code, notes, and snippets.

@masoo /dqmp.rb
Created Dec 11, 2013

What would you like to do?
masoojer でドラゴンクエスト モンスターパレードをする。
# -*- coding: utf-8 -*-
require 'mscorlib'
require 'System'
require 'PresentationFramework'
module Masoojer
def self.dqmp
@webbrowser = System::Windows::Controls::WebBrowser.new
@webbrowser.Name = "DqmpWebBrowser"
@webbrowser.Height = System::Double.NaN
dqmp_string = System::String.new("http://www.dqmp.jp/")
@webbrowser.Source = System::Uri.new(dqmp_string)
$mainWindow.FindName("EditorComponent").Visibility = System::Windows::Visibility.Collapsed
System::Windows::Controls::DockPanel.SetDock(@webbrowser, System::Windows::Controls::Dock.Top)
$mainWindow.FindName("MainDockPanel").Children.Add(@webbrowser)
end
def self.dqmpoff
$mainWindow.FindName("MainDockPanel").Children.Remove(@webbrowser)
$mainWindow.FindName("EditorComponent").Visibility = System::Windows::Visibility.Visible
end
end
menu_dq = System::Windows::Controls::MenuItem.new()
menu_dq.Name = System::String.new("MenuItemDqmp")
menu_dq.Header = System::String.new("モンパレ実行")
$menu.FindName("MenuItemTools").Items.Add(menu_dq)
$menu.RegisterName("MenuItemDqmp", menu_dq)
$menu.FindName("MenuItemDqmp").Click do |s, e|
Masoojer::dqmp
end
menu_dqoff = System::Windows::Controls::MenuItem.new()
menu_dqoff.Name = System::String.new("MenuItemDqmfOff")
menu_dqoff.Header = System::String.new("モンパレ終了")
$menu.FindName("MenuItemTools").Items.Add(menu_dqoff)
$menu.RegisterName("MenuItemDqmfOff", menu_dqoff)
$menu.FindName("MenuItemDqmfOff").Click do |s, e|
Masoojer::dqmpoff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment