• R/O
  • SSH

hyakutyping: コミット

ゲーム用のソースコード


コミットメタ情報

リビジョンcc13241f019a77f3d9aef51a96850e0936a17e7e (tree)
日時2011-07-18 07:08:42
作者satofumi
コミッターsatofumi

ログメッセージ

オプションのマウス操作を調整した

変更サマリ

差分

diff -r df53ec8254e2 -r cc13241f019a scripts/menu_utils.lua
--- a/scripts/menu_utils.lua Sun Jul 17 18:07:50 2011 +0900
+++ b/scripts/menu_utils.lua Mon Jul 18 07:08:42 2011 +0900
@@ -1,6 +1,6 @@
11 -- メニューの作成補助
22 -- Satofumi KAMIMURA
3--- $Id$
3+-- $Id: menu_utils.lua,v dfd459a213c3 2010/05/06 16:39:10 Satofumi $
44
55
66 function createMenu(menu, buttons_text, base_rect, font, surfaces, buttons,
@@ -10,10 +10,14 @@
1010 local normal_base_surface = ColorSurface(base_rect, normal_base_color)
1111 table.insert(surfaces, normal_base_surface)
1212
13- local focused_base_color = Color(0.7, 0.7, 1.0, 0.6)
13+ local focused_base_color = Color(0.7, 0.7, 1.0, 0.5)
1414 local focused_base_surface = ColorSurface(base_rect, focused_base_color)
1515 table.insert(surfaces, focused_base_surface)
1616
17+ local pressed_base_color = Color(0.5, 0.5, 1.0, 0.8)
18+ local pressed_base_surface = ColorSurface(base_rect, pressed_base_color)
19+ table.insert(surfaces, pressed_base_surface)
20+
1721 for i = 1, #buttons_text do
1822 local text_surface = TextSurface(font, buttons_text[i])
1923 local normal_surface = MultiSurface(normal_base_surface)
@@ -32,7 +36,10 @@
3236 local focused_surface = MultiSurface(focused_base_surface)
3337 focused_surface:push_front(text_surface, surface_offset)
3438
35- local button = Button(normal_surface, focused_surface, focused_surface)
39+ local pressed_surface = MultiSurface(pressed_base_surface)
40+ pressed_surface:push_front(text_surface, surface_offset)
41+
42+ local button = Button(normal_surface, focused_surface, pressed_surface)
3643 menu:addButton(button, i);
3744
3845 table.insert(surfaces, focused_surface)
diff -r df53ec8254e2 -r cc13241f019a scripts/option_config.lua
--- a/scripts/option_config.lua Sun Jul 17 18:07:50 2011 +0900
+++ b/scripts/option_config.lua Mon Jul 18 07:08:42 2011 +0900
@@ -104,6 +104,7 @@
104104
105105 local buttons_step = Point(190, 0)
106106 option_input_:setButtonStep(buttons_step)
107+ option_input_:setEnableClickedAndFocus(true)
107108 option_:addComponent(option_input_, Point(option_x, option_input_y))
108109
109110
@@ -126,6 +127,7 @@
126127
127128 buttons_step = Point(230, 0)
128129 option_screen_:setButtonStep(buttons_step)
130+ option_screen_:setEnableClickedAndFocus(true)
129131 option_:addComponent(option_screen_, Point(option_x, option_screen_y))
130132
131133
@@ -162,6 +164,7 @@
162164
163165 buttons_step = Point(32, 0)
164166 volume_music_:setButtonStep(buttons_step)
167+ volume_music_:setEnableClickedAndFocus(true)
165168 option_:addComponent(volume_music_, Point(volume_music_x, volume_music_y))
166169
167170 -- 効果音の音量
@@ -175,7 +178,21 @@
175178 base_rect, font_, volume_se_surfaces_,
176179 volume_se_buttons_, "center")
177180 volume_se_:setButtonStep(buttons_step)
181+ volume_se_:setEnableClickedAndFocus(true)
178182 option_:addComponent(volume_se_, Point(volume_se_x, volume_se_y))
183+
184+
185+ -- 保存されている設定を読み出して反映させる
186+ -- !!! 実際にファイルから反映させる
187+ option_input_:setIndex(0)
188+ option_screen_:setIndex(1)
189+ volume_music_:setIndex(3)
190+ volume_se_:setIndex(4)
191+
192+ option_input_:press(1)
193+ option_screen_:press(2)
194+ volume_music_:press(4)
195+ volume_se_:press(4)
179196 end
180197
181198
旧リポジトリブラウザで表示