Remove all usage of missing doubleclick? method (#98)

This commit is contained in:
Joni Savolainen
2021-02-26 21:28:34 +02:00
committed by GitHub
parent 46ed10a31d
commit d6b80118c9
5 changed files with 12 additions and 12 deletions

View File

@@ -54,7 +54,7 @@ def pbImportAnim(animations,canvas,animwin)
Graphics.update Graphics.update
Input.update Input.update
cmdwin.update cmdwin.update
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animfiles.length>0 if Input.trigger?(Input::C) && animfiles.length>0
begin begin
textdata=loadBase64Anim(IO.read(animfiles[cmdwin.index])) textdata=loadBase64Anim(IO.read(animfiles[cmdwin.index]))
throw "Bad data" if !textdata.is_a?(PBAnimation) throw "Bad data" if !textdata.is_a?(PBAnimation)

View File

@@ -46,7 +46,7 @@ def pbSelectAnim(canvas,animwin)
bmpwin.update bmpwin.update
ctlwin.update ctlwin.update
bmpwin.hue=ctlwin.value(0) if ctlwin.changed?(0) bmpwin.hue=ctlwin.value(0) if ctlwin.changed?(0)
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animfiles.length>0 if Input.trigger?(Input::C) && animfiles.length>0
bitmap=AnimatedBitmap.new("Graphics/Animations/"+cmdwin.commands[cmdwin.index],ctlwin.value(0)).deanimate bitmap=AnimatedBitmap.new("Graphics/Animations/"+cmdwin.commands[cmdwin.index],ctlwin.value(0)).deanimate
canvas.animation.graphic=cmdwin.commands[cmdwin.index] canvas.animation.graphic=cmdwin.commands[cmdwin.index]
canvas.animation.hue=ctlwin.value(0) canvas.animation.hue=ctlwin.value(0)
@@ -149,7 +149,7 @@ def pbAnimList(animations,canvas,animwin)
cmdwin.index=animations.selected cmdwin.index=animations.selected
next next
end end
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animations.length>0 if Input.trigger?(Input::C) && animations.length>0
cmd2=pbShowCommands(helpwindow,[ cmd2=pbShowCommands(helpwindow,[
_INTL("Load Animation"), _INTL("Load Animation"),
_INTL("Rename"), _INTL("Rename"),
@@ -435,7 +435,7 @@ def pbTimingList(canvas)
next next
end end
end end
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) if Input.trigger?(Input::C)
redrawcmds=false redrawcmds=false
if cmdwin.index==cmdNewSound # Add new sound if cmdwin.index==cmdNewSound # Add new sound
newaudio=PBAnimTiming.new(0) newaudio=PBAnimTiming.new(0)
@@ -562,7 +562,7 @@ def pbSelectSE(canvas,audio)
if maxsizewindow.changed?(6) # Cancel if maxsizewindow.changed?(6) # Cancel
break break
end end
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animfiles.length>0 if Input.trigger?(Input::C) && animfiles.length>0
filename=(cmdwin.index==0) ? "" : cmdwin.commands[cmdwin.index] filename=(cmdwin.index==0) ? "" : cmdwin.commands[cmdwin.index]
displayname=(filename!="") ? filename : _INTL("<user's cry>") displayname=(filename!="") ? filename : _INTL("<user's cry>")
maxsizewindow.controls[0].text=_INTL("File: \"{1}\"",displayname) maxsizewindow.controls[0].text=_INTL("File: \"{1}\"",displayname)
@@ -625,7 +625,7 @@ def pbSelectBG(canvas,timing)
if maxsizewindow.changed?(9) # Cancel if maxsizewindow.changed?(9) # Cancel
break break
end end
if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animfiles.length>0 if Input.trigger?(Input::C) && animfiles.length>0
filename=(cmdwin.index==cmdErase) ? "" : cmdwin.commands[cmdwin.index] filename=(cmdwin.index==cmdErase) ? "" : cmdwin.commands[cmdwin.index]
maxsizewindow.controls[0].text=_INTL("File: \"{1}\"",filename) maxsizewindow.controls[0].text=_INTL("File: \"{1}\"",filename)
elsif Input.trigger?(Input::B) elsif Input.trigger?(Input::B)

View File

@@ -1504,7 +1504,7 @@ def pbPropertyList(title,data,properties,saveprompt=false)
elsif Input.trigger?(Input::B) elsif Input.trigger?(Input::B)
selectedmap = -1 selectedmap = -1
break break
elsif Input.trigger?(Input::C) || (list.doubleclick? rescue false) elsif Input.trigger?(Input::C)
propobj = properties[selectedmap][1] propobj = properties[selectedmap][1]
oldsetting = data[selectedmap] oldsetting = data[selectedmap]
newsetting = propobj.set(properties[selectedmap][0],oldsetting) newsetting = propobj.set(properties[selectedmap][0],oldsetting)

View File

@@ -44,7 +44,7 @@ def pbListScreen(title,lister)
if Input.trigger?(Input::B) if Input.trigger?(Input::B)
selectedmap = -1 selectedmap = -1
break break
elsif Input.trigger?(Input::C) || (list.doubleclick? rescue false) elsif Input.trigger?(Input::C)
break break
end end
end end
@@ -97,7 +97,7 @@ def pbListScreenBlock(title,lister)
lister.refresh(list.index) lister.refresh(list.index)
elsif Input.trigger?(Input::B) elsif Input.trigger?(Input::B)
break break
elsif Input.trigger?(Input::C) || (list.doubleclick? rescue false) elsif Input.trigger?(Input::C)
yield(Input::C, lister.value(selectedmap)) yield(Input::C, lister.value(selectedmap))
list.commands = lister.commands list.commands = lister.commands
if list.index==list.commands.length if list.index==list.commands.length

View File

@@ -261,7 +261,7 @@ def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false)
command = cmdIfCancel command = cmdIfCancel
break break
end end
elsif Input.trigger?(Input::C) || (cmdwindow.doubleclick? rescue false) elsif Input.trigger?(Input::C)
command = cmdwindow.index command = cmdwindow.index
break break
end end
@@ -315,7 +315,7 @@ def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false)
command = [0,cmdIfCancel] command = [0,cmdIfCancel]
break break
end end
elsif Input.trigger?(Input::C) || (cmdwindow.doubleclick? rescue false) elsif Input.trigger?(Input::C)
command = [0,cmdwindow.index] command = [0,cmdwindow.index]
break break
end end
@@ -387,7 +387,7 @@ def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=f
elsif Input.trigger?(Input::B) elsif Input.trigger?(Input::B)
command = [0,(cmdIfCancel>0) ? cmdIfCancel-1 : cmdIfCancel] command = [0,(cmdIfCancel>0) ? cmdIfCancel-1 : cmdIfCancel]
break break
elsif Input.trigger?(Input::C) || (cmdwindow.doubleclick? rescue false) elsif Input.trigger?(Input::C)
command = [0,cmdwindow.index] command = [0,cmdwindow.index]
break break
end end