Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
df0e6321
Commit
df0e6321
authored
Feb 23, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记住密码
parent
69675801
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
41 additions
and
15 deletions
+41
-15
data/config_default.yml
data/config_default.yml
+0
-3
graphics/system/checkbox.png
graphics/system/checkbox.png
+0
-0
graphics/system/iDuelPanel_32512.ico
graphics/system/iDuelPanel_32512.ico
+0
-0
graphics/system/icon.ico
graphics/system/icon.ico
+0
-0
graphics/system/icon.ico_
graphics/system/icon.ico_
+0
-0
graphics/system/logo.png
graphics/system/logo.png
+0
-0
graphics/system/phases_opponent.png_STOP
graphics/system/phases_opponent.png_STOP
+0
-0
graphics/system/phases_player.png_STOP
graphics/system/phases_player.png_STOP
+0
-0
lib/iduel/window_login.rb
lib/iduel/window_login.rb
+3
-0
lib/main.rb
lib/main.rb
+1
-0
lib/scene_duel.rb
lib/scene_duel.rb
+2
-0
lib/widget_checkbox.rb
lib/widget_checkbox.rb
+29
-9
lib/window_gameselect.rb
lib/window_gameselect.rb
+4
-3
lib/window_login.rb
lib/window_login.rb
+2
-0
No files found.
data/config_default.yml
deleted
100644 → 0
View file @
69675801
fullscreen
:
false
width
:
1024
height
:
768
\ No newline at end of file
graphics/system/checkbox.png
View file @
df0e6321
This diff was suppressed by a .gitattributes entry.
graphics/system/iDuelPanel_32512.ico
deleted
100644 → 0
View file @
69675801
4.19 KB
graphics/system/icon.ico
deleted
100644 → 0
View file @
69675801
1.12 KB
graphics/system/icon.ico_
deleted
100644 → 0
View file @
69675801
File deleted
graphics/system/logo.png
deleted
100644 → 0
View file @
69675801
This diff was suppressed by a .gitattributes entry.
graphics/system/phases_opponent.png_STOP
deleted
100644 → 0
View file @
69675801
File deleted
graphics/system/phases_player.png_STOP
deleted
100644 → 0
View file @
69675801
File deleted
lib/iduel/window_login.rb
View file @
df0e6321
...
@@ -6,6 +6,9 @@ class Window_Login
...
@@ -6,6 +6,9 @@ class Window_Login
Widget_Msgbox
.
new
(
"iDuel"
,
"正在登陆"
)
Widget_Msgbox
.
new
(
"iDuel"
,
"正在登陆"
)
$scene
.
draw
#强制重绘一次,下面会阻塞
$scene
.
draw
#强制重绘一次,下面会阻塞
$game
=
Iduel
.
new
$game
=
Iduel
.
new
$config
[
$config
[
'game'
]][
'username'
]
=
@username_inputbox
.
value
$config
[
$config
[
'game'
]][
'password'
]
=
@remember_password
.
checked?
?
@password_inputbox
.
value
:
nil
save_config
$game
.
login
(
@username_inputbox
.
value
,
@password_inputbox
.
value
)
$game
.
login
(
@username_inputbox
.
value
,
@password_inputbox
.
value
)
when
:register
when
:register
require
'launchy'
require
'launchy'
...
...
lib/main.rb
View file @
df0e6321
...
@@ -9,6 +9,7 @@ begin
...
@@ -9,6 +9,7 @@ begin
$config
[
'screen'
]
||=
{}
$config
[
'screen'
]
||=
{}
$config
[
'screen'
][
'width'
]
||=
1024
$config
[
'screen'
][
'width'
]
||=
1024
$config
[
'screen'
][
'height'
]
||=
768
$config
[
'screen'
][
'height'
]
||=
768
p
$config
end
end
def
save_config
(
file
=
"config.yml"
)
def
save_config
(
file
=
"config.yml"
)
File
.
open
(
file
,
"w"
){
|
file
|
YAML
.
dump
(
$config
,
file
)}
File
.
open
(
file
,
"w"
){
|
file
|
YAML
.
dump
(
$config
,
file
)}
...
...
lib/scene_duel.rb
View file @
df0e6321
...
@@ -151,6 +151,8 @@ class Scene_Duel < Scene
...
@@ -151,6 +151,8 @@ class Scene_Duel < Scene
notify_send
(
"对手离开房间"
,
"对手离开房间"
)
notify_send
(
"对手离开房间"
,
"对手离开房间"
)
end
end
end
end
else
super
end
end
end
end
def
update
def
update
...
...
lib/widget_checkbox.rb
View file @
df0e6321
# To change this template, choose Tools | Templates
# To change this template, choose Tools | Templates
# and open the template in the editor.
# and open the template in the editor.
class
Widget_
checkbox
class
Widget_
Checkbox
<
Window
def
initialize
(
window
,
text
,
x
,
y
,
width
=
window
.
width
-
x
,
height
=
20
,
checked
=
false
)
attr_reader
:checked
@x
=
x
alias
checked?
checked
@y
=
y
def
initialize
(
window
,
x
,
y
,
width
=
window
.
width
-
x
,
height
=
24
,
checked
=
false
,
text
=
""
,
&
proc
)
@text
=
text
super
(
x
+
2
,
y
+
2
,
width
,
height
,
500
)
#+2是素材尺寸问题
@window
=
window
@window
=
window
@text
=
text
@checked
=
checked
@checked
=
checked
@checkbox
=
Surface
.
load
'graphics/system/checkbox.png'
@checkbox
=
Surface
.
load
(
'graphics/system/checkbox.png'
).
display_format
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
20
)
@proc
=
proc
refresh
end
def
mousemoved
(
x
,
y
)
if
x
-
@x
<
24
@index
=
0
else
@index
=
nil
end
end
end
def
mouseover
(
x
,
y
)
def
clicked
if
@index
@checked
=
!
@checked
@proc
.
call
(
@checked
)
if
@proc
end
refresh
end
end
def
refresh
def
refresh
clear
Surface
.
blit
(
@checkbox
,
0
,
@checked
?
@checkbox
.
h
/
2
:
0
,
@checkbox
.
w
/
3
,
@checkbox
.
h
/
2
,
self
.
contents
,
0
,
0
)
@font
.
draw_blended_utf8
(
self
.
contents
,
@text
,
24
,
0
,
0xFF
,
0xFF
,
0xFF
)
end
end
#def clear(x=0,y=0,width=@width,height=@height)
# Surface.blit(@window.contents, @x-@window.x+x, @y-@window.y+y, width,height, self.contents, x, y)
#end
end
end
lib/window_gameselect.rb
View file @
df0e6321
...
@@ -12,7 +12,7 @@ class Window_GameSelect < Window_List
...
@@ -12,7 +12,7 @@ class Window_GameSelect < Window_List
if
game
.
is_a?
(
Hash
)
&&
game
[
"name"
]
if
game
.
is_a?
(
Hash
)
&&
game
[
"name"
]
game
[
'file'
]
||=
'game.rb'
game
[
'file'
]
||=
'game.rb'
game
[
'file'
]
=
File
.
expand_path
(
game
[
'file'
],
File
.
dirname
(
file
))
game
[
'file'
]
=
File
.
expand_path
(
game
[
'file'
],
File
.
dirname
(
file
))
$config
[
game
[
'name'
]]
=
{}
$config
[
game
[
'name'
]]
||
=
{}
@items
<<
game
@items
<<
game
else
else
$log
.
error
"
#{
game
.
inspect
}
读取失败(
#{
file
}
)"
$log
.
error
"
#{
game
.
inspect
}
读取失败(
#{
file
}
)"
...
@@ -56,8 +56,9 @@ class Window_GameSelect < Window_List
...
@@ -56,8 +56,9 @@ class Window_GameSelect < Window_List
end
end
def
clicked
def
clicked
load
@items
[
@index
][
"file"
]
#TODO: load的这种架构微蛋疼,一时想不到更好的方案
load
@items
[
@index
][
"file"
]
#TODO: load的这种架构微蛋疼,一时想不到更好的方案
p
$config
$config
[
'game'
]
=
@items
[
@index
][
'name'
]
@login_window
.
destroy
if
@login_window
@login_window
.
destroy
if
@login_window
p
@items
,
@index
,
$config
@login_window
=
Window_Login
.
new
(
316
,
316
,
$config
[
$config
[
'game'
]][
"username"
],
$config
[
$config
[
'game'
]][
"password"
])
@login_window
=
Window_Login
.
new
(
316
,
316
,
$config
[[
@items
][
@index
][
'name'
]][
"username"
],
$config
[[
@items
][
@index
][
'name'
]][
"password"
])
end
end
end
end
lib/window_login.rb
View file @
df0e6321
#encoding: UTF-8
#encoding: UTF-8
require_relative
'widget_inputbox'
require_relative
'widget_inputbox'
require_relative
'widget_msgbox'
require_relative
'widget_msgbox'
require_relative
'widget_checkbox'
class
Window_Login
<
Window
class
Window_Login
<
Window
def
initialize
(
x
,
y
,
username
=
nil
,
password
=
nil
)
def
initialize
(
x
,
y
,
username
=
nil
,
password
=
nil
)
@username
=
username
@username
=
username
...
@@ -30,6 +31,7 @@ class Window_Login < Window
...
@@ -30,6 +31,7 @@ class Window_Login < Window
:replay
=>
"战报"
:replay
=>
"战报"
}
}
#self.index = nil
#self.index = nil
@remember_password
=
Widget_Checkbox
.
new
(
self
,
357
+
@x
,
80
+
@y
,
self
.
width
-
357
,
24
,
password
,
"记住密码"
)
refresh
refresh
end
end
def
draw_stroked_text
(
text
,
x
,
y
,
size
=
1
,
font
=
@font
)
def
draw_stroked_text
(
text
,
x
,
y
,
size
=
1
,
font
=
@font
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment