Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Commit

Permalink
finish reset level func. add the same func in deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc12345 committed Feb 15, 2016
1 parent 3d3614a commit 98bd61e
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 99 deletions.
106 changes: 51 additions & 55 deletions ballance_tools/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
<ControlTemplate x:Key="ButtonControlTemplate" TargetType="{x:Type Button}">
<Grid>
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>

<Grid x:Name="face" Background="#ff000000" Opacity="0"/>

<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>

<!--<Border.Effect>
<DropShadowEffect BlurRadius="10" Color="#FFffffff" ShadowDepth="0" />
</Border.Effect>-->
Expand Down Expand Up @@ -193,66 +193,62 @@
</Grid>

<TextBlock Grid.Column="3" Grid.Row="1" Foreground="white" FontSize="20" Text="{Binding pro_title}"/>

<Expander Header="详细信息" Grid.Column="3" Grid.Row="3" Foreground="White" FontSize="15">
<Grid Background="#00000000">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>

<TextBlock Grid.Column="2" Grid.Row="1" Foreground="white" FontSize="15" Text="{Binding pro_creator}">
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_creator}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="3" Foreground="white" FontSize="15" Width="200" Text="{Binding pro_description}">
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_description}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="5" Foreground="white" FontSize="15" Text="{Binding pro_difficulty}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_difficulty}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="7" Foreground="white" FontSize="15" Text="{Binding pro_playcount}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_playcount}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="9" Foreground="white" FontSize="15" Text="{Binding pro_stars}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_stars}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="11" Foreground="white" FontSize="15" Text="{Binding pro_downloadcount}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_downloadcount}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<StackPanel Orientation="Vertical" Grid.Row="1">

<TextBlock Foreground="white" FontSize="15" Text="{Binding pro_creator}">
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_creator}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Foreground="white" FontSize="15" Width="200" Text="{Binding pro_description}" TextWrapping="Wrap" HorizontalAlignment="Left">
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_description}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Foreground="white" FontSize="15" Text="{Binding pro_difficulty}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_difficulty}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Foreground="white" FontSize="15" Text="{Binding pro_playcount}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_playcount}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Foreground="white" FontSize="15" Text="{Binding pro_stars}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_stars}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Foreground="white" FontSize="15" Text="{Binding pro_downloadcount}" >
<TextBlock.ToolTip>
<Grid Background="White" Width="200">
<TextBlock Foreground="Black" FontSize="15" Text="{Binding pro_downloadcount}" TextWrapping="Wrap"/>
</Grid>
</TextBlock.ToolTip>
</TextBlock>

</StackPanel>

</Grid>
</Expander>

Expand Down
22 changes: 17 additions & 5 deletions ballance_tools/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
<Grid Grid.Column="2">
<Grid.RowDefinitions >
<RowDefinition Height="150"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
Expand All @@ -237,14 +238,25 @@
<RowDefinition Height="10"/>
</Grid.RowDefinitions>

<TextBlock x:Name="ui_form_level_form_level_show_title" Foreground="White" FontSize="20" Grid.Row="1" Text=""/>
<TextBlock x:Name="ui_form_level_form_level_show_text" Foreground="White" FontSize="15" Grid.Row="3" Text=""/>
<!-- 文字遮罩-->
<Grid Grid.Row="1" Grid.RowSpan="4">
<Grid.Background >
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="#7f1e90ff" Offset="0"/>
<GradientStop Color="#7f1e90ff" Offset="0.3"/>
<GradientStop Color="#00000000" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
</Grid>

<TextBlock x:Name="ui_form_level_form_level_show_title" Margin="10,0,0,0" Foreground="White" FontSize="20" Grid.Row="1" Text="Ballance Map"/>
<TextBlock x:Name="ui_form_level_form_level_show_text" Margin="10,0,0,0" Foreground="White" FontSize="15" Grid.Row="3" Text="选择左侧地图来查看信息"/>
</Grid>

<!-- 英雄榜-->
<TextBlock Foreground="White" FontSize="15" Text="英雄榜" Grid.Row="1" TextAlignment="Center"/>
<TextBlock Foreground="White" FontSize="15" Text="英雄榜" Grid.Row="2" TextAlignment="Center"/>

<Grid x:Name="ui_form_level_form_hero_list_empty" Grid.Row="3" Opacity="0">
<Grid x:Name="ui_form_level_form_hero_list_empty" Grid.Row="4" Opacity="0">
<Grid.RowDefinitions >
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
Expand All @@ -253,7 +265,7 @@

<TextBlock Foreground="White" FontSize="15" Text="没有英雄榜记录" Grid.Row="1" TextAlignment="Center"/>
</Grid>
<ListBox x:Name="ui_form_level_form_hero_list" Grid.Row="3" Background="#00000000" BorderThickness="0" HorizontalContentAlignment="Stretch"/>
<ListBox x:Name="ui_form_level_form_hero_list" Grid.Row="4" Background="#00000000" BorderThickness="0" HorizontalContentAlignment="Stretch"/>

</Grid>

Expand Down
102 changes: 66 additions & 36 deletions ballance_tools/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,11 @@ sm_error:
System.IO.Directory.CreateDirectory(Environment.CurrentDirectory & "\cache\user")
End If


If System.IO.Directory.Exists(Environment.CurrentDirectory & "\system_nmo\level") = False Then
System.IO.Directory.CreateDirectory(Environment.CurrentDirectory & "\system_nmo\level")
End If

End Sub

#End Region
Expand Down Expand Up @@ -1814,45 +1819,70 @@ sm_error:

'还原
Private Sub ui_form_level_form_check_restart_btn(sender As Object, e As RoutedEventArgs)
'TODO:开发完这个功能
'If ui_connect_form_level_form_check_list.Count <> 0 Then
' Dim select_level(13) As Boolean
' For a = 1 To 13
' select_level(a) = False
' Next

' For b = 0 To ui_form_level_form_check_list.SelectedItems.Count - 1
' For c = 0 To ui_connect_form_level_form_check_list.Count
' '相同了
' If ui_connect_form_level_form_check_list.Item(c).Equals(ui_form_level_form_check_list.SelectedItems.Item(b)) = True Then
' select_level(c + 1) = True
' Exit For
' End If
' Next
' Next


' If ui_form_level_form_check_list.SelectedIndex <> -1 Then
' Dim ok_word As String = "确认重置以下关卡吗?"
' For d = 1 To 13
' If select_level(d) = True Then
' ok_word = ok_word & vbCrLf & "Level " & d & "(第" & d & "关)"
' End If
' Next

' If MsgBox(ok_word, MsgBoxStyle.OkCancel + 32, "Ballance工具箱") = MsgBoxResult.Ok Then
' '开始替换

' End If
' Else
' MsgBox("您没有选中任何关卡", 16, "Ballance工具箱")
' End If

'Else
If ui_connect_form_level_form_check_list.Count <> 0 Then
Dim select_level(15) As Boolean
For a = 1 To 15
select_level(a) = False
Next

' MsgBox("请先检测一次所有关卡才能进行重置", 16, "Ballance工具箱")
For b = 0 To ui_form_level_form_check_list.SelectedItems.Count - 1
For c = 0 To ui_connect_form_level_form_check_list.Count - 1
'相同了
If ui_connect_form_level_form_check_list.Item(c).Equals(ui_form_level_form_check_list.SelectedItems.Item(b)) = True Then
select_level(c + 1) = True
Exit For
End If
Next
Next


If ui_form_level_form_check_list.SelectedIndex <> -1 Then
Dim ok_word As String = "确认重置以下关卡吗?"
For d = 1 To 15
If select_level(d) = True Then
ok_word = ok_word & vbCrLf & "Level " & d & "(第" & d & "关)"
End If
Next

window_dialogs_show("Ballance工具箱", ok_word, 1, 2, False, "确认", "取消", Me)
If window_dialogs_select_btn = 0 Then
'开始替换
Dim result As String = "以下是替换的信息:"
For d = 1 To 15
If select_level(d) = True Then
If System.IO.File.Exists(Environment.CurrentDirectory & "\system_nmo\level\" & d & ".nmo") = True Then

If d >= 10 Then
System.IO.File.Delete(ballance_start_path & "3d entities\level\level_" & d & ".nmo")
System.IO.File.Copy(Environment.CurrentDirectory & "\system_nmo\level\" & d & ".nmo",
ballance_start_path & "3d entities\level\level_" & d & ".nmo")
Else
System.IO.File.Delete(ballance_start_path & "3d entities\level\level_0" & d & ".nmo")
System.IO.File.Copy(Environment.CurrentDirectory & "\system_nmo\level\" & d & ".nmo",
ballance_start_path & "3d entities\level\level_0" & d & ".nmo")
End If

result = result & vbCrLf & "Level " & d & " 替换成功"
Else
result = result & vbCrLf & "Level " & d & "替换错误,没有对应资源"
End If
End If
Next

window_dialogs_show("Ballance工具箱", result, 0, 1, False, "确认", "", Me)

End If
Else
window_dialogs_show("Ballance工具箱", "您没有选中任何关卡", 2, 1, False, "确认", "", Me)
End If

Else

window_dialogs_show("Ballance工具箱", "请先检测一次所有关卡才能进行重置", 2, 1, False, "确认", "", Me)

End If

'End If
End Sub


Expand Down
Binary file modified ballance_tools/bin/Release/ballance_tools.exe
Binary file not shown.
Binary file modified ballance_tools/bin/Release/ballance_tools_deploy.exe
Binary file not shown.
34 changes: 34 additions & 0 deletions ballance_tools_deploy/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,39 @@

</TabItem>

<!-- level-->
<TabItem Header="原版关卡包" Style="{DynamicResource ui_temp_normal_tabitem}">

<Grid>
<Grid.RowDefinitions >
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="20"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>

<TextBlock Text="原版关卡包是工具箱中地图界面的还原原版关卡所需的文件,没有此文件,无法还原原版关卡&#x000A;
该部署可有可无,如果你需要经常重置地图的话,可以部署" Foreground="White" FontSize="15" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.ColumnSpan="6"/>

<TextBlock Foreground="White" FontSize="15" Grid.Row="3" Grid.Column="0" Text="原版关卡包打包文件:" VerticalAlignment="Center"/>
<TextBox x:Name="ui_level_text" IsReadOnly="True" Foreground="White" FontSize="15" Grid.Row="3" Grid.Column="1" Text="" Background="#00000000" BorderThickness="0,0,0,1" VerticalContentAlignment="Center"/>

<Button Content="选择源文件" FontSize="15" Foreground="white" Grid.Row="3" Grid.Column="3" Background="#ff1e90ff" BorderThickness="1" Click="select_packups"/>
<Button Content="立即部署" FontSize="15" Foreground="white" Grid.Row="3" Grid.Column="5" Background="#ff1e90ff" BorderThickness="1" Click="file_free"/>

</Grid>

</TabItem>

<!-- bml-->
<TabItem Header="BML安装源" Style="{DynamicResource ui_temp_normal_tabitem}">

Expand Down Expand Up @@ -234,6 +267,7 @@

</TabItem>


</TabControl>

</TabItem>
Expand Down
Loading

0 comments on commit 98bd61e

Please sign in to comment.