Skip to content

Commit 252db83

Browse files
committed
code
1 parent e1d3662 commit 252db83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3072
-0
lines changed

About.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "About.h"
2+
#include "config.h"
3+
4+
About::About(QWidget *parent)
5+
: QWidget(parent)
6+
{
7+
ui.setupUi(this);
8+
loadAboutVersion();
9+
}
10+
11+
About::~About()
12+
{}
13+
14+
void About::loadAboutVersion()
15+
{
16+
QString VersionText = QString("Current Version: ") + QString(GAME_VERSION);
17+
ui.CV->setText(VersionText);
18+
QFont font;
19+
font.setPointSize(12);
20+
font.setBold(true);
21+
ui.CV->setFont(font);
22+
}
23+

About.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include <QWidget>
4+
#include "ui_About.h"
5+
6+
class About : public QWidget
7+
{
8+
Q_OBJECT
9+
10+
public:
11+
About(QWidget *parent = nullptr);
12+
~About();
13+
14+
void loadAboutVersion();
15+
private:
16+
Ui::AboutClass ui;
17+
};

About.ui

Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>AboutClass</class>
4+
<widget class="QWidget" name="AboutClass">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>500</width>
10+
<height>700</height>
11+
</rect>
12+
</property>
13+
<property name="sizePolicy">
14+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
15+
<horstretch>0</horstretch>
16+
<verstretch>0</verstretch>
17+
</sizepolicy>
18+
</property>
19+
<property name="minimumSize">
20+
<size>
21+
<width>500</width>
22+
<height>700</height>
23+
</size>
24+
</property>
25+
<property name="maximumSize">
26+
<size>
27+
<width>500</width>
28+
<height>700</height>
29+
</size>
30+
</property>
31+
<property name="windowTitle">
32+
<string>About</string>
33+
</property>
34+
<property name="styleSheet">
35+
<string notr="true">#AboutClass {
36+
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(56, 194, 238, 255), stop:1 rgba(53, 197, 210, 255));
37+
}</string>
38+
</property>
39+
<widget class="QGroupBox" name="Author">
40+
<property name="geometry">
41+
<rect>
42+
<x>50</x>
43+
<y>100</y>
44+
<width>400</width>
45+
<height>150</height>
46+
</rect>
47+
</property>
48+
<property name="sizePolicy">
49+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
50+
<horstretch>0</horstretch>
51+
<verstretch>0</verstretch>
52+
</sizepolicy>
53+
</property>
54+
<property name="maximumSize">
55+
<size>
56+
<width>400</width>
57+
<height>150</height>
58+
</size>
59+
</property>
60+
<property name="styleSheet">
61+
<string notr="true">#Author {
62+
font-weight: bold;
63+
font-size: 16px;
64+
}
65+
</string>
66+
</property>
67+
<property name="title">
68+
<string>Author</string>
69+
</property>
70+
<widget class="QLabel" name="Avatarimg">
71+
<property name="geometry">
72+
<rect>
73+
<x>20</x>
74+
<y>30</y>
75+
<width>100</width>
76+
<height>100</height>
77+
</rect>
78+
</property>
79+
<property name="sizePolicy">
80+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
81+
<horstretch>0</horstretch>
82+
<verstretch>0</verstretch>
83+
</sizepolicy>
84+
</property>
85+
<property name="maximumSize">
86+
<size>
87+
<width>100</width>
88+
<height>100</height>
89+
</size>
90+
</property>
91+
<property name="styleSheet">
92+
<string notr="true"/>
93+
</property>
94+
<property name="text">
95+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/Nero978&quot;&gt;&lt;img src=&quot;:/assets/images/Avatar.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
96+
</property>
97+
<property name="scaledContents">
98+
<bool>true</bool>
99+
</property>
100+
<property name="openExternalLinks">
101+
<bool>true</bool>
102+
</property>
103+
</widget>
104+
<widget class="QLabel" name="name">
105+
<property name="geometry">
106+
<rect>
107+
<x>140</x>
108+
<y>30</y>
109+
<width>111</width>
110+
<height>31</height>
111+
</rect>
112+
</property>
113+
<property name="text">
114+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt; font-weight:700;&quot;&gt;Chris Liu&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
115+
</property>
116+
</widget>
117+
<widget class="QLabel" name="label">
118+
<property name="geometry">
119+
<rect>
120+
<x>140</x>
121+
<y>70</y>
122+
<width>161</width>
123+
<height>61</height>
124+
</rect>
125+
</property>
126+
<property name="text">
127+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;[email protected]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Beijing Forestry University&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
128+
</property>
129+
</widget>
130+
</widget>
131+
<widget class="QLabel" name="title">
132+
<property name="geometry">
133+
<rect>
134+
<x>160</x>
135+
<y>30</y>
136+
<width>171</width>
137+
<height>51</height>
138+
</rect>
139+
</property>
140+
<property name="text">
141+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:18pt; font-weight:700;&quot;&gt;About Surf&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
142+
</property>
143+
</widget>
144+
<widget class="QGroupBox" name="Update">
145+
<property name="geometry">
146+
<rect>
147+
<x>50</x>
148+
<y>280</y>
149+
<width>400</width>
150+
<height>200</height>
151+
</rect>
152+
</property>
153+
<property name="styleSheet">
154+
<string notr="true">#Update {
155+
font-weight: bold;
156+
font-size: 16px;
157+
}
158+
</string>
159+
</property>
160+
<property name="title">
161+
<string>Update</string>
162+
</property>
163+
<widget class="QLabel" name="CV">
164+
<property name="geometry">
165+
<rect>
166+
<x>20</x>
167+
<y>30</y>
168+
<width>301</width>
169+
<height>31</height>
170+
</rect>
171+
</property>
172+
<property name="text">
173+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;Current Version: 0.0.1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
174+
</property>
175+
</widget>
176+
<widget class="QLabel" name="verIntro">
177+
<property name="geometry">
178+
<rect>
179+
<x>20</x>
180+
<y>70</y>
181+
<width>361</width>
182+
<height>111</height>
183+
</rect>
184+
</property>
185+
<property name="inputMethodHints">
186+
<set>Qt::ImhMultiLine</set>
187+
</property>
188+
<property name="text">
189+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;If there are any bug with this version, please report it to me to help me improve it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;You can also go to the website to download the latest version, which can solve the problems probably.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://cdn.rxgzs.cn/Surf&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:700; text-decoration: underline; color:#0000ff;&quot;&gt;Check Update&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
190+
</property>
191+
<property name="wordWrap">
192+
<bool>true</bool>
193+
</property>
194+
<property name="openExternalLinks">
195+
<bool>true</bool>
196+
</property>
197+
</widget>
198+
</widget>
199+
<widget class="QGroupBox" name="Copyright">
200+
<property name="geometry">
201+
<rect>
202+
<x>50</x>
203+
<y>510</y>
204+
<width>400</width>
205+
<height>150</height>
206+
</rect>
207+
</property>
208+
<property name="sizePolicy">
209+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
210+
<horstretch>0</horstretch>
211+
<verstretch>0</verstretch>
212+
</sizepolicy>
213+
</property>
214+
<property name="maximumSize">
215+
<size>
216+
<width>400</width>
217+
<height>150</height>
218+
</size>
219+
</property>
220+
<property name="styleSheet">
221+
<string notr="true">#Copyright {
222+
font-weight: bold;
223+
font-size: 16px;
224+
}
225+
</string>
226+
</property>
227+
<property name="title">
228+
<string>Copyright</string>
229+
</property>
230+
<widget class="QLabel" name="copyrightText">
231+
<property name="geometry">
232+
<rect>
233+
<x>20</x>
234+
<y>30</y>
235+
<width>361</width>
236+
<height>101</height>
237+
</rect>
238+
</property>
239+
<property name="text">
240+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;The idea of the game and some image materials come from Microsoft Edge. Please do not use them without Microsoft‘s permission.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;This game was rewritten by Chris Liu using C++ for CPP class 2023, and is only used for non commercial purposes.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
241+
</property>
242+
<property name="alignment">
243+
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
244+
</property>
245+
<property name="wordWrap">
246+
<bool>true</bool>
247+
</property>
248+
</widget>
249+
</widget>
250+
<widget class="QWidget" name="bg" native="true">
251+
<property name="geometry">
252+
<rect>
253+
<x>0</x>
254+
<y>0</y>
255+
<width>500</width>
256+
<height>700</height>
257+
</rect>
258+
</property>
259+
<property name="sizePolicy">
260+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
261+
<horstretch>0</horstretch>
262+
<verstretch>0</verstretch>
263+
</sizepolicy>
264+
</property>
265+
<property name="styleSheet">
266+
<string notr="true">#bg {
267+
268+
background-image: url(:/assets/images/bg1280.png);
269+
}</string>
270+
</property>
271+
</widget>
272+
<zorder>bg</zorder>
273+
<zorder>Author</zorder>
274+
<zorder>title</zorder>
275+
<zorder>Update</zorder>
276+
<zorder>Copyright</zorder>
277+
</widget>
278+
<layoutdefault spacing="6" margin="11"/>
279+
<resources>
280+
<include location="Surf.qrc"/>
281+
</resources>
282+
<connections/>
283+
</ui>

Ambient64.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include "Ambient64.h"
2+
3+
Ambient64::Ambient64(int id)
4+
{
5+
if (id >= 0 && id < 4)
6+
{
7+
objId = id;
8+
}
9+
else
10+
{
11+
objId = 0;
12+
}
13+
14+
width = 64;
15+
height = 64;
16+
objRect.setWidth(width);
17+
objRect.setHeight(height);
18+
19+
objImage.load(AMBIENT_PATH);
20+
for (int i = 0; i < 6; i++)
21+
{
22+
ambient64[i] = objImage.copy(objId * width, i * height, width, height);
23+
}
24+
AnimotionId = 0;
25+
Out = ambient64[AnimotionId];
26+
}
27+
28+
Ambient64::~Ambient64()
29+
{
30+
}
31+
32+
33+
34+
void Ambient64::updateAnimo()
35+
{
36+
AnimotionId = (AnimotionId + 1) % 6;
37+
Out = ambient64[AnimotionId];
38+
}
39+
40+
QPixmap Ambient64::getImg()
41+
{
42+
return Out;
43+
}

Ambient64.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
#include "Objects.h"
3+
#include "config.h"
4+
5+
class Ambient64 : public Objects
6+
{
7+
public:
8+
QPixmap ambient64[6];
9+
QPixmap Out;
10+
int AnimotionId = 0;
11+
12+
Ambient64(int id);
13+
~Ambient64();
14+
15+
void updateAnimo();
16+
QPixmap getImg() override;
17+
};

0 commit comments

Comments
 (0)