diff --git a/PokemonGoIV/0Main.vb b/PokemonGoIV/0Main.vb index a923ffc..c9d897e 100644 --- a/PokemonGoIV/0Main.vb +++ b/PokemonGoIV/0Main.vb @@ -70,8 +70,7 @@ Sub subMain End If maIVs = fnFindIV (aQuery) If UBound (maIVs) = -1 Then - 'MsgBox "Found no matching IV." - MsgBox fnGetResString ("msg1000") + MsgBox fnGetResString ("ErrorNotFound") Else subSaveIV (aQuery, maIVs) End If @@ -94,6 +93,11 @@ Function fnAskParam As aFindIVParam oDialog.getControl ("cbxBest3").setVisible (False) oDialog.getControl ("lstApprasal2").setVisible (False) + oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _ + "ImageURL", fnGetImageUrl ("Unknown")) + oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _ + "ImageURL", fnGetImageUrl ("Unknown")) + If oDialog.execute = 0 Then aQuery.bIsCancelled = True fnAskParam = aQuery @@ -233,9 +237,17 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamValor")) + fnGetImageUrl ("TeamLogoValor")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderCandela")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromCandela")) mItems = Array ( _ "Overall, your [Pokémon] simply amazes me. It can accomplish anything!", _ @@ -248,8 +260,8 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 20, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 20, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("Its") @@ -257,12 +269,12 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (50, 96, 35, 8, _ + oList.setPosSize (140, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (145, 96, 160, 8, _ + oText.setPosSize (240, -1, 160, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("is its strongest feature.") @@ -296,9 +308,17 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamMystic")) + fnGetImageUrl ("TeamLogoMystic")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderBlanche")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromBlanche")) mItems = Array ( _ "Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!", _ @@ -311,8 +331,8 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 200, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 200, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("I see that its best attribute is its") @@ -320,12 +340,12 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (230, 96, 35, 8, _ + oList.setPosSize (320, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (325, 96, 5, 8, _ + oText.setPosSize (415, -1, 5, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText (".") @@ -359,9 +379,17 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamInstinct")) + fnGetImageUrl ("TeamLogoInstinct")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderSpark")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromSpark")) mItems = Array ( _ "Overall, your [Pokémon] looks like it can really battle with the best of them!", _ @@ -374,8 +402,8 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 115, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 115, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("Its best quality is") @@ -383,12 +411,12 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (145, 96, 35, 8, _ + oList.setPosSize (240, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (240, 96, 5, 8, _ + oText.setPosSize (335, -1, 5, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText (".") diff --git a/TODO b/TODO index faf9413..d424c04 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,5 @@ PokemonGoIV TODO -* Show images of teams, team leaders and Pokémons. +* Clean-up event handlers. +* LibreOffice compability. * Center the dialog. diff --git a/excludes/1481132741_164_QuestionMark.svg b/excludes/1481132741_164_QuestionMark.svg new file mode 100644 index 0000000..f8deb47 --- /dev/null +++ b/excludes/1481132741_164_QuestionMark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/excludes/black.png b/excludes/black.png new file mode 100644 index 0000000..28e8c34 Binary files /dev/null and b/excludes/black.png differ diff --git a/excludes/team-leaders/slack-imgs.com.0.jpeg b/excludes/team-leaders/slack-imgs.com.0.jpeg new file mode 100644 index 0000000..20c9a87 Binary files /dev/null and b/excludes/team-leaders/slack-imgs.com.0.jpeg differ diff --git a/excludes/team-leaders/team-leader-blanche.png b/excludes/team-leaders/team-leader-blanche.png new file mode 100644 index 0000000..723561b Binary files /dev/null and b/excludes/team-leaders/team-leader-blanche.png differ diff --git a/excludes/team-leaders/team-leader-candela.png b/excludes/team-leaders/team-leader-candela.png new file mode 100644 index 0000000..745a9e8 Binary files /dev/null and b/excludes/team-leaders/team-leader-candela.png differ diff --git a/excludes/team-leaders/team-leader-spark.png b/excludes/team-leaders/team-leader-spark.png new file mode 100644 index 0000000..95d8d52 Binary files /dev/null and b/excludes/team-leaders/team-leader-spark.png differ diff --git a/oxt/AddonConfiguration.xcu b/oxt/AddonConfiguration.xcu index d04a0a3..4a65e60 100644 --- a/oxt/AddonConfiguration.xcu +++ b/oxt/AddonConfiguration.xcu @@ -34,24 +34,39 @@ - + - %origin%/icons/black.png + %origin%/icons/unknown.png - + - %origin%/icons/team-valor.png + %origin%/icons/team-logo-valor.png - + - %origin%/icons/team-mystic.png + %origin%/icons/team-logo-mystic.png - + - %origin%/icons/team-instinct.png + %origin%/icons/team-logo-instinct.png + + + + + %origin%/icons/team-leader-candela.png + + + + + %origin%/icons/team-leader-blanche.png + + + + + %origin%/icons/team-leader-spark.png @@ -813,11 +828,29 @@ - + Found no matching IV. 找不出符合的 IV 值。 + + + Candela, leader of Team Valor, says: + Valor 隊隊長 Candela 說: + + + + + Blanche, leader of Team Mystic, says: + Mystic 隊隊長 Blanche 說: + + + + + Spark, leader of Team Instinct, says: + Instinct 隊隊長 Spark 說: + + diff --git a/oxt/PokemonGoIV/0Main.xba b/oxt/PokemonGoIV/0Main.xba index ed6d3cc..83dd58c 100644 --- a/oxt/PokemonGoIV/0Main.xba +++ b/oxt/PokemonGoIV/0Main.xba @@ -72,8 +72,7 @@ Sub subMain End If maIVs = fnFindIV (aQuery) If UBound (maIVs) = -1 Then - 'MsgBox "Found no matching IV." - MsgBox fnGetResString ("msg1000") + MsgBox fnGetResString ("ErrorNotFound") Else subSaveIV (aQuery, maIVs) End If @@ -96,6 +95,11 @@ Function fnAskParam As aFindIVParam oDialog.getControl ("cbxBest3").setVisible (False) oDialog.getControl ("lstApprasal2").setVisible (False) + oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _ + "ImageURL", fnGetImageUrl ("Unknown")) + oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _ + "ImageURL", fnGetImageUrl ("Unknown")) + If oDialog.execute = 0 Then aQuery.bIsCancelled = True fnAskParam = aQuery @@ -235,9 +239,17 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamValor")) + fnGetImageUrl ("TeamLogoValor")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderCandela")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromCandela")) mItems = Array ( _ "Overall, your [Pokémon] simply amazes me. It can accomplish anything!", _ @@ -250,8 +262,8 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 20, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 20, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("Its") @@ -259,12 +271,12 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (50, 96, 35, 8, _ + oList.setPosSize (140, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (145, 96, 160, 8, _ + oText.setPosSize (240, -1, 160, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("is its strongest feature.") @@ -298,9 +310,17 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamMystic")) + fnGetImageUrl ("TeamLogoMystic")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderBlanche")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromBlanche")) mItems = Array ( _ "Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!", _ @@ -313,8 +333,8 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 200, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 200, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("I see that its best attribute is its") @@ -322,12 +342,12 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (230, 96, 35, 8, _ + oList.setPosSize (320, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (325, 96, 5, 8, _ + oText.setPosSize (415, -1, 5, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText (".") @@ -361,9 +381,17 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oDialog = oEvent.Source.getContext - oImageModel = oDialog.getControl ("imgTeam").getModel + oImageModel = oDialog.getControl ("imgTeamLogo").getModel oImageModel.setPropertyValue ("ImageURL", _ - fnGetImageUrl ("TeamInstinct")) + fnGetImageUrl ("TeamLogoInstinct")) + oDialog.getControl ("imgTeamLeader").setVisible (True) + oImageModel = oDialog.getControl ("imgTeamLeader").getModel + oImageModel.setPropertyValue ("ImageURL", _ + fnGetImageUrl ("TeamLeaderSpark")) + + oText = oDialog.getControl ("txtLeaderAppraise") + oText.setVisible (True) + oText.setText (fnGetResString ("AppraiseFromSpark")) mItems = Array ( _ "Overall, your [Pokémon] looks like it can really battle with the best of them!", _ @@ -376,8 +404,8 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oList.setVisible (True) oText = oDialog.getControl ("txtBestBefore") - oText.setPosSize (30, 96, 115, 8, _ - com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) + oText.setPosSize (-1, -1, 115, -1, _ + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText ("Its best quality is") @@ -385,12 +413,12 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object) oList = oDialog.getControl ("lstBest") oList.removeItems (0, oList.getItemCount()) oList.addItems (mItems, 0) - oList.setPosSize (145, 96, 35, 8, _ + oList.setPosSize (240, -1, -1, -1, _ com.sun.star.awt.PosSize.X) oList.setVisible (True) oText = oDialog.getControl ("txtBestAfter") - oText.setPosSize (240, 96, 5, 8, _ + oText.setPosSize (335, -1, 5, -1, _ com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH) oText.setVisible (True) oText.setText (".") diff --git a/oxt/PokemonGoIV/DialogStrings_en_US.properties b/oxt/PokemonGoIV/DialogStrings_en_US.properties index fb69cda..ccc37df 100644 --- a/oxt/PokemonGoIV/DialogStrings_en_US.properties +++ b/oxt/PokemonGoIV/DialogStrings_en_US.properties @@ -39,3 +39,5 @@ 195.DlgMain.txtBestAfter.HelpText= 201.DlgMain.cbxBest2.HelpText= 203.DlgMain.cbxBest3.HelpText= +208.DlgMain.txtLeaderAppraise.HelpText= +210.DlgMain.imgTeamLeader.HelpText= diff --git a/oxt/PokemonGoIV/DialogStrings_zh_TW.properties b/oxt/PokemonGoIV/DialogStrings_zh_TW.properties index 4820686..cf04c63 100644 --- a/oxt/PokemonGoIV/DialogStrings_zh_TW.properties +++ b/oxt/PokemonGoIV/DialogStrings_zh_TW.properties @@ -39,3 +39,5 @@ 195.DlgMain.txtBestAfter.HelpText= 201.DlgMain.cbxBest2.HelpText= 203.DlgMain.cbxBest3.HelpText= +208.DlgMain.txtLeaderAppraise.HelpText= +210.DlgMain.imgTeamLeader.HelpText= diff --git a/oxt/PokemonGoIV/DlgMain.xdl b/oxt/PokemonGoIV/DlgMain.xdl index 3eba39f..fd862e4 100644 --- a/oxt/PokemonGoIV/DlgMain.xdl +++ b/oxt/PokemonGoIV/DlgMain.xdl @@ -1,11 +1,11 @@ - + - - - - + + + + @@ -165,6 +165,7 @@ + @@ -245,33 +246,34 @@ - + - + + - + - + - + - - - - + + + + + - - - - - - - + + + + + + - + \ No newline at end of file diff --git a/oxt/icons/team-leader-blanche.png b/oxt/icons/team-leader-blanche.png new file mode 100644 index 0000000..09104be Binary files /dev/null and b/oxt/icons/team-leader-blanche.png differ diff --git a/oxt/icons/team-leader-candela.png b/oxt/icons/team-leader-candela.png new file mode 100644 index 0000000..f7d914d Binary files /dev/null and b/oxt/icons/team-leader-candela.png differ diff --git a/oxt/icons/team-leader-spark.png b/oxt/icons/team-leader-spark.png new file mode 100644 index 0000000..40f93cc Binary files /dev/null and b/oxt/icons/team-leader-spark.png differ diff --git a/oxt/icons/team-instinct.png b/oxt/icons/team-logo-instinct.png similarity index 100% rename from oxt/icons/team-instinct.png rename to oxt/icons/team-logo-instinct.png diff --git a/oxt/icons/team-mystic.png b/oxt/icons/team-logo-mystic.png similarity index 100% rename from oxt/icons/team-mystic.png rename to oxt/icons/team-logo-mystic.png diff --git a/oxt/icons/team-valor.png b/oxt/icons/team-logo-valor.png similarity index 100% rename from oxt/icons/team-valor.png rename to oxt/icons/team-logo-valor.png diff --git a/oxt/icons/unknown.png b/oxt/icons/unknown.png new file mode 100644 index 0000000..70778b3 Binary files /dev/null and b/oxt/icons/unknown.png differ